SportAPI Documentation
EN
S Product documentationSport Line API
v1
Service & pricing ↗ Get access ↗
Sport Line API / Integration Guide

Sport Line API — Integration Guide

Sport Line API provides up-to-date sports data for a client’s website, application, or other software product.

Official website: sportapi.net.

Telegram support: @suport_sportapi.

Contents

  1. What Sport Line API Provides
  2. Integration Requirements
  3. Making Your First Request
  4. Core Integration Flow
  5. Prematch and Live
  6. Data Returned by the API
  7. Additional Methods
  8. Ready-to-use Icons
  9. Updating Data
  10. Live 3D Tracker
  11. Video Streaming
  12. Error Handling
  13. Integration Examples
  14. Detailed Documentation
  15. Support

1. What Sport Line API Provides

Sport Line API allows you to retrieve:

  • available sports;
  • countries, tournaments, and competitions;
  • upcoming Prematch events;
  • events currently in progress in Live;
  • teams or participants in an event;
  • start time, current score, period, and timer;
  • a short list of the main odds in event lists;
  • the full list of betting markets and odds for a selected event;
  • sub-events such as halves, corners, cards, fouls, and other additional markets;
  • key Live statistics;
  • information about Live 3D Tracker and video availability.

Sport Line API uses REST API. Your application retrieves current data through standard HTTP requests.

WebSocket support is under development and is not yet available for production integrations.

2. Integration Requirements

To integrate Sport Line API, you need to:

  1. Contact the SportAPI manager on Telegram and request access to the sports line.
  2. Obtain your API base URL and personal access key from the manager.
  3. Confirm which sports and languages are included in your subscription.
  4. Store the key in the protected configuration of your backend application.
  5. Send the key in the Package HTTP header with every request.

The base URL may differ between client connections. In every example, replace https://YOUR_API_DOMAIN with the address provided by the manager.

Send the key as follows:

Package: YOUR_API_KEY

Do not include the key in a URL or expose it in browser-side JavaScript, a mobile application, a public repository, or error messages. Requests to Sport Line API should be made through your backend.

The sports, languages, and access period available to you are determined by your key’s subscription package.

See Authentication and Access for more details.

3. Making Your First Request

Request the Live menu to verify your connection:

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

In this request:

  • live requests events that are currently in progress;
  • en requests the response in English;
  • Package is the HTTP header containing your API key.

A successful response uses the following common envelope:

{
  "status": 1,
  "page": "/v1/menu",
  "body": [
    {
      "id": 1,
      "name": "Football",
      "counter": 53,
      "sub": []
    }
  ]
}
FieldDescription
statusRequest status. A successful response usually returns 1
pageThe API method that generated the response
bodyData returned by the selected method

The values above demonstrate the response structure. The actual sports line changes continuously.

See Quick Start for more details.

4. Core Integration Flow

Use the following sequence for the core integration:

menu → events → event

Step 1. Retrieve the Current Menu

GET /v1/menu/{type}/{lang}

The menu method returns the currently available hierarchy in a single request:

sport → country → tournament

Select current sportId and tournamentId values from the response.

See menu — Sports Line Menu for more details.

Step 2. Retrieve the Event List

GET /v1/events/{sportId}/{tournamentId}/sub/50/{type}/{lang}

When calling events:

  • use only the sub format;
  • pass 50 in the required count path segment;
  • pass a specific tournament ID, or use tournamentId=0 to retrieve events from all tournaments of the selected sport.

The count parameter no longer limits the number of results. The value 50 remains in the URL for compatibility, while the API returns all available events in the selected scope.

The response is grouped by tournament:

body
└── tournament
    └── events_list
        └── events

Each event’s game_oc_list contains a short list of its main odds. The contents depend on the sport. For example, football may use a 1X2 market, basketball commonly offers the first or second team to win, and tennis has no draw selection.

Do not build the interface around one fixed set of market or selection names. Read the actual markets and odds returned by the API.

See events — Event List for more details.

Step 3. Retrieve Full Event Details

Take the selected event’s game_id from the events response and make the following request:

GET /v1/event/{gameId}/group/{type}/{lang}

The event method supports only the group format. The API already:

  • organizes selections into betting markets;
  • creates columns within each market;
  • sorts selections by their values.

Preserve the order of markets, columns, and selections returned by the API.

The event method returns the full available odds list for the selected event, its sub-events, Live statistics, and other detailed data.

See event — Specific Event for more details.

Use Only Current IDs

Do not create a permanent static list of sports, countries, and tournaments. The API returns only sections that currently contain events for the selected line type.

If the only event in a tournament ends, that tournament may disappear from the next menu response. If no other events remain for the sport, the sport itself will also disappear from the menu.

Before requesting events, verify that the selected sportId and tournamentId are still present in the current menu for the same live or line type.

5. Prematch and Live

Sport Line API separates data into two types:

URL valueData returned
linePrematch — events that have not started yet
liveLive — events currently in progress

Prematch and Live data must be requested and stored separately.

When an event moves from Prematch to Live, a new game_id is created. The Live ID does not match the Prematch ID, so do not link the two versions by game_id.

If the event is no longer available under its previous ID, the event method may return:

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

This message does not explain the reason. The event may have moved to Live under a new ID, been cancelled, or disappeared from the line for another reason. After receiving this response, stop requesting the old game_id and refresh the current menu and event list.

6. Data Returned by the API

Match

A match object may contain:

  • game_id — the match ID used by the event method;
  • game_start — the start time as a Unix timestamp in seconds;
  • sport, country, and tournament data;
  • team or participant names and IDs;
  • the score, period, and timer for a Live match;
  • betting markets and odds;
  • statistics and sub-events;
  • tracker and video fields, when available.

The timer field is returned in seconds. To display minutes, divide the value by 60 and round it for the interface if necessary. Do not send a request every second merely to update the timer. Update its display locally and synchronize it during the next scheduled request.

See Match Data Model for more details.

Odds

The odds structure is organized as follows:

game_oc_list
└── betting market
    └── oc_list
        └── column
            └── selections and odds

The main fields of a selection are:

FieldDescription
oc_nameSelection name
oc_rateCurrent odds value
oc_sizeHandicap, total, or another parameter value
oc_pointerUnique bet or selection identifier
oc_blockIndicates whether the selection is blocked

If the separate bet placement and settlement system is connected, oc_pointer is the value used to pass the selected outcome to that system. See Bet Pointer for the transfer format and Coupon Placement for the next request.

See Odds and Betting Markets for more details.

Sub-events

Sub-events are separate events within the main match. Examples include:

  • first half;
  • corners;
  • first-half corners;
  • yellow cards;
  • fouls;
  • other additional markets.

The sub-event list is returned only in the detailed event response, in the sub_games field. Each sub-event has its own game_id. To retrieve its odds, make a separate event request using that ID.

The odds in the response apply only to the selected sub-event. For example, when you request “First-half corners,” the API returns odds only for first-half corners, not for the entire match or all corners in the match.

See Sub-events and Additional Matches for more details.

Live Statistics

Key Live statistics are stored in stat_list and are returned only for Live data:

  • in the events match list;
  • in the detailed event response for a specific match.

The available metrics depend on the sport and the specific match. These are the main current characteristics of a Live match, not a separate API for in-depth sports analytics.

Extended statistics—including match history, team and player analysis, H2H, previous meetings, and future matches—belong to a separate API that is still under development.

See Match Statistics for more details.

A complete table of JSON fields is available in the Sport Line API Field Reference.

7. Additional Methods

Additional methods are not required for the core integration. Use them only when your project needs the corresponding feature.

The recommended core sequence remains:

menu → events → event
MethodPurposeNotes
sportsRetrieve sportsStep-by-step alternative to menu
countriesRetrieve countries for a selected sportUsed after sports
tournamentsRetrieve tournaments for a selected sport and countryUsed after countries
topmatchesRetrieve a curated list of top matchesSupports Live and Prematch
toplistRetrieve top matches for a selected sportPrematch only
searchSearch for matches by textThe search text must be URL-encoded

In most cases, menu is preferable because it returns sports, countries, and tournaments in a single request. The sports → countries → tournaments sequence requires three requests and is intended for specific interface scenarios.

For methods that support filtering for esports data, use:

?cybersport=true

Do not call every additional method automatically merely because it exists in the API.

8. Ready-to-use Icons

SportAPI provides standard icons. Insert the current value from the API response into the corresponding URL:

ObjectURL
Sporthttps://cdn.sportapi.net/sports/v1/color/{sportId}.webp
Countryhttps://cdn.sportapi.net/flags/v1/color/{countryId}.webp
Tournamenthttps://cdn.sportapi.net/tournaments/v1/color/{tournamentId}.webp
Team or participanthttps://cdn.sportapi.net/opp/v1/color/{iconName}.webp

For a team or participant, use opp_1_icon or opp_2_icon. Remove the original file extension, if present, before inserting the value into {iconName}.

9. Updating Data

Each REST request returns a snapshot of the data at the time of the request. Repeat requests at the recommended intervals to retrieve score, period, statistics, and odds updates.

Data or methodLivePrematch (line)
menu20 seconds minimum60 seconds minimum
sports, countries, tournaments60 seconds minimum120 seconds minimum
events7 seconds minimum30 seconds minimum
event5 seconds minimum30 seconds minimum
topmatches30 seconds minimum120 seconds minimum
toplistNot used120 seconds minimum

An interval of “5 seconds minimum” means that you must not send the request more often than once every 5 seconds. If the manager has provided different intervals for your connection, follow the manager’s values.

Do not start another request for the same data while the previous request is still in progress. Do not request a detailed event for every match unless those details are actually shown to the user.

See Data Update Guidelines for more details.

10. Live 3D Tracker

Live 3D Tracker is a separate ready-made widget that visualizes a Live match. Sport Line API does not provide the raw data required to render the tracker independently. Instead, it returns the ready-made widget’s ID in the zp field.

tracker gameid = zp from Sport Line API

If zp is null, the tracker is unavailable for that match. Do not substitute game_id or any other identifier for zp.

The tracker may be displayed for a Live match only when:

  • zp is populated;
  • the sport is supported by the tracker;
  • the client has an active tracker key;
  • the client’s domain is allowed for that key;
  • the sport and language are included in the subscription.

Supported sports:

IDSport
1Football
2Ice Hockey
3Basketball
4Tennis
5Baseball
6Volleyball
7Rugby
8Handball
10Table Tennis
13American Football
17Water Polo
21Darts
26Formula 1
28Australian Rules Football
44Horse Racing
66Cricket
86CS:GO / Esports

A sport’s presence in this table does not guarantee that the tracker is available for every match. Always perform the final availability check using zp.

The ready-made widget can be embedded using a direct iframe or embed.js.

The showcase demonstrates the widget’s appearance and does not use real Live data.

11. Video Streaming

Sport Line API indicates Live video availability through two fields:

FieldValue
va1 — a stream is available; null — no stream is available
viA string video stream ID or null

The value va: 0 is not used. Even if vi contains only digits, keep it as a string.

Display video only when va: 1 and vi is populated. The vi value itself is not a stream URL or a ready-to-use iframe address. It is passed to a separate ready-made video widget.

Video is available only for some Live matches. SportAPI does not stream matches from top-tier sports leagues. Do not promise video for a particular competition or match until the current va and vi values have been checked.

See Video Streaming in Sport Line API for more details.

12. Error Handling

An API error usually uses the following format:

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

Check for error_code and error_message instead of relying only on the HTTP status.

error_messageWhat to check
Missing Package headerWhether the Package HTTP header was sent
Invalid PackageWhether the key was copied correctly
Package has expiredWhether the key is active and its access period has not expired
Access deniedWhether the sport or requested feature is included in the subscription
Invalid languageWhether the language code is supported
The language is not available in your package.Whether the language is included in the key’s subscription
Wrong data type (accept only live or line)Whether the type is correctly set to live or line

An empty body: [] array is not always an error. It may mean that no data is currently available for the selected scope.

See Error Handling for more details.

13. Integration Examples

The ready-to-use examples use placeholder keys and base URLs:

These are lightweight working integration examples, not full SDKs. They demonstrate authentication, the core menu → events → event sequence, and response handling.

Full real JSON responses with no API keys: Sport Line API Reference Responses.

14. Detailed Documentation

Getting Started

Core Methods

Data Models

15. Support

If a request does not work, send the manager:

  • the request URL without the API key;
  • the time when the request was made;
  • the HTTP status;
  • error_code and error_message;
  • the line type, language, and IDs used;
  • a code example with all sensitive data removed.

Do not send your API key in a public chat or public issue.