Basketball V1
Top Players
Get top basketball players and player statistics
GET
/
athletes
/
top
Top Players
curl --request GET \
--url https://api.sportsapipro.com/v1/basketball/athletes/top \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sportsapipro.com/v1/basketball/athletes/top"
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/athletes/top', 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/athletes/top",
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/athletes/top"
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/athletes/top")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportsapipro.com/v1/basketball/athletes/top")
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{
"athletes": [
{
"id": 123,
"name": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"position": "<string>",
"team": {
"id": 123,
"name": "<string>",
"score": 123,
"imageUrl": "<string>"
},
"imageUrl": "<string>",
"stats": {
"pointsPerGame": 123,
"reboundsPerGame": 123,
"assistsPerGame": 123,
"gamesPlayed": 123
}
}
]
}Overview
Returns top basketball players for a competition, including season statistics like points per game, rebounds, and assists.Note: For the most accurate basketball player results, use the
/stats endpoint with a specific competitionId (e.g., 132 for NBA) to get statistical leaders, or use /search with filter=athletes to find specific players.Query Parameters
integer
required
Competition ID (e.g., 132 for NBA, 19 for EuroLeague)
integer
Number of players to return (default: 10)
Recommended Approach
For finding top basketball players, we recommend using the/stats endpoint which returns statistical leaders:
curl -X GET "https://api.sportsapipro.com/v1/basketball/stats?competitions=132&withSeasons=true" \
-H "x-api-key: YOUR_API_KEY"
// Get NBA statistical leaders
const response = await fetch(
'https://api.sportsapipro.com/v1/basketball/stats?competitions=132&withSeasons=true',
{ headers: { 'x-api-key': 'YOUR_API_KEY' } }
);
const { categories } = await response.json();
// Get top scorers
const topScorers = categories.find(c => c.name === 'Points')?.leaders || [];
console.log('NBA Top Scorers:', topScorers);
import requests
# Get NBA statistical leaders
response = requests.get(
'https://api.sportsapipro.com/v1/basketball/stats',
params={'competitions': 132, 'withSeasons': True},
headers={'x-api-key': 'YOUR_API_KEY'}
)
stats = response.json()
Code Examples (Athletes Endpoint)
curl -X GET "https://api.sportsapipro.com/v1/basketball/athletes/top?competitionId=132" \
-H "x-api-key: YOUR_API_KEY"
const response = await fetch(
'https://api.sportsapipro.com/v1/basketball/athletes/top?competitionId=132',
{ headers: { 'x-api-key': 'YOUR_API_KEY' } }
);
const { athletes } = await response.json();
// Sort by points per game
const topScorers = athletes.sort(
(a, b) => b.stats.pointsPerGame - a.stats.pointsPerGame
);
import requests
response = requests.get(
'https://api.sportsapipro.com/v1/basketball/athletes/top',
params={'competitionId': 132},
headers={'x-api-key': 'YOUR_API_KEY'}
)
athletes = response.json()['athletes']
Response Structure
array
Array of top players
Example Response
{
"athletes": [
{
"id": 12345,
"name": "LeBron James",
"firstName": "LeBron",
"lastName": "James",
"position": "SF",
"team": {
"id": 678,
"name": "Los Angeles Lakers"
},
"imageUrl": "...",
"stats": {
"pointsPerGame": 28.5,
"reboundsPerGame": 8.2,
"assistsPerGame": 7.1,
"gamesPlayed": 45
}
}
]
}
Related Endpoints
- /stats - Get statistical leaders for a competition (recommended)
- /search - Search for specific players by name
- /athletes/games - Get game-by-game stats for a player
Last modified on June 29, 2026
Was this page helpful?
⌘I
Top Players
curl --request GET \
--url https://api.sportsapipro.com/v1/basketball/athletes/top \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sportsapipro.com/v1/basketball/athletes/top"
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/athletes/top', 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/athletes/top",
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/athletes/top"
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/athletes/top")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sportsapipro.com/v1/basketball/athletes/top")
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{
"athletes": [
{
"id": 123,
"name": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"position": "<string>",
"team": {
"id": 123,
"name": "<string>",
"score": 123,
"imageUrl": "<string>"
},
"imageUrl": "<string>",
"stats": {
"pointsPerGame": 123,
"reboundsPerGame": 123,
"assistsPerGame": 123,
"gamesPlayed": 123
}
}
]
}