Players
Retrieve detailed information about NBA players.
Get All Players
Use this endpoint to retrieve information about NBA players.
import { Time4BoostAPI } from "@time4boost/sdk";
const api = new Time4BoostAPI({ apiKey: "YOUR_API_KEY" });
const players = await api.nba.getPlayers();
The above command returns JSON structured like this:
{
"data": [
{
"id": 19,
"first_name": "Stephen",
"last_name": "Curry",
"position": "G",
"height": "6-2",
"weight": "185",
"jersey_number": "30",
"college": "Davidson",
"country": "USA",
"draft_year": 2009,
"draft_round": 1,
"draft_number": 7,
"team": {
"id": 10,
"conference": "West",
"division": "Pacific",
"city": "Golden State",
"name": "Warriors",
"full_name": "Golden State Warriors",
"abbreviation": "GSW"
}
},
// ... more players
],
"meta": {
"next_cursor": 26,
"per_page": 25
}
}
HTTP Request
GET https://api.time4boost.com/v1/players
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) |
search | false | Search players by first or last name |
team_ids | false | Comma-separated list of team IDs to filter players |
Get Player by ID
Use this endpoint to retrieve information about a specific NBA player by their ID.
import { Time4BoostAPI } from "@time4boost/sdk";
const api = new Time4BoostAPI({ apiKey: "YOUR_API_KEY" });
const player = await api.nba.getPlayer(19);
The above command returns JSON structured like this:
{
"data": {
"id": 19,
"first_name": "Stephen",
"last_name": "Curry",
"position": "G",
"height": "6-2",
"weight": "185",
"jersey_number": "30",
"college": "Davidson",
"country": "USA",
"draft_year": 2009,
"draft_round": 1,
"draft_number": 7,
"team": {
"id": 10,
"conference": "West",
"division": "Pacific",
"city": "Golden State",
"name": "Warriors",
"full_name": "Golden State Warriors",
"abbreviation": "GSW"
}
}
}
HTTP Request
GET https://api.time4boost.com/v1/players/:id
URL Parameters
Parameter | Required | Description |
---|---|---|
id | true | The ID of the player 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 player 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.