Head-to-head
get_h2hGet the all-time head-to-head record between two players from 1968 to today, including walkovers and retirements. Enter name fragments; ambiguous names return a candidate list.
Instructions
The all-time record between two players, across BOTH halves of the product: the results archive (1968–2022) plus our own completed matches (2023 onward). Names are the keys — an ambiguous fragment returns the candidate list to choose from rather than guessing. Totals count only meetings with a known winner; walkovers and retirements are part of the record and each meeting carries its outcome. Requires the BASIC plan or any History plan.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| player1 | Yes | First player name (fragment, min 3 chars), e.g. "federer". | |
| player2 | Yes | Second player name (fragment, min 3 chars), e.g. "nadal". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True when the call returned data. False for a tier wall, a missing or rejected key, or an empty result — all of which are normal states with a clear remedy, not failures. | |
| totals | No | The headline record. | |
| message | Yes | Human-readable summary. Identical to the text content, so either half can be used alone. | |
| players | No | The resolved names; null when no player matches the fragments. | |
| meetings | No | Individual meetings, newest first, capped at 200. | |
| by_surface | No | Decided wins per surface; keys are surface names plus "unknown". |