How do I compare a tennis player's results on clay, grass and hard court?
A player's career record split by surface: wins, losses, sets, games, tiebreaks and deciding sets, with the surface Elo ratings alongside.
Code verified October 10, 2026. One call to get_surface_splits, 3 credits.
The call
player_id comes from search_players. Pass season for a single year, or by_season: true to split each surface by year.
import requests
import pandas as pd
API_KEY = "YOUR_API_KEY"
resp = requests.post(
"https://mcp.acesapi.com/v1/get_surface_splits",
headers={"x-api-key": API_KEY},
json={
"player_id": "3782",
},
timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]
splits = pd.DataFrame(data["splits"]).set_index("surface")
splits["tiebreak_pct"] = splits["tiebreaks_won"] / (splits["tiebreaks_won"] + splits["tiebreaks_lost"])
splits["deciding_pct"] = splits["deciding_sets_won"] / splits["deciding_sets"]
print(data["name"])
print(splits[["wins", "losses", "win_pct", "games_won_pct", "tiebreak_pct", "deciding_pct"]].round(3))
print({k: v["rating"] for k, v in data["ratings"].items()})
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.
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",
"player_id": "3782",
"name": "Carlos Alcaraz",
"season": null,
"overall": {
"wins": 306,
"losses": 69,
"win_pct": 0.816,
"games_won_pct": 0.58
},
"splits": [
{
"surface": "hard",
"wins": 167,
"losses": 46,
"win_pct": 0.784,
"games_won_pct": 0.578,
"tiebreaks_won": 53,
"tiebreaks_lost": 39,
"deciding_sets": 53,
"deciding_sets_won": 32
},
{
"surface": "clay",
"wins": 104,
"losses": 19,
"win_pct": 0.846,
"games_won_pct": 0.588,
"tiebreaks_won": 35,
"tiebreaks_lost": 17,
"deciding_sets": 38,
"deciding_sets_won": 30
},
"...1 more"
],
"ratings": {
"clay": {
"rating": 2247,
"matches": 121
},
"grass": {
"rating": 2135,
"matches": 39
},
"hard": {
"rating": 2215,
"matches": 203
}
}
}What to do next
- get_player_matches (5 credits). The matches behind a split, filtered by season, surface or opponent.
- get_ratings (2 credits). Rank every active player on one surface's Elo.
More guides
Start with 500 free credits every month
No card. REST or MCP.