Matches
Live match
GET
https://api.tennisdatabaseapi.com/v1/live/{id}Live and CompleteOne match in play: the live score and every game so far, point by point, with who served, breaks, break points and set points. After it leaves Live, its last score stays here 7 days (meta.in_live false).
Free key not includedLive includedArchive not includedComplete included
Try itRuns against the live API with your key. Your key stays in this browser.API
GEThttps://api.tennisdatabaseapi.com/v1/live/{id}
1Parameters
| Name | What it is |
|---|---|
idrequired | An id from another answer, such as mt_ and 8 characters. Ids are our own and never change. |
Anything else in the address answers 422 unknown_parameter, with the list of parameters this endpoint takes.
2Request
curl -H "Authorization: Bearer $TDA_KEY" \ "https://api.tennisdatabaseapi.com/v1/live/{id}"
$ch = curl_init('https://api.tennisdatabaseapi.com/v1/live/{id}'); 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/live/{id}", headers={"Authorization": f"Bearer {os.environ['TDA_KEY']}"}, ) print(r.json()["data"])
const r = await fetch("https://api.tennisdatabaseapi.com/v1/live/{id}", { 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
The example answers are being prepared. Try it above shows the real answer meanwhile.
4Fields
| Field | What it holds |
|---|---|
id, status, score, player_1, player_2 | As in Live scores |
point_by_point | Every game so far, in order: set, game, tiebreak, server, won_by (null for the game in progress), break, games_after, points (player_1 first), break_points and set_points (the point numbers). A tie-break is one game with tiebreak true, its points the running tie-break score, player_1 first |
point_by_point_read_at | When the games were last read: at once when the score changes, at least every 2 minutes |
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. |
not_found | No such id. |
unknown_parameter | A parameter this endpoint does not take. |
rate_limited | Too many calls this minute, or the allowance used (quota_exceeded). |