Basketball V1
Live Games
Get all currently live basketball games with real-time scores
GET
/
games
/
current
Live Games
curl --request GET \
--url https://api.sportsapipro.com/v1/basketball/games/current \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sportsapipro.com/v1/basketball/games/current"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sportsapipro.com/v1/basketball/games/current', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sportsapipro.com/v1/basketball/games/current",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sportsapipro.com/v1/basketball/games/current"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sportsapipro.com/v1/basketball/games/current")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportsapipro.com/v1/basketball/games/current")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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
}V1 Legacy Endpoint — This is a V1 API endpoint. For new integrations, we recommend using the Basketball V2 API which provides richer data and more endpoints.
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
For efficient polling - returns only games that have changed since this ID. Get this value from the previous response.
Response Structure
Array of live game objects
Show Game Object
Show Game Object
Status group: 1=Not Started, 2=Scheduled, 3=Live/In Progress, 4=Ended, 5=Cancelled, 6=Postponed, 8=Abandoned
Code Examples
curl -X GET "https://api.sportsapipro.com/v1/basketball/games/current" \
-H "x-api-key: YOUR_API_KEY"
const response = await fetch(
'https://api.sportsapipro.com/v1/basketball/games/current',
{ headers: { 'x-api-key': 'YOUR_API_KEY' } }
);
const data = await response.json();
console.log(data.games);
import requests
response = requests.get(
'https://api.sportsapipro.com/v1/basketball/games/current',
headers={'x-api-key': 'YOUR_API_KEY'}
)
data = response.json()
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://api.sportsapipro.com/v1/basketball/games/current?lastUpdateId=${lastUpdateId}`
: 'https://api.sportsapipro.com/v1/basketball/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);
import requests
import time
last_update_id = None
def poll_live_games():
global last_update_id
url = 'https://api.sportsapipro.com/v1/basketball/games/current'
if last_update_id:
url += f'?lastUpdateId={last_update_id}'
response = requests.get(url, headers={'x-api-key': 'YOUR_API_KEY'})
data = response.json()
last_update_id = data.get('lastUpdateId')
return data
# Poll every 5 seconds
while True:
data = poll_live_games()
for game in data.get('games', []):
print(f"{game['homeCompetitor']['name']} vs {game['awayCompetitor']['name']}")
time.sleep(5)
Filter by Competition
Get only NBA games:curl -X GET "https://api.sportsapipro.com/v1/basketball/games/current?competitions=132" \
-H "x-api-key: YOUR_API_KEY"
Status Groups
| Value | Meaning |
|---|---|
| 1 | Not Started / Scheduled |
| 2 | Scheduled (pre-match) |
| 3 | Live / In Progress |
| 4 | Ended / Finished |
| 5 | Cancelled |
| 6 | Postponed |
| 8 | Abandoned |
Key Competition IDs
| Competition | ID |
|---|---|
| NBA | 132 |
| EuroLeague | 138 |
| WNBA | 2004 |
| NCAA Men’s | 2065 |
| Spanish ACB | 149 |
Query Parameters
Last modified on June 29, 2026
Was this page helpful?
⌘I
Live Games
curl --request GET \
--url https://api.sportsapipro.com/v1/basketball/games/current \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sportsapipro.com/v1/basketball/games/current"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sportsapipro.com/v1/basketball/games/current', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sportsapipro.com/v1/basketball/games/current",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sportsapipro.com/v1/basketball/games/current"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sportsapipro.com/v1/basketball/games/current")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportsapipro.com/v1/basketball/games/current")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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
}