Skip to content

balldontlie API

by balldontlie.io

No authHTTPSCORSSports & Fitness
Open documentation ↗

Overview

Balldontlie provides access to stats data from the NBA

balldontlie is a sports & fitness API from balldontlie.io. It needs no API key. It is served over HTTPS and allows browser requests (CORS). Its OpenAPI description documents 7 endpoints.

At a glance

Authentication
No auth
HTTPS
Yes
CORS
Yes
Base URL
https://balldontlie.io
Version
1.0.0
Endpoints
7
Spec updated
2023-03-06

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://balldontlie.io/api/v1/games" \
  -H "Accept: application/json"
JavaScript
const response = await fetch("https://balldontlie.io/api/v1/games", {
  method: "GET",
  headers: {
    "Accept": "application/json",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://balldontlie.io/api/v1/games",
    headers={
    "Accept": "application/json",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/api/v1/gamesall games (example parameters)
GET/api/v1/games/32881specific game
GET/api/v1/playersall players (search)
GET/api/v1/players/237specific player
GET/api/v1/statsall stats (example parameters)
GET/api/v1/teamsall teams
GET/api/v1/teams/1specific team

Questions

Does the balldontlie API need an API key?

No. The balldontlie API can be called without an API key or sign-up, which makes it handy for prototypes and front-end demos.

Can I call the balldontlie API from the browser?

Yes. The balldontlie API sends CORS headers, so a web page can call it directly with fetch().

Does the balldontlie API support HTTPS?

Yes, the balldontlie API is served over HTTPS.

How many endpoints does the balldontlie API have?

Its OpenAPI description lists 7 endpoints in version 1.0.0. All of them are shown on this page.

What are alternatives to the balldontlie API?

Other Sports & Fitness APIs include Fitbit, TheSportsDB, Cloudbet, Sportmonks Cricket, CollegeFootballData.com.

Compare alternatives →

Listed from public-apis (MIT), public-apis database (MIT), APIs.guru (CC0).