DocsStart here
Quick start
Three steps from nothing to yesterday's results in your code.
Get a free key
Sign in with Google and your key is made at once: 50 calls a day, yesterday to two days ahead, no card. Get a free key
Send it as a Bearer token
Every call takes the key in the Authorization header. A key in the address is refused.
Ask for yesterday's results
Paste this with your key in TDA_KEY, or run it in Try it on GET /results/yesterday.
curl -H "Authorization: Bearer $TDA_KEY" \ "https://api.tennisdatabaseapi.com/v1/results/yesterday?tour=men&tier=tour"
$ch = curl_init('https://api.tennisdatabaseapi.com/v1/results/yesterday?tour=men&tier=tour'); 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/results/yesterday?tour=men&tier=tour", headers={"Authorization": f"Bearer {os.environ['TDA_KEY']}"}, ) print(r.json()["data"])
const r = await fetch("https://api.tennisdatabaseapi.com/v1/results/yesterday?tour=men&tier=tour", { headers: { Authorization: `Bearer ${process.env.TDA_KEY}` }, }); const { data } = await r.json(); console.log(data);
1What comes back
A list of matches in data, and meta with the page and the total. On the free key, yesterday's matches carry odds in full; on a match not yet played odds is null and meta.held_back says so: the same code reads prices before play once you upgrade.