NBA Team Rankings & Trends API avatar

NBA Team Rankings & Trends API

Pricing

from $3.00 / 1,000 results

Go to Apify Store
NBA Team Rankings & Trends API

NBA Team Rankings & Trends API

NBA team stats API with 147 metrics covering scoring, efficiency, quarter-by-quarter performance, home/away splits, recent form, and historical trends. Built for sports analytics, betting research, fantasy apps, dashboards, AI agents, and data pipelines.

Pricing

from $3.00 / 1,000 results

Rating

0.0

(0)

Developer

Data Hub

Data Hub

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

a month ago

Last modified

Categories

Features

Limited permissionsSingle-tenantServer interface

Share

🏀 NBA Team Rankings & Historical Statistics API

Collect structured NBA team statistics from TeamRankings without maintaining your own scraper.

NBA Team Rankings & Trends API is an Apify Actor from Data Hub. It reads TeamRankings NBA stat pages for the dates you choose and returns one dataset row per team, statistic, and date. A single day can cover one metric, such as points per game, or the built-in list of 147 stat tables.

Use it as an NBA statistics API for dashboards, research, fantasy tools, and data pipelines. A normal run writes an Apify dataset. Standby mode also exposes HTTP endpoints, so an application can request the same rows without starting a separate scraper.

This Actor is not affiliated with the NBA or with TeamRankings. It does not predict game results.

What you can do with it

TeamRankings already publishes the tables. This Actor turns those pages into rows you can export, schedule, or call from code.

  • Pick a start date and an end date. Both days are included.
  • Choose one or more stat tables, or choose all for the 147 default tables.
  • Download several pages at once. threadCount accepts 1 to 20 workers.
  • Store every team row in the run dataset, then export it from Apify.
  • Call GET /stats or POST /stats while the Actor is in Standby mode.

Each row includes the season value, the last 3 games, the last game, home, away, and the previous season, using whatever columns that TeamRankings table shows.

Key features

  • 147 NBA stat tables. Scoring, shooting, rebounding, defense, opponent stats, quarters, halves, and win percentage are in the default list.
  • Historical dates. Any YYYY-MM-DD range the source can serve. The Actor does not invent dates the site does not publish.
  • Choose your tables. Pass slugs such as points-per-game or offensive-efficiency.
  • Parallel downloads. Worker threads fetch different stat pages at the same time.
  • One row per team, stat, and date. The dataset stays flat and easy to filter.
  • Recent form on every row. last_3 and last_1 come from the page's recent-game columns.
  • Home and away on every row. Those splits are columns, not separate tables.
  • Quarter, half, and overtime tables. Included where the default slug list has them.
  • Apify dataset and API. Normal runs push rows to the default dataset.
  • Standby HTTP API. GET /, GET /stats, and POST /stats are implemented.

Who this Actor is for

  • Sports data analysts who need repeatable NBA team performance snapshots instead of copying tables by hand.
  • Basketball researchers comparing a date's season line with the previous season, home, away, and recent games.
  • Fantasy basketball developers who want season and recent scoring, shooting, rebounding, and opponent stats as JSON.
  • Sports analytics teams building internal NBA datasets from a stable input and output shape.
  • Data engineers loading exported rows into a warehouse or a pipeline.
  • Dashboard developers charting one stat over a date range, or many stats for one day.
  • AI application developers passing structured team rows into their own tools. This Actor does not expose an MCP server.

The rows are source statistics. They are not win probabilities or betting picks.

Available NBA statistics

statTables is required. Select one or more slugs from the dropdown, or select all for the 147 slugs in the default list. Each slug is one TeamRankings page: https://www.teamrankings.com/nba/stat/{slug}?date=YYYY-MM-DD.

A value that is not in that list is rejected before any download. If the page has no team rows, a normal run fails and a Standby request returns HTTP 422.

Home, away, last 3 games, last game, season, and previous season are columns on each row. They are not extra slugs.

Scoring

points-per-game, average-scoring-margin, points-in-paint-per-game, fastbreak-points-per-game, fastbreak-efficiency, average-biggest-lead, points-from-2-pointers, points-from-3-pointers, percent-of-points-from-2-pointers, percent-of-points-from-3-pointers, percent-of-points-from-free-throws

Shooting and efficiency

offensive-efficiency, defensive-efficiency, floor-percentage, shooting-pct, effective-field-goal-pct, true-shooting-percentage, three-point-pct, two-point-pct, free-throw-pct, three-point-rate, two-point-rate, free-throw-rate, field-goals-made-per-game, field-goals-attempted-per-game, three-pointers-made-per-game, three-pointers-attempted-per-game, free-throws-made-per-game, free-throws-attempted-per-game, fta-per-fga, ftm-per-100-possessions, non-blocked-2-pt-pct

Quarters, halves, and overtime

1st-quarter-points-per-game, 2nd-quarter-points-per-game, 3rd-quarter-points-per-game, 4th-quarter-points-per-game, 1st-half-points-per-game, 2nd-half-points-per-game, overtime-points-per-game, plus the matching average-*-margin slugs and average-margin-thru-3-quarters.

Rebounds, defense, playmaking, and fouls

offensive-rebounds-per-game, defensive-rebounds-per-game, total-rebounds-per-game, offensive-rebounding-pct, defensive-rebounding-pct, blocks-per-game, steals-per-game, block-pct, steal-pct, assists-per-game, turnovers-per-game, assist--per--turnover-ratio, turnover-pct, personal-fouls-per-game, technical-fouls-per-game

Pace and results

games-played, possessions-per-game, extra-chances-per-game, effective-possession-ratio, win-pct-all-games, win-pct-close-games

Combined box-score lines

points-plus-rebounds-plus-assists-per-game, points-plus-rebounds-per-game, points-plus-assists-per-game, rebounds-plus-assists-per-game, steals-plus-blocks-per-game

Opponent versions

67 default slugs start with opponent-, including opponent scoring, shooting, rebounding, fouls, quarters, halves, and win percentage. Copy the slug exactly. Two of them do not follow the usual hyphen pattern:

  • opponent-steals-perpossession
  • opponent-points-plus-rebounds-plus-assists-per-gam

assist--per--turnover-ratio and opponent-assist--per--turnover-ratio use double hyphens.

Quick start

  1. Open NBA Team Rankings & Trends API in Apify Console.
  2. Set Start date and End date to the same day for a small test, for example 2026-10-13.
  3. Under Stat tables, select offensive-efficiency. Select all only when you want all 147 tables.
  4. Set Worker threads to 8, or any whole number from 1 to 20.
  5. Start the Actor and wait until the run succeeds.
  6. Open the run's Output or dataset tab. One successful page for that date returned 30 team rows.
  7. Export the dataset from Apify Console. The download menu includes JSON and CSV, plus the other formats Apify currently offers, such as Excel and XML.

A normal run reads the input once, writes the dataset, and exits. Standby is a separate mode, described below.

Input parameters

ParameterTypeRequiredDefaultDescription
startDatestringyesnoneFirst day, YYYY-MM-DD. A longer ISO timestamp is accepted; only the first 10 characters are used.
endDatestringyesnoneLast day, YYYY-MM-DD, included in the range. The run fails if this day is before startDate.
statTablesarray of stringsyesnoneDropdown of all and the 147 slugs. all runs every default table. Several specific slugs can be selected. Blank or omitted is rejected.
threadCountintegerno8 in the input formPages downloaded at the same time. Minimum 1, maximum 20.

The input form's default for threadCount is 8. If a raw API or Standby request omits threadCount entirely, the code uses 7. Sending "threadCount": 8 matches the form default.

{
"startDate": "2026-10-13",
"endDate": "2026-10-13",
"statTables": ["offensive-efficiency"],
"threadCount": 8
}

That input is valid. A local request for offensive-efficiency on 2026-10-13 returned 30 rows.

The Actor asks for one page per stat per day. Fifteen days and all 147 tables means 2,205 page requests. Use a short range while testing.

Output data structure

A normal run stores one dataset item for each team row on each requested page. Standby returns the same objects in a JSON array and, in the current code, does not write them to the dataset.

Numeric cells become numbers. Whole numbers stay integers. Other numbers stay decimals. A cell that is not numeric stays text. An empty cell becomes null.

FieldMeaning
dateRequested stat date, YYYY-MM-DD.
teamTeam name as printed by TeamRankings, such as Denver or Okla City.
records_tableStat slug for this row.
seasonSeason label selected on the page, such as 2025-2026.
start_year_seasonValue in the current-season column.
last_3Value in the last-3-games column.
last_1Value in the last-game column.
homeHome split from that table.
awayAway split from that table.
before_start_year_seasonPrevious-season column.
id{slug}_{date}_{team}_Basketball.
team_linkAbsolute team URL from the page.
leagueAlways nba.
sportAlways BasketBall.
last_updateDate the row was scraped, not the stat date.

Row order follows whichever page finishes first. Do not rely on team or stat order.

Older dataset rows

Current rows use start_year_season and before_start_year_season, and numeric cells are numbers. Dataset items saved by an earlier build used the spellings start_year_sesson and before_start_year_sesson, with the values stored as text such as "1.177". Use the field names on the item you received.

JSON output example

This item was parsed from the TeamRankings offensive-efficiency page for 13 October 2026. last_update is the day the row was scraped.

{
"id": "offensive-efficiency_2026-10-13_Denver_Basketball",
"date": "2026-10-13",
"season": "2025-2026",
"team": "Denver",
"team_link": "https://www.teamrankings.com/nba/team/denver-nuggets",
"start_year_season": 1.177,
"last_3": 1.067,
"last_1": 1.041,
"home": 1.176,
"away": 1.178,
"before_start_year_season": 1.148,
"records_table": "offensive-efficiency",
"league": "nba",
"last_update": "2026-10-18",
"sport": "BasketBall"
}

API integration

Create an Apify API token in Console and keep it on your side. The examples use YOUR_APIFY_TOKEN as a placeholder.

Run the Actor with the Apify API

curl -X POST "https://api.apify.com/v2/acts/data_hub~nba-team-rankings-trends-api/runs" \
-H "Authorization: Bearer YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"startDate": "2026-10-13",
"endDate": "2026-10-13",
"statTables": ["offensive-efficiency"],
"threadCount": 8
}'

The run response includes defaultDatasetId. When the run succeeds, read the rows:

curl "https://api.apify.com/v2/datasets/DATASET_ID/items?format=json" \
-H "Authorization: Bearer YOUR_APIFY_TOKEN"

Replace DATASET_ID with defaultDatasetId from the run. format also accepts the dataset formats Apify documents, including csv.

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("data_hub/nba-team-rankings-trends-api").call(
run_input={
"startDate": "2026-10-13",
"endDate": "2026-10-13",
"statTables": ["offensive-efficiency"],
"threadCount": 8,
}
)
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(len(items), items[0]["team"], items[0]["start_year_season"])

apify-client is the Apify Python client. It is not installed by the Actor image.

Standby HTTP endpoints

Standby is enabled for this Actor. The hostname published for it is:

https://data-hub--nba-team-rankings-trends-api.apify.actor

Send your token in the Authorization: Bearer header. A token query parameter also works, but the header is safer because URLs are often logged. Tokenless access is not enabled.

MethodPathSuccessErrors
GET/Plain text ok for Apify's readiness probe. JSON {"status":"ok","statsPath":"/stats"} otherwise.
GET/statsJSON array of team rows.400 for a bad date, slug, or thread count. 422 when the pages contain no rows. 500 when a download fails. 404 for any other path.
POST/statsSame array. Send the input as JSON. Query parameters override the body.Same status codes as GET /stats.
curl "https://data-hub--nba-team-rankings-trends-api.apify.actor/stats?startDate=2026-10-13&endDate=2026-10-13&statTables=offensive-efficiency&threadCount=8" \
-H "Authorization: Bearer YOUR_APIFY_TOKEN"

Repeat statTables for more than one slug, or send a JSON body:

curl -X POST "https://data-hub--nba-team-rankings-trends-api.apify.actor/stats" \
-H "Authorization: Bearer YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"startDate": "2026-10-13",
"endDate": "2026-10-13",
"statTables": ["points-per-game", "offensive-efficiency"],
"threadCount": 8
}'

Apify waits up to 5 minutes for the first byte of a Standby response. Choosing a run can take part of that time when a new run has to start. The Actor then retries each failed page 3 times, with a 30-second timeout per attempt.

Only one scrape runs inside a Standby process at a time. A second request waits for the first. The Actor's Standby settings, as published on 18 October 2026, allow up to 4 concurrent requests per run and stop a run after 300 idle seconds. Those platform settings can be changed in Console.

A normal Console start still works. It does not stay running as a web server.

Pricing

The Actor uses Apify pay-per-event pricing. These are the event prices on the newest pricing record retrieved from the Actor on 18 October 2026. Confirm them on the Actor's pricing tab before a large run. They are not a permanent quote.

EventConfigured priceWhen it applies
Result$0.003One default-dataset item.
Actor start$0.10Once per gigabyte of allocated memory, with a minimum of one event.

The default run memory is 1,024 MB, so a default start is one Actor-start event, or $0.10, plus result events. Raising memory can raise the start charge because the event is defined per GB.

Apify also bills platform usage for the memory and time the run consumes. That amount depends on your Apify plan and is not included in the table above.

Illustrative result math, using the verified 30-team page as the row count:

RunDataset rowsResult eventsActor start at 1 GBEvent subtotal
1 day, 1 table3030 × $0.003$0.10$0.19
1 day, all 147 tables, if every table has 30 teams4,4104,410 × $0.003$0.10$13.33

Some tables may not return 30 teams. Add platform usage on top. A multi-day full extract multiplies the page count by the number of days.

Standby runs are billed as runs: platform usage continues until the run exits or sits idle past the idle timeout, and an Actor-start event can apply when that run starts. The Standby handler returns JSON directly and does not push those rows to the dataset, so those HTTP rows are not dataset result events in the current code.

There is no free unlimited plan in this Actor.

Practical use cases

  • Team dashboards. Request points-per-game for a date range and chart season, last 3, home, and away.
  • Historical snapshots. Store one day per run and keep date as the snapshot key.
  • Fantasy research. Pull shooting, rebounding, assists, and the matching opponent- tables for the same date.
  • Offense against defense. Compare offensive-efficiency with defensive-efficiency for the same teams.
  • Recent form against the season. On one row, compare start_year_season with last_3 and last_1.
  • PostgreSQL. Export CSV or JSON from the dataset and load it with your own COPY or insert job. This Actor does not connect to a database.
  • Python applications. Call the Actor with apify-client, or call GET /stats from Standby.
  • Scheduled pipelines. Create an Apify Schedule for a normal run, for example one stat list each morning. Scheduling is an Apify platform feature. It is not a separate setting in the Actor input.

Data source and limitations

All statistics come from public TeamRankings NBA pages. Data Hub and this Actor are not endorsed by, or affiliated with, the NBA or TeamRankings. Team names, season labels, and numbers are reproduced from that site.

  • A date or slug with no table produces no rows. A normal run then fails. Standby returns HTTP 422.
  • A page that still fails after 3 attempts fails the whole run, or returns HTTP 500 in Standby. Partial pages already downloaded are not saved when that happens.
  • Cells can be null when TeamRankings leaves them blank.
  • The site controls freshness. last_update is only the scrape date.
  • Team names follow the source, including short names such as Okla City.
  • Large ranges increase runtime, the chance of a failed page, and the result-event cost.
  • The default run timeout published for this Actor is 900 seconds, with 1,024 MB of memory.
  • Standby does not accept more than one scrape at a time inside one process.
  • This Actor does not cover player stats, injuries, odds, or game predictions.

Frequently asked questions

Does this Actor support historical NBA statistics?

Yes, for dates you pass as YYYY-MM-DD, when TeamRankings still serves that page. The Actor does not keep its own historical archive.

Can I select specific statistics?

Yes. Select one or more slugs in statTables. Select all for the 147 default tables.

How many categories are available?

The dropdown lists 147 slugs plus all. A slug that is not in that list is rejected.

Can I export results to CSV or JSON?

Yes, from the dataset of a normal run. Apify Console can download JSON, CSV, Excel, XML, and the other dataset formats it currently provides. Standby responses are JSON only.

Can I use the Actor through an API?

Yes. Start a run with the Apify API, or call the Standby hostname with a Bearer token.

Can I schedule daily data extraction?

Yes. Use an Apify Schedule on a normal run. The Actor input has no schedule field of its own.

How much does one run cost?

At the prices retrieved on 18 October 2026, budget $0.003 per dataset row and $0.10 per Actor start at the default 1 GB, plus Apify platform usage. Check the pricing tab, because those event prices are configuration and can change.

What happens if data is unavailable?

The Actor retries a failed download 3 times. If the pages load but contain no team rows, the normal run fails with an error and Standby returns 422. Nothing is silently filled in.

Can I integrate the data into dashboards?

Yes. Filter the dataset on date, team, and records_table, or call /stats and read the JSON array. The Actor does not host a dashboard.

Try it

Open NBA Team Rankings & Trends API, run one day and one stat table, and inspect the dataset before you launch a full 147-table extract.

From there you can export the rows, call the Apify API, or use the Standby /stats endpoint in your own application. If something does not match this page, report it on the Actor's Issues tab.