Getting Started
Your First Request
This guide walks you through authentication, the base URL structure, query parameters, and working code examples so you can integrate the Tennis API in minutes.
Step 1 β Subscribe on RapidAPI
The Tennis API is distributed exclusively through RapidAPI.
- Visit the Tennis API (ATP, WTA, ITF) listing on RapidAPI.
- Click Subscribe and select a pricing plan.
- Copy your
X-RapidAPI-Keyfrom the Security tab or the code snippets panel.
X-RapidAPI-Key in client-side JavaScript or public repositories. Use environment variables or a secrets manager.
Step 2 β Base URL & Headers
Every request targets:
https://tennis-api-atp-wta-itf.p.rapidapi.com
Include these two headers on every request:
| Header | Value | |
|---|---|---|
X-RapidAPI-Key |
YOUR_RAPIDAPI_KEY |
Required |
X-RapidAPI-Host |
tennis-api-atp-wta-itf.p.rapidapi.com |
Required |
Step 3 β URL Structure
Most endpoints follow this pattern:
GET /tennis/v2/{type}/{module}/{params}
| Segment | Values | Description |
|---|---|---|
{type} | atp Β· wta | Tour selection |
{module} | fixtures Β· player Β· h2h Β· ranking Β· tournament | Resource module |
{params} | IDs, dates, etc. | Module-specific path parameters |
Step 4 β Make Your First Call
Let's fetch today's ATP fixtures as a quick smoke-test:
curl --request GET \
--url 'https://tennis-api-atp-wta-itf.p.rapidapi.com/tennis/v2/atp/fixtures' \
--header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
--header 'X-RapidAPI-Host: tennis-api-atp-wta-itf.p.rapidapi.com'
const response = await fetch(
'https://tennis-api-atp-wta-itf.p.rapidapi.com/tennis/v2/atp/fixtures',
{
method: 'GET',
headers: {
'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
'X-RapidAPI-Host': 'tennis-api-atp-wta-itf.p.rapidapi.com'
}
}
);
const data = await response.json();
console.log(data);
import requests
url = "https://tennis-api-atp-wta-itf.p.rapidapi.com/tennis/v2/atp/fixtures"
headers = {
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
"X-RapidAPI-Host": "tennis-api-atp-wta-itf.p.rapidapi.com"
}
response = requests.get(url, headers=headers)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tennis-api-atp-wta-itf.p.rapidapi.com/tennis/v2/atp/fixtures",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"X-RapidAPI-Key: YOUR_RAPIDAPI_KEY",
"X-RapidAPI-Host: tennis-api-atp-wta-itf.p.rapidapi.com"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response Format
All responses are JSON arrays or objects. A typical fixtures response looks like:
[
{
"id": 482910,
"date": "2025-06-02T10:00:00.000Z",
"player1Id": 68074,
"player2Id": 47275,
"tournamentId": 20340,
"roundId": 3,
"player1": {
"id": 68074,
"name": "Carlos Alcaraz",
"countryAcr": "ESP"
},
"player2": {
"id": 47275,
"name": "Jannik Sinner",
"countryAcr": "ITA"
}
}
]
Query Parameters
Several endpoints support optional query parameters for filtering. These are passed as standard URL query strings:
| Parameter | Type | Description |
|---|---|---|
PlayerGroup |
string | Filter fixtures by match type: singles, doubles, or both (default). |
TourRank |
string | Comma-separated tournament rank IDs to filter by. Requires tournament include. |
TourCourt |
string | Comma-separated court type IDs. Requires tournament include. |
TourCountry |
string | Comma-separated country acronyms (e.g. USA,FRA). Requires tournament include. |
TourRank, TourCourt, TourCountry) only take effect when the corresponding relation is requested using an include query parameter.
Rate Limits
A server-side throttle of 100 requests per minute per IP applies to all endpoints. On breach, the API returns:
{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}
Error Handling
The API uses standard HTTP status codes to indicate success or failure. Always check the HTTP status code before processing the response body.
| Status Code | Description |
|---|---|
200 OK | Request succeeded. Response contains the requested data. |
400 Bad Request | Invalid input parameters (e.g., invalid date format, non-numeric ID, invalid type parameter). |
404 Not Found | Resource not found (e.g., invalid player ID, tournament ID, or season ID). |
429 Too Many Requests | Rate limit exceeded. Wait before retrying. |
500 Internal Server Error | Server error. Contact support if this persists. |
When an error occurs, the response body contains a JSON object with error details:
{
"error": true,
"statusCode": 400,
"message": "Invalid date format. Expected YYYY-MM-DD."
}
Next Steps
Now that you can make requests, explore the individual modules:
- Fixtures β match schedule, live fixtures, date-range queries
- Players β player profiles, stats, surface summaries
- Head-to-Head β rivalry records and per-match stats
- Rankings β live ATP & WTA world rankings
- Tournaments β event calendar, seasons, past champions
- Miscellaneous β reference data and full-text search