/v1/players

Find players by name or country; with neither, every player by name, a page at a time.

GEThttps://api.tabletennisapi.com/v1/players
Plans:Free keyLiveArchiveComplete

Parameters

NameInTypeRequiredWhat it doesExample
qquerystringoptionalPart of the name, at least 2 lettersFranziska
countryquerystringoptionalThree letters (CHN, JPN)CHN

Run it live

GET /v1/playersA 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/players
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": "pl_pa71g1zb",
            "name": "Franziska Patrick",
            "country": "GER"
        },
        {
            "id": "pl_gj64q87r",
            "name": "Schreiner Franziska",
            "country": "GER"
        }
    ],
    "meta": {
        "count": 2,
        "next_cursor": null,
        "page": 1,
        "per_page": 2,
        "total": 2,
        "total_pages": 1,
        "next_page": null,
        "prev_page": null
    }
}

Example

curl
curl https://api.tabletennisapi.com/v1/players \
  -H "Authorization: Bearer $TT_KEY"
Python
import os, requests
res = requests.get("https://api.tabletennisapi.com/v1/players",
    headers={"Authorization": "Bearer " + os.environ["TT_KEY"]}).json()
JavaScript
const res = await fetch("https://api.tabletennisapi.com/v1/players", {
  headers: { Authorization: "Bearer " + process.env.TT_KEY },
});
const { data, meta } = await res.json();
PHP
$ch = curl_init("https://api.tabletennisapi.com/v1/players");
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/players", 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 players 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.