/v1/h2h/{a}/{b}

Two players against each other: wins, games, and every meeting.

GEThttps://api.tabletennisapi.com/v1/h2h/{a}/{b}
Plans:LiveArchiveComplete

Parameters

NameInTypeRequiredWhat it doesExample
apathidrequiredThe first player id, as returned by any listpl_pa71g1zb
bpathidrequiredThe second player id, as returned by any listpl_mc5w19rn

Run it live

GET /v1/h2h/{a}/{b}A real call to the API, from your browser
Your key is kept in this browser only, so every docs page has it, and is sent only to api.tabletennisapi.com. Left empty, the call runs on a free key with its dates and fields, 20 calls a minute.
GEThttps://api.tabletennisapi.com/v1/h2h/{a}/{b}
Not run yet
Press Run it to see the answer here.

Response

A real answer from the data, two rows shown. Every field is described in the manual.

200 OKapplication/json
{
    "data": [
        {
            "id": "mt_s167nw41",
            "event": {
                "id": "ev_qm06xvdd",
                "name": "Champions Frankfurt 2026"
            },
            "date": "2026-11-08",
            "start_time": "2026-11-08T17:30:00Z",
            "discipline": "MS",
            "age_group": null,
            "para_class": null,
            "round": "final",
            "round_name": "Final",
            "rubber": null,
            "status": "finished",
            "best_of": 7,
            "points_per_game": 11,
            "win_by": 2,
            "utc_offset_min": 60,
            "sides": [
                {
                    "side": "a",
                    "name": "Franziska Patrick",
                    "country": "GER",
                    "players": [
                        {
                            "id": "pl_pa71g1zb",
                            "name": "Franziska Patrick",
                            "country": "GER"
                        }
                    ]
                },
                {
                    "side": "b",
                    "name": "Harimoto Tomokazu",
                    "country": "JPN",
                    "players": [
                        {
                            "id": "pl_mc5w19rn",
                            "name": "Harimoto Tomokazu",
                            "country": "JPN"
                        }
                    ]
                }
            ],
            "score": {
                "a": 2,
                "b": 4
            },
            "winner": "b",
            "result_note": null,
            "games": [
                {
                    "a": 11,
                    "b": 2
                },
                {
                    "a": 9,
                    "b": 11
                },
                {
                    "a": 13,
                    "b": 11
                },
                {
                    "a": 8,
                    "b": 11
                },
                {
                    "a": 4,
                    "b": 11
                },
                {
                    "a": 4,
                    "b": 11
                }
            ],
            "duration_s": 2917,
            "table": 1,
            "started_at": "2026-11-08T17:52:28Z",
            "timeouts": {
                "a": 1,
                "b": 1
            },
            "cards": {
                "a": [],
                "b": []
            },
            "video_review": false,
            "challenges_each": 99,
            "serving": null
        },
        {
            "id": "mt_rxmefdmg",
            "event": {
                "id": "ev_21gg34sq",
                "name": "Singapore Smash 2026 Presented by Resorts World Sentosa"
            },
            "date": "2026-02-27",
            "start_time": "2026-02-27T11:10:00Z",
            "discipline": "MS",
            "age_group": null,
            "para_class": null,
            "round": "round_of_16",
            "round_name": "Round of 16",
            "rubber": null,
            "status": "finished",
            "best_of": 5,
            "points_per_game": 11,
            "win_by": 2,
            "utc_offset_min": 480,
            "sides": [
                {
                    "side": "a",
                    "name": "Franziska Patrick",
                    "country": "GER",
                    "players": [
                        {
                            "id": "pl_pa71g1zb",
                            "name": "Franziska Patrick",
                            "country": "GER"
                        }
                    ]
                },
                {
                    "side": "b",
                    "name": "Harimoto Tomokazu",
                    "country": "JPN",
                    "players": [
                        {
                            "id": "pl_mc5w19rn",
                            "name": "Harimoto Tomokazu",
                            "country": "JPN"
                        }
                    ]
                }
            ],
            "score": {
                "a": 3,
                "b": 2
            },
            "winner": "a",
            "result_note": null,
            "games": [
                {
                    "a": 6,
                    "b": 11
                },
                {
                    "a": 11,
                    "b": 7
                },
                {
                    "a": 11,
                    "b": 7
                },
                {
                    "a": 6,
                    "b": 11
                },
                {
                    "a": 11,
                    "b": 8
                }
            ],
            "duration_s": 2466,
            "table": 1,
            "started_at": null,
            "timeouts": {
                "a": 1,
                "b": 1
            },
            "cards": {
                "a": [],
                "b": []
            },
            "video_review": true,
            "challenges_each": 2,
            "serving": null
        }
    ],
    "meta": {
        "count": 2,
        "next_cursor": "eyJvIjoyLCJwIjoyfQ",
        "page": 1,
        "per_page": 2,
        "total": 3,
        "total_pages": 2,
        "next_page": 2,
        "prev_page": null,
        "summary": {
            "played": 3,
            "wins_a": 1,
            "wins_b": 2,
            "player_a": "pl_pa71g1zb",
            "player_b": "pl_mc5w19rn"
        }
    }
}

Example

curl
curl https://api.tabletennisapi.com/v1/h2h/pl_pa71g1zb/pl_mc5w19rn \
  -H "Authorization: Bearer $TT_KEY"
Python
import os, requests
res = requests.get("https://api.tabletennisapi.com/v1/h2h/pl_pa71g1zb/pl_mc5w19rn",
    headers={"Authorization": "Bearer " + os.environ["TT_KEY"]}).json()
JavaScript
const res = await fetch("https://api.tabletennisapi.com/v1/h2h/pl_pa71g1zb/pl_mc5w19rn", {
  headers: { Authorization: "Bearer " + process.env.TT_KEY },
});
const { data, meta } = await res.json();
PHP
$ch = curl_init("https://api.tabletennisapi.com/v1/h2h/pl_pa71g1zb/pl_mc5w19rn");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TT_KEY")]]);
$res = json_decode(curl_exec($ch), true);
Go
req, _ := http.NewRequest("GET", "https://api.tabletennisapi.com/v1/h2h/pl_pa71g1zb/pl_mc5w19rn", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("TT_KEY"))
res, err := http.DefaultClient.Do(req)

Generate a client

Prefer a typed client? Every endpoint, parameter and field is in openapi.json (OpenAPI 3.1), so any OpenAPI generator builds one in your language; this call is h2h in it. Or import the Postman collection and run every call with no code.

Generate a client
npx @openapitools/openapi-generator-cli generate \
  -i https://tabletennisapi.com/openapi.json \
  -g python -o tabletennis-client
# or -g typescript-fetch, php, go, java, csharp, ruby, kotlin, swift5

Answers come back as data and meta; errors as error. See Errors and Pagination.