Teams
Retrieve comprehensive information about NBA teams.
Get All Teams
Use this endpoint to retrieve information about all NBA teams.
import { Time4BoostAPI } from "@time4boost/sdk";
const api = new Time4BoostAPI({ apiKey: "YOUR_API_KEY" });
const teams = await api.nba.getTeams();
The above command returns JSON structured like this:
{
"data": [
{
"id": 1,
"conference": "East",
"division": "Southeast",
"city": "Atlanta",
"name": "Hawks",
"full_name": "Atlanta Hawks",
"abbreviation": "ATL"
},
// ... more teams
],
"meta": {
"next_cursor": 26,
"per_page": 25
}
}
HTTP Request
GET https://api.time4boost.com/v1/teams
Query Parameters
Parameter | Required | Description |
---|---|---|
cursor | false | Cursor for pagination, use the value from meta.next_cursor |
per_page | false | Number of results per page (default: 25, max: 100) |
division | false | Filter teams by division |
conference | false | Filter teams by conference |
Get Team by ID
Use this endpoint to retrieve information about a specific NBA team by its ID.
import { Time4BoostAPI } from "@time4boost/sdk";
const api = new Time4BoostAPI({ apiKey: "YOUR_API_KEY" });
const team = await api.nba.getTeam(1);
The above command returns JSON structured like this:
{
"data": {
"id": 1,
"conference": "East",
"division": "Southeast",
"city": "Atlanta",
"name": "Hawks",
"full_name": "Atlanta Hawks",
"abbreviation": "ATL"
}
}
HTTP Request
GET https://api.time4boost.com/v1/teams/:id
URL Parameters
Parameter | Required | Description |
---|---|---|
id | true | The ID of the team to retrieve |
Error Responses
The API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your API key is wrong. |
403 | Forbidden -- The requested resource is hidden for administrators only. |
404 | Not Found -- The specified resource could not be found. |
429 | Too Many Requests -- You're requesting too many resources! Slow down! |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
Rate Limiting
The API is rate limited to prevent abuse and ensure a fair usage for all users. The rate limits depend on your account tier:
- Free tier: 30 requests per minute
- ALL-STAR tier: 60 requests per minute
- GOAT tier: 120 requests per minute
If you exceed the rate limit, you'll receive a 429 Too Many Requests response. The response will include headers indicating your current rate limit status:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1623423149
The X-RateLimit-Reset header contains a Unix timestamp indicating when your rate limit will reset.