v2

API Reference

Head-to-Head (H2H)

The H2H module delivers rivalry records, match histories, per-match statistics, and aggregate comparisons between any two players — or between one player and all their opponents.

Endpoint Summary

MethodPathDescription
GET/tennis/v2/{type}/h2h/info/{player1}/{player2}H2H summary info
GET/tennis/v2/{type}/h2h/filter/{player1}/{player2}H2H filter options
GET/tennis/v2/{type}/h2h/matches/{player1}/{player2}Full match list
GET/tennis/v2/{type}/h2h/stats/{player1}/{player2}Aggregated H2H stats
GET/tennis/v2/{type}/h2h/vs-all-stats/{player}Stats vs all opponents
GET/tennis/v2/{type}/h2h/match-stats/{tournamentId}/{player1}/{player2}Match stats in a tournament

H2H Info

GET /tennis/v2/{type}/h2h/info/{player1}/{player2} Returns the overall head-to-head win/loss summary between two players

Returns a single H2H record from the pre-computed win-totals table. Totals are kept in sync as new match results are added to the archive.

ℹ️
Automatic player-order correction H2H records are stored with a fixed player1/player2 assignment. When you request /h2h/info/A/B but the record is stored as B→A, the API automatically swaps player1AllWins and player2AllWins so the response always aligns with the order you requested.

Path Parameters

ParameterTypeDescription
type Requiredstringatp or wta
player1 RequiredintegerFirst player ID (≥ 1)
player2 RequiredintegerSecond player ID (≥ 1)

Example Request

cURL
curl --request GET \
  --url 'https://tennis-api-atp-wta-itf.p.rapidapi.com/tennis/v2/atp/h2h/info/104925/106421' \
  --header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  --header 'X-RapidAPI-Host: tennis-api-atp-wta-itf.p.rapidapi.com'

Example Response

JSON
{
  "id": 8802,
  "player1AllWins": 5,
  "player2AllWins": 8,
  "player1Wins": 2,
  "player2Wins": 3,
  "player1Id": 104925,
  "player2Id": 106421,
  "player1": {
    "id": 104925,
    "name": "Carlos Alcaraz",
    "countryAcr": "ESP"
  },
  "player2": {
    "id": 106421,
    "name": "Jannik Sinner",
    "countryAcr": "ITA"
  }
}

Response Properties

PropertyTypeDescription
idintegerInternal record ID for this H2H pair in the database.
player1AllWinsintegerAll-time career wins for player1 against player2 across the entire match archive.
player2AllWinsintegerAll-time career wins for player2 against player1.
player1WinsintegerWins by player1 in a recent subset of their meetings (e.g. last 5–10 matches). Use this for "recent form" H2H displays alongside player1AllWins.
player2WinsintegerWins by player2 in the same recent subset.
player1Id / player2IdintegerPlayer IDs as returned from the API (already aligned to your requested order after the swap logic).
player1 / player2objectEmbedded player summary: { id, name, countryAcr }.

H2H Matches

GET /tennis/v2/{type}/h2h/matches/{player1}/{player2} Returns the full list of past matches between two players with scores and tournament details

Path Parameters

ParameterTypeDescription
type Requiredstringatp or wta
player1 RequiredintegerFirst player ID (≥ 1)
player2 RequiredintegerSecond player ID (≥ 1)

Query Parameters

ParameterTypeDescription
include Optional string Comma-separated relations to load. Available: round, tournament, tournament.court, tournament.rank, tournament.country, stat (per-match serve & return statistics).
Example: include=round,tournament.court
filter Optional string Semicolon-separated filters in Key:value format. Available filters:
  • GameYear:{2024,2025} — filter by year(s)
  • GameRound:{1,2} — filter by round ID(s)
  • GameCourt:{1,2} — requires tournament in include
  • TourRank:{1,2} — requires tournament in include
  • GameTour:{8871} — filter by specific tournament ID(s)
Example: filter=GameYear:2024,2025;TourRank:1
pageSize Optional integer Results per page. Default: 10.
pageNo Optional integer Page number, 1-indexed. Default: 1. Use hasNextPage in the response to check for more pages.

Example Request

cURL
curl -G 'https://tennis-api-atp-wta-itf.p.rapidapi.com/tennis/v2/atp/h2h/matches/104925/106421' \
  -H 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  -H 'X-RapidAPI-Host: tennis-api-atp-wta-itf.p.rapidapi.com'

Example Response

JSON
{
  "data": [
    {
      "id": 390145,
      "date": "2024-11-17T14:00:00.000Z",
      "result": "6-4 6-3",
      "player1Id": 104925,
      "player2Id": 106421,
      "tournamentId": 8201,
      "roundId": 1,
      "player1": { "id": 104925, "name": "Carlos Alcaraz", "countryAcr": "ESP" },
      "player2": { "id": 106421, "name": "Jannik Sinner", "countryAcr": "ITA" }
    }
  ],
  "hasNextPage": false
}

Response Properties

PropertyTypeDescription
dataarrayPaginated list of historical match records, most recent first. In each record player1 is always the winner.
hasNextPagebooleantrue if more matches exist beyond the current page.
idintegerMatch record ID.
datedatetimeMatch date as ISO 8601 UTC.
resultstringScore string, e.g. "6-4 6-3". Set scores space-separated.
player1Id / player2IdintegerPlayer IDs. player1 = winner, player2 = loser in historical archive.
player1 / player2object{ id, name, countryAcr }.
tournamentIdintegerForeign key to Tournament table.
roundIdintegerRound ID (1 = Final, 2 = SF, 3 = QF, etc.).
tournamentobject | nullEmbedded tournament: { id, name, courtId, rankId, court, rank }. Present when loaded via include.
roundobject | null{ id, name }. Present when round is included.

H2H Stats

GET /tennis/v2/{type}/h2h/stats/{player1}/{player2} Returns aggregated serve and return statistics comparing the two players over all their meetings

Path Parameters

ParameterTypeDescription
type Requiredstringatp or wta
player1 RequiredintegerFirst player ID (≥ 1)
player2 RequiredintegerSecond player ID (≥ 1)

Example Request

cURL
curl -G 'https://tennis-api-atp-wta-itf.p.rapidapi.com/tennis/v2/atp/h2h/stats/104925/106421' \
  -H 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  -H 'X-RapidAPI-Host: tennis-api-atp-wta-itf.p.rapidapi.com'

Example Response

JSON
{
  "data": {
    "matchesCount": 13,
    "player1Stats": {
      "id": 104925,
      "statMatchesPlayed": "13",
      "matchesWon": "5",
      "aces": "143",
      "doubleFaults": "38",
      "firstServePercentage": 63,
      "winningOnFirstServePercentage": 72,
      "winningOnSecondServePercentage": 48,
      "breakpointsWonPercentage": 41,
      "bestOfThreeWon": 5,
      "bestOfFiveWon": 0,
      "decidingSetWin": 2,
      "tiebreakWon": 4,
      "setsWon": 18,
      "gamesWon": 152,
      "hard": 3,
      "clay": 2,
      "grass": 0
    },
    "player2Stats": { "..." }
  }
}

Response Properties

The response contains player1Stats and player2Stats objects — both have identical fields. All percentage fields are pre-computed as integer values (0–100).

PropertyTypeDescription
matchesCountintegerTotal number of matches played between the two players in the archive.
player1Stats.idintegerThe player ID for player1.
statMatchesPlayedstringNumber of matches with stats data available (may differ from matchesCount if some matches have no stat records).
matchesWonstringTotal matches won in the head-to-head.
acesstringTotal aces across all H2H matches.
doubleFaultsstringTotal double faults across all H2H matches.
firstServePercentageintegerAverage first serve in percentage (0–100).
winningOnFirstServePercentageintegerPercentage of points won when the first serve went in.
winningOnSecondServePercentageintegerPercentage of points won on second serve.
breakpointsWonPercentageintegerBreak point conversion rate as a percentage.
bestOfThreeWon / bestOfFiveWonintegerNumber of best-of-3 / best-of-5 matches won in H2H.
decidingSetWinintegerMatches won after winning the final deciding set.
tiebreakWonintegerTotal tiebreaks won across all H2H matches.
setsWonintegerTotal sets won across all H2H matches.
gamesWonintegerTotal games won across all H2H matches.
hard / clay / grass / iHardintegerNumber of H2H matches won on each surface type.
titleintegerNumber of H2H matches won in tournament finals (round 12).
grandSlam / mastersintegerH2H wins at Grand Slams / Masters 1000 level.
firstSetWinMatchWinintegerTimes this player won the first set AND won the match.
firstSetLoseMatchWinintegerTimes this player lost the first set but came back to win the match.
avgTimestringAverage match duration in H:MM:SS format.

H2H Filter

GET /tennis/v2/{type}/h2h/filter/{player1}/{player2} Returns available filter options for an H2H comparison (surfaces, years, rounds, etc.)

Path Parameters

ParameterTypeDescription
type Requiredstringatp or wta
player1 RequiredintegerFirst player ID (≥ 1)
player2 RequiredintegerSecond player ID (≥ 1)

Example Request

cURL
curl -G 'https://tennis-api-atp-wta-itf.p.rapidapi.com/tennis/v2/atp/h2h/filter/104925/106421' \
  -H 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  -H 'X-RapidAPI-Host: tennis-api-atp-wta-itf.p.rapidapi.com'

Example Response

JSON
{
  "data": {
    "rounds": [
      { "roundId": 1, "round": "Final" },
      { "roundId": 2, "round": "Semi-Final" }
    ],
    "courts": [
      { "courtId": 1, "court": "Hard" },
      { "courtId": 2, "court": "Clay" }
    ],
    "tournaments": [
      { "tournamentId": 8871, "tournament": "Roland Garros", "tournamentDate": "2025-05-26T00:00:00.000Z" }
    ],
    "tournamentRanks": [
      { "rankId": 1, "rank": "Grand Slam" }
    ],
    "gameYears": [ 2025, 2024, 2023 ]
  }
}

Response Properties

Returns the distinct filter values present in the two players' H2H match history — used to build filter UI panels.

PropertyTypeDescription
roundsarrayDistinct rounds played: each item is { roundId, round }.
courtsarrayDistinct court surfaces: each item is { courtId, court }.
tournamentsarrayDistinct tournaments where matches were played: each item is { tournamentId, tournament, tournamentDate }.
tournamentRanksarrayDistinct tournament tiers: each item is { rankId, rank }.
gameYearsarray<number>Distinct calendar years in which matches occurred, sorted descending.

H2H vs All Opponents

GET /tennis/v2/{type}/h2h/vs-all-stats/{player} Returns a player's win/loss record and stats against every opponent they have ever faced

Path Parameters

ParameterTypeDescription
type Requiredstringatp or wta
player RequiredintegerPlayer ID (≥ 1)

Example Request

cURL
curl -G 'https://tennis-api-atp-wta-itf.p.rapidapi.com/tennis/v2/atp/h2h/vs-all-stats/104925' \
  -H 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  -H 'X-RapidAPI-Host: tennis-api-atp-wta-itf.p.rapidapi.com'

Response Properties

Returns { data: { matchesCount, playerStats, opponentStats } }. The structure is identical to H2H Stats except the keys are playerStats (for the requested player) and opponentStats (aggregate across all opponents) instead of player1Stats / player2Stats.

PropertyTypeDescription
matchesCountintegerTotal matches played by this player across the entire historical archive.
playerStatsobjectAggregated stats for the requested player across all matches. Same fields as player1Stats in H2H Stats.
opponentStatsobjectAggregate of all opponents faced — useful for computing career averages against the field. Same field structure as playerStats.

Match Stats in Tournament

GET /tennis/v2/{type}/h2h/match-stats/{tournamentId}/{player1}/{player2} Returns detailed per-match statistics for the encounter between two players in a specific tournament

This endpoint returns data from the Stat entity — the richest data structure in the API. All numeric stat fields follow a fraction pattern: the base field is the count achieved, and the Of-suffixed field is the total opportunities. Divide them to compute a percentage.

Computing percentages firstServe1 / firstServeOf1 × 100 gives the first-serve percentage for player1. All fraction field pairs work this way.

Path Parameters

ParameterTypeDescription
type Requiredstringatp or wta
tournamentId RequiredintegerTournament ID (≥ 1)
player1 RequiredintegerFirst player ID (≥ 1)
player2 RequiredintegerSecond player ID (≥ 1)

Example Request

cURL
curl -G 'https://tennis-api-atp-wta-itf.p.rapidapi.com/tennis/v2/atp/h2h/match-stats/8871/104925/106421' \
  -H 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  -H 'X-RapidAPI-Host: tennis-api-atp-wta-itf.p.rapidapi.com'

Example Response

JSON
{
  "round": 1,
  "mt": "best_of_5",
  "w_SvGms": "9",
  "aces1": 12,
  "aces2": 4,
  "doubleFaults1": 2,
  "doubleFaults2": 3,
  "firstServe1": 65,
  "firstServeOf1": 90,
  "firstServe2": 58,
  "firstServeOf2": 85,
  "winningOnFirstServe1": 52,
  "winningOnFirstServeOf1": 65,
  "breakPointsConverted1": 3,
  "breakPointsConvertedOf1": 7,
  "winners1": 38,
  "winners2": 22,
  "unforcedErrors1": 18,
  "unforcedErrors2": 31,
  "totalPointsWon1": 112,
  "totalPointsWon2": 89,
  "fastestServe1": 214,
  "fastestServe2": 208
}

Response Properties

All stat fields come in pairs suffixed 1 (player1) and 2 (player2). Fraction fields have a companion Of field as the denominator — divide them to get percentages.

PropertyTypeDescription
roundintegerRound ID for this match (same values as the Round lookup table).
mtstring | nullMatch type"best_of_3" or "best_of_5". Grand Slams use best-of-5 for men.
w_SvGmsstring | nullNumber of service games held by the winner (e.g. "9"). Compact summary field.
aces1 / aces2integer | nullTotal aces served in the match by each player.
doubleFaults1 / doubleFaults2integer | nullTotal double faults served by each player.
firstServe1 / firstServeOf1integer | nullFirst serves landed in / total first serve attempts. E.g. 65/90 → 72% first-serve percentage.
winningOnFirstServe1 / winningOnFirstServeOf1integer | nullPoints won on first serve / total first-serve points played.
winningOnSecondServe1 / winningOnSecondServeOf1integer | nullPoints won on second serve / total second-serve points played.
fastestServe1 / fastestServe2integer | nullFastest serve speed recorded in the match (km/h or mph depending on tournament data source).
averageFirstServeSpeed1integer | nullAverage speed of all first serves.
averageSecondServeSpeed1integer | nullAverage speed of all second serves.
breakPointsConverted1 / breakPointsConvertedOf1integer | nullBreak points converted / total break point opportunities. Divide for break-point conversion rate.
rpw1 / rpwOf1integer | nullReturn Points Won — points won while returning (on the opponent's serve) / total return points played.
netApproaches1 / netApproachesOf1integer | nullPoints won coming to the net / total net approach attempts.
winners1 / winners2integer | nullTotal outright winners hit (unreturnable shots).
unforcedErrors1 / unforcedErrors2integer | nullTotal unforced errors made (mistakes not due to opponent pressure).
totalPointsWon1 / totalPointsWon2integer | nullTotal points won across all games and sets in the match.