Basketball V1
Team Rosters
Get team rosters and player information
GET
/
squads
Team Roster
curl --request GET \
--url https://api.sportsapipro.com/v1/basketball/squads \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sportsapipro.com/v1/basketball/squads"
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/squads', 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/squads",
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/squads"
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/squads")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportsapipro.com/v1/basketball/squads")
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_bodyV1 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.
Overview
Returns the current roster for a basketball team, including player details, positions, jersey numbers, and coaching staff.Query Parameters
integer
required
Team/Competitor ID (e.g., 2827 for LA Lakers)
Code Examples
curl -X GET "https://api.sportsapipro.com/v1/basketball/squads?competitors=2827" \
-H "x-api-key: YOUR_API_KEY"
const response = await fetch(
'https://api.sportsapipro.com/v1/basketball/squads?competitors=2827',
{ headers: { 'x-api-key': 'YOUR_API_KEY' } }
);
const { squad } = await response.json();
// Group players by position
const byPosition = squad.players.reduce((acc, player) => {
const pos = player.position || 'Unknown';
acc[pos] = acc[pos] || [];
acc[pos].push(player);
return acc;
}, {});
import requests
response = requests.get(
'https://api.sportsapipro.com/v1/basketball/squads',
params={'competitors': 2827},
headers={'x-api-key': 'YOUR_API_KEY'}
)
squad = response.json().get('squad', {})
Response Structure
object
Team roster information
Show Squad Object
Show Squad Object
object
Team details (id, name, imageUrl)
array
array
Array of coaching staff
Example Response
{
"squad": {
"team": {
"id": 2827,
"name": "Los Angeles Lakers",
"imageUrl": "..."
},
"players": [
{
"id": 12345,
"name": "LeBron James",
"jerseyNumber": 23,
"position": "SF",
"age": 41,
"height": "6'9\"",
"nationality": {
"id": 1,
"name": "United States"
},
"imageUrl": "..."
}
],
"coaches": [
{
"id": 98765,
"name": "JJ Redick",
"role": "Head Coach"
}
]
}
}
Common Team IDs
| Team | ID |
|---|---|
| Los Angeles Lakers | 2827 |
| Boston Celtics | 2765 |
| Golden State Warriors | 2841 |
| Miami Heat | 2802 |
| Real Madrid (EuroLeague) | 275 |
Last modified on June 29, 2026
Was this page helpful?
⌘I
Team Roster
curl --request GET \
--url https://api.sportsapipro.com/v1/basketball/squads \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sportsapipro.com/v1/basketball/squads"
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/squads', 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/squads",
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/squads"
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/squads")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportsapipro.com/v1/basketball/squads")
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