SportAPI Documentation
EN
S Product documentationSport Line API
v1
Service & pricing ↗ Get access ↗

Sport Line API — cURL Request Examples

Before You Start

Replace the following values in every example:

ValueReplace with
https://YOUR_API_DOMAINBase URL received from the SportAPI manager
YOUR_API_KEYPersonal Sport Line API key
SPORT_ID_FROM_MENUCurrent sport ID from menu or sports
COUNTRY_ID_FROM_MENUCurrent country ID from menu or countries
TOURNAMENT_ID_FROM_MENUCurrent tournament ID from menu or tournaments
SPORT_ID_FROM_SPORTSCurrent sport ID from the sports response
COUNTRY_ID_FROM_COUNTRIESCurrent country ID from the countries response
TOURNAMENT_ID_FROM_TOURNAMENTSCurrent tournament ID from the tournaments response
GAME_ID_FROM_EVENTSCurrent match game_id from events
SUBGAME_ID_FROM_EVENTSubmatch ID from event.body.sub_games

Send the API key only in the Package HTTP header:

Package: YOUR_API_KEY

Do not add the key to the URL or store an active key in a public repository, documentation, or error message.

Minimal Live Request

Retrieve the current Live menu:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/menu/live/en' \
  --header 'Package: YOUR_API_KEY' \
  --header 'Accept: application/json'

The Package header is required. Accept: application/json is optional, but it makes the expected response format explicit.

The standard sequence consists of three requests:

menu
  ↓ current sportId and tournamentId
events
  ↓ current game_id
event

Do not replace this sequence with statically stored IDs. The API returns only sports and tournaments that currently have matches in the selected live or line type.

Step 1: Retrieve the Current Menu

Live:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/menu/live/en' \
  --header 'Package: YOUR_API_KEY'

Prematch:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/menu/line/en' \
  --header 'Package: YOUR_API_KEY'

Select a sport and tournament present in the current hierarchy:

body[].id                         → sportId
body[].sub[].id                   → countryId
body[].sub[].sub[].id             → tournamentId

Detailed documentation: menu.

Step 2: Retrieve the Match List

All matches from all available tournaments for the selected Live sport:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/events/SPORT_ID_FROM_MENU/0/sub/50/live/en' \
  --header 'Package: YOUR_API_KEY'

tournamentId=0 means all available tournaments for the selected sport. You must still take SPORT_ID_FROM_MENU from the current menu response.

Only one selected Live tournament:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/events/SPORT_ID_FROM_MENU/TOURNAMENT_ID_FROM_MENU/sub/50/live/en' \
  --header 'Package: YOUR_API_KEY'

All Prematch matches for the selected sport:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/events/SPORT_ID_FROM_MENU/0/sub/50/line/en' \
  --header 'Package: YOUR_API_KEY'

For events, use only:

  • the sub format;
  • the technical count=50 value.

The match-count limit has been removed. The API returns the entire available result set.

Detailed documentation: events.

Step 3: Retrieve a Specific Match

Take game_id from the current events response.

Live match:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/event/GAME_ID_FROM_EVENTS/group/live/en' \
  --header 'Package: YOUR_API_KEY'

Prematch match:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/event/GAME_ID_FROM_EVENTS/group/line/en' \
  --header 'Package: YOUR_API_KEY'

The event method uses only the group format. It returns the complete available list of betting markets and odds for the selected match.

Use the same sports line type from which game_id was retrieved. A Prematch ID cannot be requested as a Live ID.

Detailed documentation: event.

Requesting a Submatch

First, request the main match through event and find the required item in body.sub_games:

{
  "game_id": 746147010,
  "game_name": "Corners"
}

Then make a separate request using the submatch’s game_id:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/event/SUBGAME_ID_FROM_EVENT/group/live/en' \
  --header 'Package: YOUR_API_KEY'

The returned odds apply only to the selected submatch. For example, a “Corners, 1st Half” request returns odds only for first-half corners.

Detailed documentation: Additional Matches and Submatches.

Step-by-step Navigation Without menu

Using menu is generally more convenient because it returns sports, countries, and tournaments in one request. If the interface needs step-by-step loading, follow the sequence below.

These navigation methods are optional and do not replace the core menu → events → event flow.

1. Sports

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/sports/live/en' \
  --header 'Package: YOUR_API_KEY'

2. Countries for the Selected Sport

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/countries/SPORT_ID_FROM_SPORTS/live/en' \
  --header 'Package: YOUR_API_KEY'

3. Tournaments for the Selected Country

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/tournaments/SPORT_ID_FROM_SPORTS/COUNTRY_ID_FROM_COUNTRIES/live/en' \
  --header 'Package: YOUR_API_KEY'

4. Matches for the Selected Tournament

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/events/SPORT_ID_FROM_SPORTS/TOURNAMENT_ID_FROM_TOURNAMENTS/sub/50/live/en' \
  --header 'Package: YOUR_API_KEY'

Take each ID directly from the preceding current response. Do not skip levels in the chain or insert stored static values.

Detailed documents:

Esports Data

Pass cybersport=true to methods that support this parameter.

Esports Live menu:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/menu/live/en?cybersport=true' \
  --header 'Package: YOUR_API_KEY'

Esports Live matches:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/events/SPORT_ID_FROM_MENU/0/sub/50/live/en?cybersport=true' \
  --header 'Package: YOUR_API_KEY'

Use IDs from the esports menu retrieved with the same cybersport=true parameter.

Top Matches

The top-match methods are optional. Use them only when the client interface needs a separate top-match selection.

All Sports

Short Live summaries:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/topmatches/live/en' \
  --header 'Package: YOUR_API_KEY'

Extended Live summaries with a short odds list:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/topmatches/live/en?full=true' \
  --header 'Package: YOUR_API_KEY'

For Prematch, replace live with line.

full=true extends the match object but does not return the complete list of all odds. Request event for the full list.

Detailed documentation: topmatches.

One Sport

toplist works only with Prematch and has no type parameter:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/toplist/SPORT_ID_FROM_MENU/en' \
  --header 'Package: YOUR_API_KEY'

Take SPORT_ID_FROM_MENU from the current Prematch menu/line response, not from the Live menu.

Extended summaries:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/toplist/SPORT_ID_FROM_MENU/en?full=true' \
  --header 'Package: YOUR_API_KEY'

Detailed documentation: toplist.

Search is an optional method. The search text is part of the URL and must be encoded.

Search for Perth in Live matches:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/search/live/en/Perth' \
  --header 'Package: YOUR_API_KEY'

Search for Manchester in Prematch matches:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/search/line/en/Manchester' \
  --header 'Package: YOUR_API_KEY'

Search Live and Prematch separately.

Detailed documentation: search.

Using Another Language

To retrieve names in another language, replace the final en segment with an enabled SportAPI language code. For example, Russian uses ru:

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/menu/live/ru' \
  --header 'Package: YOUR_API_KEY'

The requested language must be included in the API key’s subscription.

Viewing Formatted JSON

If the jq utility is installed, format the response immediately:

curl --silent --show-error \
  --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/menu/live/en' \
  --header 'Package: YOUR_API_KEY' \
  | jq .

jq is not part of Sport Line API and must be installed separately.

Saving a Response to a File

curl --request GET \
  --url 'https://YOUR_API_DOMAIN/v1/menu/live/en' \
  --header 'Package: YOUR_API_KEY' \
  --output 'sportapi-menu-live.json'

Do not store the API key inside the JSON file or next to the response in a public directory.

Checking the Response Format

Successful response:

{
  "status": 1,
  "page": "/v1/menu",
  "body": []
}

API error:

{
  "error_code": 100,
  "error_message": "Invalid Package"
}

event service message:

{
  "status": 1,
  "page": "/v1/event",
  "body": {
    "message": "Game id finished"
  }
}

When checking a response:

  1. First check error_code and error_message.
  2. Then check body.message.
  3. Treat an empty body array as no data, not as a system error.
  4. Only then parse data according to the specific method.

For details, see:

Full Verification Responses

Saved unabridged responses are available in Full JSON Responses.

The files do not contain an API key.

What This Document Does Not Provide

These examples show individual HTTP requests. They do not implement:

  • a SportAPI SDK or library;
  • automatic data updates;
  • application-state storage;
  • a complete user interface;
  • automatic retries;
  • a bet placement and settlement system.

These tasks depend on the client’s project architecture and will be covered separately.