Tennis data in Python: REST JSON and Pandas CSVs
One requests.Session helper covers live ATP/WTA scores, point-in-time surface Elo, serve/return leaderboards, and head-to-head splits — plus direct Pandas loading from Master + Daily Delta CSV exports.
Pro $59/mo: real-time scores, full archive since 1968, match webhooks. Free: 500 calls/month, live 60 s delayed, last 30 days. Read the docs
$ curl "https://api.citoapi.com/api/v1/tennis/rankings?circuit=atp&page_size=5" \
-H "x-api-key: YOUR_API_KEY"In short
Call https://api.citoapi.com/api/v1/tennis/* from Python using requests with x-api-key and ETag 304 caching, or load 2.25M+ matches enriched with surface Elo and odds straight into Pandas via /api/v1/exports/tennis/matches-master.csv.gz.
One Python helper for every Tennis endpoint
Every endpoint returns clean JSON over HTTPS. Authenticate with the x-api-key header (or Authorization: Bearer), reuse ETag headers with If-None-Match so unchanged live polls return 304 Not Modified, and pass ?include=stats,elo,odds on /tennis/matches to avoid extra round-trips.
tennis_client.py — Live board, rankings by date, H2H & leaderboards
import os
import requests
API = "https://api.citoapi.com/api/v1/tennis"
session = requests.Session()
session.headers.update({"x-api-key": os.environ["CITO_API_KEY"]})
def get(path: str, **params) -> dict:
r = session.get(f"{API}{path}", params=params, timeout=15)
r.raise_for_status()
return r.json()
# 1. Live ATP & WTA matches right now
for m in get("/matches/live", page_size=10)["items"]:
sets = " ".join(s["score"] for s in m.get("sets", []))
print(m["tournament_name"], "|", m["player1"]["name"], "vs", m["player2"]["name"], sets, m.get("game_score"))
# 2. Weekly ATP rankings (latest or any historical Monday)
top5 = get("/rankings", circuit="atp", page_size=5)
for row in top5["items"]:
print(f"#{row['rank']} {row['player_name']} ({row['points']} pts)")
# 3. Season serve & return leaderboards (aces, 1st-serve-won, break-points-saved)
aces = get("/leaderboards/aces", season=2026, tour="ATP", limit=5)
print("2026 Aces leaders:", aces["items"][:3])import io
import os
import pandas as pd
import requests
# Inspect schema free (no API key needed):
sample = pd.read_csv("https://api.citoapi.com/api/v1/exports/sample/tennis/matches.csv")
print("Columns:", list(sample.columns))
# Or download full 2.25M+ Master Baseline on Business CSV ($299/mo, 0 REST credits):
# r = requests.get("https://api.citoapi.com/api/v1/exports/tennis/matches-master.csv.gz",
# headers={"x-api-key": os.environ["CITO_API_KEY"]}, timeout=120)
# df = pd.read_csv(io.BytesIO(r.content), compression="gzip", low_memory=False)Weekly ATP rankings response
curl "https://api.citoapi.com/api/v1/tennis/rankings?circuit=atp&page_size=5" \
-H "x-api-key: YOUR_API_KEY"{
"success": true,
"ranking_date": "2026-11-09",
"tour": "ATP",
"items": [
{
"rank": 1,
"player_id": "atp_100644",
"player_name": "Alexander Zverev",
"ioc": "GER",
"points": 9550,
"rank_movement": 0,
"previous_rank": 1
},
{
"rank": 2,
"player_id": "atp_206173",
"player_name": "Jannik Sinner",
"ioc": "ITA",
"points": 9450,
"rank_movement": 0,
"previous_rank": 2
},
{
"rank": 3,
"player_id": "atp_207989",
"player_name": "Carlos Alcaraz",
"ioc": "ESP",
"points": 7100,
"rank_movement": 0,
"previous_rank": 3
}
]
}Match list with inline serve/return stats
curl "https://api.citoapi.com/api/v1/tennis/matches?player_id=atp_206173&year=2025&page_size=1&include=stats" \
-H "x-api-key: YOUR_API_KEY"{
"items": [
{
"id": "atp_2025_0605_374",
"tournament_name": "ATP Finals",
"match_date": "2025-11-09",
"surface": "Hard",
"round_name": "Round Robin",
"score": "7-5 6-1",
"winner": {
"id": "atp_206173",
"name": "Jannik Sinner",
"rank": 2,
"age": 24.2
},
"loser": {
"id": "atp_200000",
"name": "Felix Auger-Aliassime",
"rank": 8,
"age": 25.2
},
"stats": {
"winner": {
"aces": 3,
"double_faults": 1,
"first_serve_pct": 70.59,
"first_serve_won_pct": 88.89,
"second_serve_won_pct": 60,
"break_points_saved": 0,
"break_points_faced": 0,
"return_points_won": 32
},
"loser": {
"aces": 9,
"double_faults": 2,
"first_serve_pct": 66.2,
"first_serve_won_pct": 63.83,
"second_serve_won_pct": 37.5,
"break_points_saved": 7,
"break_points_faced": 10,
"return_points_won": 10
}
}
}
]
}Head-to-head split by surface and level
curl "https://api.citoapi.com/api/v1/tennis/h2h?player1_id=atp_206173&player2_id=atp_207989" \
-H "x-api-key: YOUR_API_KEY"{
"player1": {
"id": "atp_206173",
"name": "Jannik Sinner",
"current_rank": 2,
"wins": 7
},
"player2": {
"id": "atp_207989",
"name": "Carlos Alcaraz",
"current_rank": 3,
"wins": 11
},
"summary": {
"total_matches": 18,
"finals_matches": 9,
"player1_finals_wins": 4,
"player2_finals_wins": 5,
"grand_slam_matches": 6,
"player1_grand_slam_wins": 2,
"player2_grand_slam_wins": 4
},
"surface_breakdown": {
"hard": {
"player1_wins": 3,
"player2_wins": 7,
"total": 10
},
"clay": {
"player1_wins": 2,
"player2_wins": 4,
"total": 6
},
"grass": {
"player1_wins": 2,
"player2_wins": 0,
"total": 2
}
},
"level_breakdown": {
"grand_slam": {
"player1_wins": 2,
"player2_wins": 4,
"total": 6
},
"masters_1000": {
"player1_wins": 2,
"player2_wins": 5,
"total": 7
},
"tour_finals": {
"player1_wins": 1,
"player2_wins": 0,
"total": 1
}
}
}Key Python routes for tennis models & apps
| Job | Endpoint | Key parameters |
|---|---|---|
| Live scoreboards | GET /tennis/matches/live | page_size, stats, include |
| Point-by-point timeline | GET /tennis/matches/{match_id}/timeline | match_id (canonical or live key) |
| Historical match archive | GET /tennis/matches | player_id, surface, year, date_start, date_end, include=stats,elo,odds |
| Surface Elo & trajectories | GET /tennis/rankings/elo & /players/{id}/elo | surface=Hard|Clay|Grass, tour, history_limit |
| Season stat leaderboards | GET /tennis/leaderboards/{metric} | aces, 1st-serve-won, break-points-saved, return-games-won |
| Bulk Pandas CSVs | GET /exports/tennis/matches-master.csv.gz | 0 REST credits on Business CSV ($299/mo); sample CSV open |
Prototype Python scripts on a Free key (500 credits/mo + 3-day odds & Elo trial), ship live apps on Pro ($59/mo), or load all 2.25M+ matches into Pandas on Business CSV ($299/mo).
Plans for tennis
| Free | Starter | Pro | Scale | Business CSV | |
|---|---|---|---|---|---|
| Price | $0 | $15/mo | $59/mo | $100/mo | $299/mo (+$99/mo extra sport) |
| Credits / mo | 500/month | 10,000/month | 250,000/month | 1,000,000/month | 3,000,000/month |
| Rate limit | 10/min | 30/min | 100/min | 400/min | 600/min |
| Live scores | 60 s delayed | 60 s delayed | Real time | Real time | Real time |
| History | Last 30 days | Last 90 days | Full archive (1968-) | Full archive (1968-) | Full archive (1968-) + Master/Delta CSV |
| Deep-history (>90d) sub-cap | 0 | 0 | 50,000/mo (5x narrow / bulk) | 100,000/mo (5x narrow / bulk) | Unlimited in quota |
| Prediction-market odds | 3-day free trial | Upgrade to Pro | Pre-match, live & history | Pre-match, live & history | API + opening/closing CSV |
| Point-in-time Elo | 3-day free trial | Career & leaders | Full 1968- history | Full 1968- history | API + pre-match CSV |
| Webhooks | No | No | Yes | Yes | Yes |
| WebSockets | No | No | +$15/mo (points + odds) | Included | Included (points + odds) |
| Bulk CSV exports | Sample CSV | — | — | — | Master + Daily Delta CSV (0 REST credits) |
| Commercial use | No | 1 product | Yes | Yes | Yes |
Tennis on each plan, as the API enforces it (checked 15 Nov 2026). Paid API plans: 7-day money-back guarantee.
Frequently asked
Ready to go
live ?
Pro unlocks real-time scores, point-by-point, prediction-market odds, point-in-time Elo back to 1968, and webhooks for $59/mo with a 7-day money-back guarantee. Free includes a 3-day odds & Elo trial; Business ($299/mo) delivers full CSV datasets.
Compare every plan