PlayersEndpoint 60 of 116
National team
https://api.datasportsapi.com/
- Plan
- All plans
- Auth
Bearer dsa_live_…- Parameters
- 1 required · 0 optional
- Returns
NationalTeamRecord[]
Caps, goals and debut date for every national side the player has represented, at senior and youth level.
Worth knowing
Returns an empty array if the player has never appeared for a national team, or if the source keeps no record of it.
01Parameters
idpathRequiredDataSportsAPI player id, a positive integer
02Request
The same call from the command line and each SDK. The SDK lines assume a client created with your key; left out, it is read from DATASPORTSAPI_API_KEY. Installing a client: SDKs & CLI.
curl -H "Authorization: Bearer dsa_live_…" \
"https://api.datasportsapi.com/v2/players/{id}/national-team"03Response
The top-level keys of the JSON body. Each object links to its full shape in the data reference.
dataNationalTeamRecord[]meta- count
{ "data": [ { "team": { "id": 412, "name": "England", "code": "ENG", … }, "appearances": 59, "goals": 19, "debut": "2020-10-08T00:00:00.000Z" } ],
"meta": { "count": 1 } }04Errors
Nothing specific to this endpoint: only the account-wide errors below apply.
unauthorized429rate_limited429quota_exceeded500internal_errorEvery error code