How do I get set-by-set tennis scores for a tournament in Python?
Every match of a tournament with seeds, winner and each set's games and tiebreak, flattened into one row per set.
Code verified November 18, 2026. One call to get_matches, 2 credits.
The call
tournament_id comes from list_tournaments. It is the tournament number and the year.
import requests
import pandas as pd
API_KEY = "YOUR_API_KEY"
resp = requests.post(
"https://mcp.acesapi.com/v1/get_matches",
headers={"x-api-key": API_KEY},
json={
"tournament_id": "42-2026",
"limit": 100,
},
timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]
matches = pd.DataFrame(data["matches"])
main = matches[matches["draw"] == "main"]
sets = pd.json_normalize(main.to_dict("records"), record_path="sets", meta=["match_id", "round", "player1", "player2"])
print(len(main), "main-draw matches,", len(sets), "sets")
print(sets[["round", "player1", "player2", "set_no", "games1", "games2", "tiebreak1", "tiebreak2"]].head(10))
print("sets decided by a tiebreak:", int(sets["tiebreak1"].notna().sum()))
Replace YOUR_API_KEY with a key from your dashboard. Python needs requests and pandas (pip install requests pandas). JavaScript runs on Node 18 or newer, or in the browser.
Or use the official client: pip install acesapi
What comes back
The data object of the response, trimmed to the first rows. Every field is real output from the run above.
{
"tour": "ATP",
"matches": [
{
"match_id": "176456",
"tournament": "Rolex Monte-Carlo Masters",
"draw": "qualifying",
"round": "Qualifying 1st Round",
"player1": "Emilio Nava",
"seed1": null,
"player2": "Quentin Halys",
"seed2": null,
"winner_id": "3772",
"score": "6-4 6-4",
"sets": [
{
"set_no": 1,
"games1": 6,
"games2": 4,
"tiebreak1": null,
"tiebreak2": null,
"winner": 1
},
"...1 more"
]
},
"...75 more"
],
"count": 76,
"next_offset": null
}What to do next
- get_tournament (2 credits). The same tournament as a draw, round by round.
- list_tournaments (1 credit). Find tournament ids by season, surface or status.
The data this uses
Every row above comes from Tennis results data and Tennis odds history for the Grand Slams and Masters. Every ATP and WTA singles match since 2007, with every set's games and tiebreak points, seeds, rounds and draws. REST or MCP.
More guides
The same guide for other sports
- PuckAPI: How do I get today's NHL schedule and scores in Python?
- EndzoneAPI: How do I get NFL scores and the schedule for a week in Python?
- FighterAPI: How do I get the upcoming UFC fight schedule in Python?
- StrikerAPI: How do I get Premier League scores and fixtures in Python?
- DunkAPI: How do I get today's NBA schedule and scores in Python?
- BirdieAPI: How do I get the PGA Tour schedule in Python?
- FastballAPI: How do I get MLB scores and the schedule in Python?
Rather ask Claude? 18 free Claude skills call these endpoints for you.
Start with 500 free credits every month
No card. REST or MCP.