Skip to main content
GET
/
games
/
current
Live Games
curl --request GET \
  --url https://v1.basketball.sportsapipro.com/games/current \
  --header 'x-api-key: <api-key>'
{
  "games": [
    {
      "id": 123,
      "statusText": "<string>",
      "statusGroup": 123,
      "homeCompetitor": {
        "id": 123,
        "name": "<string>",
        "score": 123,
        "imageUrl": "<string>"
      },
      "awayCompetitor": {
        "id": 123,
        "name": "<string>",
        "score": 123,
        "imageUrl": "<string>"
      },
      "competition": {
        "id": 123,
        "name": "<string>",
        "country": {
          "id": 123,
          "name": "<string>"
        },
        "hasStandings": true,
        "hasBrackets": true
      },
      "startTime": "2023-11-07T05:31:56Z"
    }
  ],
  "lastUpdateId": 123
}
Efficient Polling: Use the lastUpdateId parameter for real-time updates without re-fetching all data.

Overview

Returns all basketball games that are currently in progress. Data updates every ~5 seconds for full coverage leagues like NBA and EuroLeague.

Query Parameters

competitions
integer
Filter by competition ID (e.g., 132 for NBA, 138 for EuroLeague)
lastUpdateId
integer
For efficient polling - returns only games that have changed since this ID. Get this value from the previous response.

Response Structure

games
array
Array of live game objects
lastUpdateId
integer
Use this value in subsequent requests for efficient polling

Code Examples

curl -X GET "https://v1.basketball.sportsapipro.com/games/current" \
  -H "x-api-key: YOUR_API_KEY"

Polling for Live Updates

Use the lastUpdateId parameter for efficient polling. This returns only games that have changed, reducing bandwidth and improving performance.
let lastUpdateId = null;

async function pollLiveGames() {
  const url = lastUpdateId 
    ? `https://v1.basketball.sportsapipro.com/games/current?lastUpdateId=${lastUpdateId}`
    : 'https://v1.basketball.sportsapipro.com/games/current';
    
  const response = await fetch(url, {
    headers: { 'x-api-key': 'YOUR_API_KEY' }
  });
  
  const data = await response.json();
  lastUpdateId = data.lastUpdateId;
  
  // Process updated games
  data.games.forEach(game => {
    console.log(`${game.homeCompetitor.name} ${game.homeCompetitor.score} - ${game.awayCompetitor.score} ${game.awayCompetitor.name}`);
  });
  
  return data;
}

// Poll every 5 seconds
setInterval(pollLiveGames, 5000);

Filter by Competition

Get only NBA games:
curl -X GET "https://v1.basketball.sportsapipro.com/games/current?competitions=132" \
  -H "x-api-key: YOUR_API_KEY"

Status Groups

ValueMeaning
1Not Started / Scheduled
2Scheduled (pre-match)
3Live / In Progress
4Ended / Finished
5Cancelled
6Postponed
8Abandoned

Key Competition IDs

CompetitionID
NBA132
EuroLeague138
WNBA2004
NCAA Men’s2065
Spanish ACB149

Authorizations

x-api-key
string
header
required

Your SportsAPI Pro API key

Query Parameters

competitions
integer

Filter by competition ID (e.g., 132 for NBA)

Example:

132

lastUpdateId
integer

For efficient polling - returns only updates since this ID

Response

200 - application/json

Live games retrieved successfully

games
object[]
lastUpdateId
integer

Use for subsequent polling requests