# NBA API
> Live NBA (basketball) data as an API — clean JSON, no key. Get the game scoreboard with live scores, clock and status; open any game for its leaders, line scores and result; browse the full conference standings (wins, losses, win percentage, games behind, streak); list all 30 teams and open a team for its standing, venue and colours; pull a player's profile (position, jersey, height, weight, college, team); search players by name; and read the latest NBA news. Live data sourced continuously from ESPN. One of the most-followed sports worldwide, with a huge fantasy and betting market — ideal for fantasy-basketball tools, score apps, dashboards, Discord bots and media sites. 8 data endpoints. Authenticated with an x-oanor-key; fair-use rate limits per plan.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/nba-api/..."
```

## Pricing
- **Free** (Free) — 3,200 calls/Mo, 5 req/s
- **Starter** ($9/Mo) — 56,000 calls/Mo, 15 req/s
- **Pro** ($37/Mo) — 310,000 calls/Mo, 30 req/s
- **Mega** ($125/Mo) — 1,450,000 calls/Mo, 80 req/s

## Endpoints

### Games

#### `GET /v1/game` — A single game's detail

**Parameters:**
- `id` (query, required, string) — Game id Example: `401859965`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nba-api/v1/game?id=401859965"
```

**Response:**
```json
{
    "data": {
        "game": {
            "id": "401859965",
            "name": "San Antonio Spurs at New York Knicks",
            "teams": [
                {
                    "id": "18",
                    "team": "New York Knicks",
                    "record": "53-29",
                    "winner": false,
                    "home_away": "home",
                    "linescores": [],
                    "abbreviation": "NY"
                },
                {
                    "id": "24",
                    "team": "San Antonio Spurs",
                    "record": "62-20",
                    "winner": false,
                    "home_away": "away",
                    "linescores": [],
                    "abbreviation": "SA"
                }
            ],
            "venue": "Madison Square Garden",
            "status": "Scheduled",
            "leaders": [
                {
                    "value": "26.0",
                    "athlete": "Jalen Brunson"
                },
                {
                    "value": "25.0",
                    "athlete": "Victor Wembanyama"
                }
            ],
            "completed": false
        }
    },
    "meta": {
        "timestamp": "2026-06-07T16:46:33.425Z",
        "request_id": "2e243285-9015-4a10-a88f-6556cc19d948"
    },
    "status": "ok",
    "message": "Game retrieved successfully",
    "success": true
}
```

#### `GET /v1/scoreboard` — Games & scores

**Parameters:**
- `dates` (query, optional, string) — Date range YYYYMMDD-YYYYMMDD
- `seasontype` (query, optional, string) — 1=pre, 2=regular, 3=post

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nba-api/v1/scoreboard"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "games": [
            {
                "id": "401859965",
                "away": {
                    "id": "24",
                    "logo": "https://a.espncdn.com/i/teamlogos/nba/500/scoreboard/sa.png",
                    "team": "San Antonio Spurs",
                    "score": "0",
                    "record": "62-20",
                    "winner": false,
                    "home_away": "away",
                    "abbreviation": "SA"
                },
                "date": "2026-06-09T00:30Z",
                "home": {
                    "id": "18",
                    "logo": "https://a.espncdn.com/i/teamlogos/nba/500/scoreboard/ny.png",
                    "team": "New York Knicks",
                    "score": "0",
                    "record": "53-29",
                    "winner": false,
                    "home_away": "home",
                    "abbreviation": "NY"
                },
                "name": "San Antonio Spurs at New York Knicks",
                "clock": "0.0",
                "venue": "Madison Square Garden",
                "period": 0,
                "status": "Scheduled",
                "broadcast": "ABC",
                "completed": false,
                "short_name": "SA @ NY",
                "season_type": 3
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-07T16:46:33.555Z",
        "request_id": "979f011e-648c-480d-a597-6694df9e4516"
    },
    "status":
…(truncated, see openapi.json for full schema)
```

### Standings

#### `GET /v1/standings` — Conference standings

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nba-api/v1/standings"
```

**Response:**
```json
{
    "data": {
        "count": 2,
        "conferences": [
            {
                "teams": [
                    {
                        "id": "8",
                        "team": "Detroit Pistons",
                        "wins": "60.0",
                        "losses": "22.0",
                        "streak": "W3",
                        "win_percent": ".732",
                        "abbreviation": "DET",
                        "games_behind": "-"
                    },
                    {
                        "id": "2",
                        "team": "Boston Celtics",
                        "wins": "56.0",
                        "losses": "26.0",
                        "streak": "W2",
                        "win_percent": ".683",
                        "abbreviation": "BOS",
                        "games_behind": "4"
                    },
                    {
                        "id": "18",
                        "team": "New York Knicks",
                        "wins": "53.0",
                        "losses": "29.0",
                        "streak": "L1",
                        "win_percent": ".646",
                        "abbreviation": "NY",
                        "games_behind": "7"
                    },
                    {
                        "id": "5",
                        "team": "Cleveland Cavaliers",
                        "wins": "52.0",
                        "losses": "30.0",
                        "streak"
…(truncated, see openapi.json for full schema)
```

### Teams

#### `GET /v1/team` — Team detail

**Parameters:**
- `id` (query, required, string) — Team id Example: `13`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nba-api/v1/team?id=13"
```

**Response:**
```json
{
    "data": {
        "team": {
            "id": "13",
            "logo": "https://a.espncdn.com/i/teamlogos/nba/500/lal.png",
            "name": "Los Angeles Lakers",
            "color": "552583",
            "record": "53-29",
            "location": "Los Angeles",
            "nickname": "Lakers",
            "standing": "1st in Pacific Division",
            "abbreviation": "LAL",
            "alternate_color": "fdb927"
        }
    },
    "meta": {
        "timestamp": "2026-06-07T16:46:34.652Z",
        "request_id": "4e837ca1-3303-4ac0-ac25-c47dc0432a00"
    },
    "status": "ok",
    "message": "Team retrieved successfully",
    "success": true
}
```

#### `GET /v1/teams` — All 30 NBA teams

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nba-api/v1/teams"
```

**Response:**
```json
{
    "data": {
        "count": 30,
        "teams": [
            {
                "id": "1",
                "logo": "https://a.espncdn.com/i/teamlogos/nba/500/atl.png",
                "name": "Atlanta Hawks",
                "color": "c8102e",
                "location": "Atlanta",
                "nickname": "Hawks",
                "abbreviation": "ATL",
                "alternate_color": "fdb927"
            },
            {
                "id": "2",
                "logo": "https://a.espncdn.com/i/teamlogos/nba/500/bos.png",
                "name": "Boston Celtics",
                "color": "008348",
                "location": "Boston",
                "nickname": "Celtics",
                "abbreviation": "BOS",
                "alternate_color": "ffffff"
            },
            {
                "id": "17",
                "logo": "https://a.espncdn.com/i/teamlogos/nba/500/bkn.png",
                "name": "Brooklyn Nets",
                "color": "000000",
                "location": "Brooklyn",
                "nickname": "Nets",
                "abbreviation": "BKN",
                "alternate_color": "ffffff"
            },
            {
                "id": "30",
                "logo": "https://a.espncdn.com/i/teamlogos/nba/500/cha.png",
                "name": "Charlotte Hornets",
                "color": "008ca8",
                "location": "Charlotte",
                "nickname": "Hornets",
                "abbreviation": "CHA",
                "al
…(truncated, see openapi.json for full schema)
```

### Players

#### `GET /v1/player` — Player profile

**Parameters:**
- `id` (query, required, string) — Player id Example: `1966`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nba-api/v1/player?id=1966"
```

**Response:**
```json
{
    "data": {
        "player": {
            "id": "1966",
            "age": 41,
            "name": "LeBron James",
            "team": "Los Angeles Lakers",
            "active": true,
            "height": "6' 9\"",
            "jersey": "23",
            "status": "active",
            "weight": "250 lbs",
            "headshot": "https://a.espncdn.com/i/headshots/nba/players/full/1966.png",
            "position": "F",
            "last_name": "James",
            "experience": "22nd Season",
            "first_name": "LeBron",
            "date_of_birth": "30/12/1984",
            "position_name": "Forward"
        }
    },
    "meta": {
        "timestamp": "2026-06-07T16:46:35.379Z",
        "request_id": "c3e81e13-d3df-4ec0-9e79-a122d62a2a09"
    },
    "status": "ok",
    "message": "Player retrieved successfully",
    "success": true
}
```

#### `GET /v1/search` — Search players

**Parameters:**
- `query` (query, required, string) — Player name Example: `curry`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nba-api/v1/search?query=curry"
```

**Response:**
```json
{
    "data": {
        "count": 11,
        "query": "curry",
        "players": [
            {
                "id": "5dda51f1-50c9-66e1-2026-400b73f34fad",
                "name": "Stephen Curry",
                "image": "https://a.espncdn.com/i/headshots/nba/players/full/3975.png",
                "subtitle": "Golden State Warriors"
            },
            {
                "id": "dc1a5379-4ca1-08ae-e6d0-2c04d99fe191",
                "name": "Stephen Curry",
                "subtitle": "Wittenberg Tigers"
            },
            {
                "id": "3f599388-2fb2-3f8c-8f8b-a0ec58fd65d2",
                "name": "Seth Curry",
                "image": "https://a.espncdn.com/i/headshots/nba/players/full/2326307.png",
                "subtitle": "Golden State Warriors"
            },
            {
                "id": "947e3ce2-e8d9-36c2-b3f2-f184ee7c1746",
                "name": "Caden Curry",
                "image": "https://a.espncdn.com/i/headshots/nfl/players/full/4685324.png",
                "subtitle": "Indianapolis Colts"
            },
            {
                "id": "91c868dd-d0a8-397a-b1e5-7bec99915097",
                "name": "John Curry",
                "image": "https://a.espncdn.com/i/headshots/college-football/players/full/4908551.png",
                "subtitle": "Texas Tech Red Raiders"
            },
            {
                "id": "a3e19d9a-96b2-34ab-87ed-c2518a398add",
                "name": "Ryan Curry",
                "image
…(truncated, see openapi.json for full schema)
```

### News

#### `GET /v1/news` — NBA news

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nba-api/v1/news"
```

**Response:**
```json
{
    "data": {
        "count": 6,
        "articles": [
            {
                "link": "https://www.espn.com/nba/story/_/id/48987208/nba-finals-2026-knicks-spurs-game-3-madison-square-garden-robinson-shamet-bench",
                "type": "Story",
                "image": "https://a.espncdn.com/photo/2026/0607/r1669310_1296x729_16-9.jpg",
                "headline": "NBA Finals 2026: Inside the Knicks' journey to embracing the bench",
                "published": "2026-06-07T16:21:10Z",
                "description": "Here's how New York embraced its bench and overcame one of its biggest obstacles to a title."
            },
            {
                "link": "https://www.espn.com/video/clip/_/id/48991299/what-adjustments-do-spurs-need-make-win-game-3",
                "type": "Media",
                "image": "https://a.espncdn.com/media/motion/2026/0607/ss_20260607_093626188_3556644/ss_20260607_093626188_3556644.jpg",
                "headline": "What adjustments do the Spurs need to make to win Game 3?",
                "published": "2026-06-07T13:58:38Z",
                "description": "What adjustments do the Spurs need to make to win Game 3?"
            },
            {
                "link": "http://www.espn.com/nba/preview?gameId=401859965",
                "type": "Preview",
                "image": "https://s.espncdn.com/stitcher/sports/basketball/nba/events/401859965.png?templateId=espn.applewatch.awayhome.1",
                "headline": "New York tak
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/nba-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "service": "nba-api",
        "endpoints": {
            "GET /v1/game": "A single game's detail by id.",
            "GET /v1/meta": "This document.",
            "GET /v1/news": "NBA news.",
            "GET /v1/team": "Team detail by id.",
            "GET /v1/teams": "All 30 NBA teams.",
            "GET /v1/player": "Player profile by id.",
            "GET /v1/search": "Search players by name.",
            "GET /v1/standings": "Conference standings.",
            "GET /v1/scoreboard": "Games & scores (dates=, seasontype=)."
        },
        "description": "NBA (basketball) data: game scoreboard and results, single-game detail with leaders, conference standings, all teams, team detail, player profiles, player search and NBA news. Real live data, no key."
    },
    "meta": {
        "timestamp": "2026-06-07T16:46:35.821Z",
        "request_id": "6033cfbd-cbf5-4987-869c-181be9d1b8c7"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/nba-api
OpenAPI spec: https://www.oanor.com/api/nba-api/openapi.json
