Events API
League Toplist
GET
/v1/league/toplistTop scorers of a league.
Parameters
Send every parameter in the query string, including token.
| Name | Type | Required | Description |
|---|---|---|---|
| token | string | Required | Your API token. |
| league_id | string | Required | League id with has_toplist=1. |
Request
Call https://api.odds-data-api.com/v1/league/toplist with your token. The examples read it from the ODDS_DATA_API_TOKEN environment variable.
curl "https://api.odds-data-api.com/v1/league/toplist?league_id=10041282&token=$ODDS_DATA_API_TOKEN"Response
JSON with success: 1 and results. Values are strings unless shown otherwise. See Response format and R-Pager.
application/json
{
"success": 1,
"results": {
"topgoals": [
{
"goal_points": "5",
"goals": "4",
"penalties": "1",
"matches": "4",
"minutes_played": "342",
"substituted_in": "0",
"player": {
"id": "1021215",
"name": "Noah Vidal",
"cc": "gb"
},
"team": {
"id": "10212",
"name": "Manchester City",
"image_id": null,
"cc": "gb"
}
}
]
}
}Errors
A failed call returns success: 0 with an error code. This endpoint can return:
| error | Meaning |
|---|---|
| NOT_FOUND | 404 Not Found. |
| AUTHORIZE_FAILED | Token is not provided or is incorrect. |
| TOO_MANY_REQUESTS | API rate limit exceeded. See X-RateLimit-Reset. |
| PERMISSION_DENIED | Your plan does not include this call. Contact support if this is wrong. |
| PARAM_REQUIRED | A required param is missing. Check error_detail. |
| PARAM_INVALID | A param is invalid. Check error_detail. |
Failed call · application/json
{
"success": 0,
"error": "PARAM_REQUIRED",
"error_detail": "league_id"
}Like every endpoint, it can also return INTERNAL_SERVER_ERROR, METHOD_NOT_ALLOWED and UNDER_MAINTENANCE. See R-Errors.
Try it
GET
https://api.odds-data-api.com/v1/league/toplist?league_id=10041282&token=YOUR-TOKEN- league_id
- 10041282
- token
- YOUR-TOKEN (from the dashboard)
Requests run with your own token and count toward your hourly limit.
