# NBA API

> Returns NBA scoreboard games, season schedules and per-game box scores.

Category: Sports & Gaming. Region: US. 3 endpoints at `https://api.hoshime.com/v1/nba/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/nba
## GET /v1/nba/scoreboard

The games of the NBA day the CDN is showing now, with their state, score and records.

Scope: `social:read` · Units: 1

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `items` (Game[]), `items[].away` (Team), `items[].clock` (string), `items[].home` (Team), `items[].id` (string), `items[].period` (integer (int64)), `items[].startsAt` (string), `items[].status` (string), `items[].text` (string)

```bash
curl "https://api.hoshime.com/v1/nba/scoreboard" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nba/schedule

The games of the current NBA season, optionally of one team or one day, with the arena and state.

Scope: `social:read` · Units: 1 · Cached: 30 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `team` | string | no | Team code such as LAL to list one team's games. (e.g. LAL) |
| `date` | string | no | Day such as 2024-12-25 to list one day's games. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `items` (ScheduledGame[]), `items[].arena` (string), `items[].away` (Team), `items[].city` (string), `items[].date` (string), `items[].home` (Team), `items[].id` (string), `items[].startsAt` (string), `items[].status` (string), `items[].text` (string), `season` (string)

```bash
curl "https://api.hoshime.com/v1/nba/schedule?team=LAL" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nba/boxscore

The box score of one NBA game: each player's points, rebounds, assists and shooting for both teams.

Scope: `social:read` · Units: 1 · Cached: 1 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `gameId` | string | yes | 10-digit NBA game id such as 0022401000. The scoreboard and schedule endpoints list them. (e.g. 0022401000) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `away` (Team), `away.city` (string), `away.id` (string), `away.losses` (integer (int64)), `away.name` (string), `away.score` (integer (int64)), `away.tricode` (string), `away.wins` (integer (int64)), `home` (Team), `home.city` (string), `home.id` (string), `home.losses` (integer (int64)), `home.name` (string), `home.score` (integer (int64)), `home.tricode` (string), `home.wins` (integer (int64)), `id` (string), `players` (PlayerLine[]), `players[].assists` (integer (int64)), `players[].blocks` (integer (int64)), `players[].fieldGoalsAttempted` (integer (int64)), `players[].fieldGoalsMade` (integer (int64)), `players[].id` (string), `players[].name` (string), `players[].plusMinus` (integer (int64)), `players[].points` (integer (int64)), `players[].position` (string), `players[].rebounds` (integer (int64)), `players[].starter` (boolean), `players[].steals` (integer (int64)), `players[].team` (string), `players[].threePointersAttempted` (integer (int64)), `players[].threePointersMade` (integer (int64)), `players[].turnovers` (integer (int64)), `status` (string)

```bash
curl "https://api.hoshime.com/v1/nba/boxscore?gameId=0022401000" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
