GET
https://api.tennisdatabaseapi.com/v1/markets/marginsPaid plansEach bookmaker's average margin on its closing prices since the start of last year.
Free key not includedLive includedArchive includedComplete included
Try itRuns against the live API with your key. Your key stays in this browser.API
GEThttps://api.tennisdatabaseapi.com/v1/markets/margins
1Parameters
None. Anything in the address answers 422 unknown_parameter.
2Request
curl -H "Authorization: Bearer $TDA_KEY" \ "https://api.tennisdatabaseapi.com/v1/markets/margins"
$ch = curl_init('https://api.tennisdatabaseapi.com/v1/markets/margins'); curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TDA_KEY')], CURLOPT_RETURNTRANSFER => true, ]); $answer = json_decode(curl_exec($ch), true); print_r($answer['data']);
import os, requests r = requests.get( "https://api.tennisdatabaseapi.com/v1/markets/margins", headers={"Authorization": f"Bearer {os.environ['TDA_KEY']}"}, ) print(r.json()["data"])
const r = await fetch("https://api.tennisdatabaseapi.com/v1/markets/margins", { headers: { Authorization: `Bearer ${process.env.TDA_KEY}` }, }); const { data } = await r.json(); console.log(data);
The code follows the form in Try it, with your key in it once you have entered one. Without a key it reads $TDA_KEY.
3Answer
{
"data": [
{ "bookmaker": "Exchange", "matches": 6180, "average_margin_pct": 0.71 },
{ "bookmaker": "Best price", "matches": 9885, "average_margin_pct": 2.12 },
{ "bookmaker": "Pinnacle", "matches": 80259, "average_margin_pct": 4.88 },
"..."
],
"meta": {
"since": "2025-01-01",
"counted_at": "2026-11-18 03:47:34",
"note": "The margin is the sum of the two closing prices' implied chances, less one: the lower, the better the price."
}
}{
"error": {
"code": "upgrade_required",
"message": "This endpoint is on the Live plan and above.",
"plan": "Live",
"upgrade": "https://tennisdatabaseapi.com/pricing",
"docs": "https://tennisdatabaseapi.com/documentation/errors"
}
}{
"error": {
"code": "unknown_parameter",
"message": "Unknown parameter: plan. This endpoint takes: no parameters.",
"docs": "https://tennisdatabaseapi.com/documentation/errors"
}
}Real answers from the API, made 2026-11-18. Long lists are cut to three items here.
4Fields
| Field | What it holds |
|---|---|
bookmaker, matches, average_margin_pct | Each bookmaker, the matches priced and the average margin, lowest first |
5Errors
unauthorized | No key, or a key that is unknown or revoked. |
upgrade_required | The free key: this endpoint is on the Live plan and above. |
unknown_parameter | A parameter this endpoint does not take. |
rate_limited | Too many calls this minute, or the allowance used (quota_exceeded). |