Getting started
api4data gives you a clean client API to sync events and live markets. Call the endpoints in order so IDs stay linked correctly. Your server IP must be whitelisted before requests will work.
1 API call per second
across all REST APIs (Sport list, Tournament list, Event list, Market list, and Market details).
https://api4data.com
https://socket.api4data.com
Sport list
GET every sport and store sportId.
Tournament list
POST to receive tournaments for those sports.
Event list
GET all events and store them in your system.
Market list
POST event id(s) to receive that event’s markets.
Market details
POST market id(s) to receive live market data.
Socket · marketRate
Listen for instant market updates on the socket.
Introduction
Follow these steps for a full integration.
Step 1 — Sport list
Call /api/client/sportList. You receive every sport
(sportId, sportName). Store these before loading tournaments.
Step 2 — Tournament list
Call /api/client/tournamentsList with
tournamentId, tournamentName, and sportId set to 1.
Each item includes
tournamentId, tournamentName, and sportId
from the Sport list.
Step 3 — Event list
Call /api/client/eventList. You receive the full event list.
Save it locally so you can map users / UI to stable event ids.
Step 4 — Market list
Call /api/client/marketList with one or more eventId values
from the Event list. Use page and limit for pagination
(limit max 200).
Step 5 — Market details
Call /api/client/marketPrice with marketId values from Market list
to get live market data for pricing / odds screens
(max 200 market ids per request).
Step 6 — Socket · marketRate
Connect to https://socket.api4data.com and listen on the
marketRate event. Whenever any market updates, you receive that
update instantly over the socket — no need to keep polling Market details.
API reference
All client endpoints below are under https://api4data.com.
Sport list
Returns every sport. Use sportId when you read the Tournament list.
https://api4data.com/api/client/sportList
| Key | Value |
|---|---|
Content-Type |
application/json |
None — this is a GET request.
| Field | Type | Description |
|---|---|---|
sportId |
number | Sport id. Example: 2 |
sportName |
string | Sport name. Example: Tennis |
curl -X GET "https://api4data.com/api/client/sportList" \ -H "Content-Type: application/json"
[
{
"sportId": 2,
"sportName": "Tennis"
}
]
Tournament list
Returns tournaments after the Sport list.
Each item includes tournamentId, tournamentName, and sportId.
https://api4data.com/api/client/tournamentsList
| Key | Value |
|---|---|
Content-Type |
application/json |
| Field | Type | Description |
|---|---|---|
tournamentId |
number | 1 to include tournament id in the result |
tournamentName |
number | 1 to include tournament name in the result |
sportId |
number | 1 to include sport id from Sport list |
{
"tournamentId": 1,
"tournamentName": "BCC World-Cup",
"sportId": 1
}
curl -X POST "https://api4data.com/api/client/tournamentsList" \
-H "Content-Type: application/json" \
-d '{"tournamentId":1,"tournamentName":"BCC World-Cup","sportId":1}'
[
{
"tournamentId": 1,
"tournamentName": "BCC World-Cup",
"sportId": 1
}
]
Event list
Returns every available event. Use this as your source of truth for event ids.
https://api4data.com/api/client/eventList
| Key | Value |
|---|---|
Content-Type |
application/json |
None — this is a GET request.
curl -X GET "https://api4data.com/api/client/eventList" \ -H "Content-Type: application/json"
{
"message": "event list successful",
"data": [
{
"_id": "69d8dec3e7cb6a418659eb4d",
"eventId": "35303651",
"marketId": "1.988253031",
"exEventId": "b26c4f948b14bca4174b194d707ef7f9",
"sportId": "6",
"tournamentsId": "1576402161",
"tournamentsName": "Boxing Matches",
"eventName": "Floyd Mayweather Jr v Manny Pacquiao",
"highlight": false,
"quicklink": false,
"popular": false,
"IsSettle": 0,
"IsVoid": 0,
"IsUnsettle": 1,
"dataSwitch": 0,
"createdAt": "2026-04-10T11:28:03.576Z",
"marketTime": "2026-09-20T03:30:00.000Z"
}
]
}
Market list
Returns markets for the event id(s) you pass. Pass ids you stored from the Event list response.
https://api4data.com/api/client/marketList
| Key | Value |
|---|---|
Content-Type |
application/json |
| Field | Type | Description |
|---|---|---|
eventId required |
string[] | Event ids from Event list API. Example: ["35303651"] |
page required |
integer | Page number starting from 1 |
limit required |
integer | Records per page. Maximum 200. Example: 10 |
{
"eventId": ["35303651"],
"page": 1,
"limit": 10
}
curl -X POST "https://api4data.com/api/client/marketList" \
-H "Content-Type: application/json" \
-d '{"eventId":["35303651"],"page":1,"limit":10}'
{
"message": "market list successful",
"data": {
"page": 1,
"limit": 10,
"totalPages": 1,
"totalResults": 1,
"results": [
{
"_id": "69d8df366435c37dc070f4f6",
"eventName": "Floyd Mayweather Jr v Manny Pacquiao",
"marketId": "1.988253031",
"exEventId": "b26c4f948b14bca4174b194d707ef7f9",
"exMarketId": "a26c25ae28270df1b4e9a5fcbec85839",
"isPreBet": false,
"marketName": "Match Odds",
"marketTime": "2026-09-20T03:30:00.000Z",
"sportName": "Boxing",
"tournamentsName": "Boxing Matches",
"type": "match_odds"
}
]
}
}
Market details
Returns live market data for one or more market ids. Use market ids from the Market list response.
https://api4data.com/api/client/marketPrice
| Key | Value |
|---|---|
Content-Type |
application/json |
| Field | Type | Description |
|---|---|---|
marketId required |
string[] | Use exMarketId values from Market list. Max 200 ids per request. Example: ["a26c25ae28270df1b4e9a5fcbec85839"] |
{
"marketId": ["a26c25ae28270df1b4e9a5fcbec85839"]
}
curl -X POST "https://api4data.com/api/client/marketPrice" \
-H "Content-Type: application/json" \
-d '{"marketId":["a26c25ae28270df1b4e9a5fcbec85839"]}'
{
"message": "market list successful",
"data": [
{
"_id": "69d8df366435c37dc070f4f6",
"marketId": "1.988253031",
"exMarketId": "a26c25ae28270df1b4e9a5fcbec85839",
"marketName": "Match Odds",
"marketTime": "2026-09-20T03:30:00.000Z",
"runners": [
{
"selectionId": 3861213,
"handicap": 0,
"description": {
"runnerName": "Floyd Mayweather Jr",
"metadata": {
"runnerId": "3861213"
}
},
"state": {
"sortPriority": 1,
"lastPriceTraded": 1.63,
"totalMatched": 0,
"status": "ACTIVE"
},
"exchange": {
"availableToBack": [
{
"price": 1.55,
"size": 42.71
},
{
"price": 1.54,
"size": 133.45
}
],
"availableToLay": [
{
"price": 1.66,
"size": 78.12
},
{
"price": 1.67,
"size": 24.78
}
]
}
},
{
"selectionId": 2364143,
"handicap": 0,
"description": {
"runnerName": "Manny Pacquiao",
"metadata": {
"runnerId": "2364143"
}
},
"state": {
"sortPriority": 2,
"lastPriceTraded": 3,
"totalMatched": 0,
"status": "ACTIVE"
},
"exchange": {
"availableToBack": [
{
"price": 3.1,
"size": 19.2
},
{
"price": 2.86,
"size": 38.94
}
],
"availableToLay": [
{
"price": 3.3,
"size": 70.61
},
{
"price": 3.6,
"size": 10.89
}
]
}
},
{
"selectionId": 31162,
"handicap": 0,
"description": {
"runnerName": "Draw",
"metadata": {
"runnerId": "31162"
}
},
"state": {
"sortPriority": 3,
"lastPriceTraded": 17,
"totalMatched": 0,
"status": "ACTIVE"
},
"exchange": {
"availableToBack": [
{
"price": 11,
"size": 25.53
},
{
"price": 9,
"size": 15.23
}
],
"availableToLay": [
{
"price": 20,
"size": 21.63
},
{
"price": 22,
"size": 14.78
}
]
}
}
],
"state": {
"betDelay": 0,
"bspReconciled": false,
"complete": true,
"inplay": false,
"numberOfWinners": 1,
"numberOfRunners": 3,
"numberOfActiveRunners": 3,
"lastMatchTime": "2026-04-09T18:39:46.195Z",
"totalMatched": 1013.0356673161865,
"totalAvailable": 1850.9237527197595,
"crossMatching": true,
"runnersVoidable": false,
"version": 7270738430,
"betDelayModels": [],
"status": "SUSPENDED"
},
"type": "match_odds"
}
]
}
Socket · marketRate
Connect to the live socket and listen for the marketRate event.
Any market update is pushed to you instantly — use this after you have loaded
markets via the REST APIs.
https://socket.api4data.com
| Event name | Description |
|---|---|
marketRate listen |
Fired whenever a market rate / price updates. Payload contains the latest market update so your UI can refresh instantly. |
1. Connect your client to https://socket.api4data.com.
2. Subscribe / listen on the marketRate event.
3. On every market change, the socket emits marketRate with the update payload.
4. Apply that payload in your app immediately (no extra REST poll needed for live rates).
import { io } from "socket.io-client";
const socket = io("https://socket.api4data.com");
socket.on("connect", () => {
console.log("connected", socket.id);
});
socket.on("marketRate", (data) => {
// Instant market update — refresh rates in your UI
console.log("marketRate update", data);
});
socket.on("disconnect", () => {
console.log("disconnected");
});
marketRate payloadLive push payload shape matches market details (rates update instantly on this event).
{
"_id": "69d8df366435c37dc070f4f6",
"marketId": "1.988253031",
"exMarketId": "a26c25ae28270df1b4e9a5fcbec85839",
"marketName": "Match Odds",
"marketTime": "2026-09-20T03:30:00.000Z",
"runners": [
{
"selectionId": 3861213,
"handicap": 0,
"description": {
"runnerName": "Floyd Mayweather Jr",
"metadata": {
"runnerId": "3861213"
}
},
"state": {
"sortPriority": 1,
"lastPriceTraded": 1.63,
"totalMatched": 0,
"status": "ACTIVE"
},
"exchange": {
"availableToBack": [
{
"price": 1.55,
"size": 42.71
},
{
"price": 1.54,
"size": 133.45
}
],
"availableToLay": [
{
"price": 1.66,
"size": 78.12
},
{
"price": 1.67,
"size": 24.78
}
]
}
},
{
"selectionId": 2364143,
"handicap": 0,
"description": {
"runnerName": "Manny Pacquiao",
"metadata": {
"runnerId": "2364143"
}
},
"state": {
"sortPriority": 2,
"lastPriceTraded": 3,
"totalMatched": 0,
"status": "ACTIVE"
},
"exchange": {
"availableToBack": [
{
"price": 3.1,
"size": 19.2
},
{
"price": 2.86,
"size": 38.94
}
],
"availableToLay": [
{
"price": 3.3,
"size": 70.61
},
{
"price": 3.6,
"size": 10.89
}
]
}
},
{
"selectionId": 31162,
"handicap": 0,
"description": {
"runnerName": "Draw",
"metadata": {
"runnerId": "31162"
}
},
"state": {
"sortPriority": 3,
"lastPriceTraded": 17,
"totalMatched": 0,
"status": "ACTIVE"
},
"exchange": {
"availableToBack": [
{
"price": 11,
"size": 25.53
},
{
"price": 9,
"size": 15.23
}
],
"availableToLay": [
{
"price": 20,
"size": 21.63
},
{
"price": 22,
"size": 14.78
}
]
}
}
],
"state": {
"betDelay": 0,
"bspReconciled": false,
"complete": true,
"inplay": false,
"numberOfWinners": 1,
"numberOfRunners": 3,
"numberOfActiveRunners": 3,
"lastMatchTime": "2026-04-09T18:39:46.195Z",
"totalMatched": 1013.0356673161865,
"totalAvailable": 1850.9237527197595,
"crossMatching": true,
"runnersVoidable": false,
"version": 7270738430,
"betDelayModels": [],
"status": "SUSPENDED"
},
"type": "match_odds"
}
marketPrice) for the initial snapshot, then keep the socket
open and apply marketRate events for live updates.
Integration notes
Recommended order: Sport list → Tournament list → Event list → Market list → Market details → Socket marketRate.
Batching: eventId and marketId accept arrays, so you can request multiple ids in one call.
Max limit: Market list limit and Market details marketId array both support a maximum of 200 per request.
Rate limit: maximum 1 API call per second across all REST APIs.
Pagination: for large market lists, increase page while keeping the same limit (max 200).
Live updates: listen on marketRate at https://socket.api4data.com for instant market changes.
Content type: send and expect application/json on REST calls.