# TheSportsDB Scraper (`aurenic/thesportsdb-scraper`) Actor

Extract teams, players, leagues, events, venues, and standings from TheSportsDB multi-sport database. 50+ leagues across Soccer, NFL, NBA, NHL, MLB, F1, MMA. Free public API.

- **URL**: https://apify.com/aurenic/thesportsdb-scraper.md
- **Developed by:** [Aurenic](https://apify.com/aurenic) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## TheSportsDB Scraper

Extract teams, players, leagues, events, venues, and standings from TheSportsDB multi-sport database. 50+ leagues across Soccer, NFL, NBA, NHL, MLB, F1, MMA. Free public API.

### What does TheSportsDB Scraper do?

Scrape TheSportsDB's community-driven multi-sport database in 20 modes covering every public endpoint:

- **Teams** — search by name, lookup by ID, or list all players for a team.
- **Players** — search by name, or lookup by ID.
- **Leagues** — list all leagues, lookup by ID, or filter by country and sport.
- **Events** — events by date, next/last events for a team, next/past events for a league, full season schedules, by round, or lookup by ID.
- **Standings** — league table for any supported league and season.
- **Reference** — all sports, all countries, venue lookup.

TheSportsDB exposes all of this through a **free public REST API**. The demo key `3` requires no signup and works for testing and small-volume runs. A premium key from thesportsdb.com raises rate limits and unlocks live scores.

### Output fields

#### Team

| Field | Description |
|---|---|
| teamId | TheSportsDB team ID |
| team / teamAlternate / teamShort | Name fields |
| sport / league / leagueId | Classification |
| formedYear / stadium / stadiumCapacity | Club info |
| stadiumLocation / country | Location |
| website / facebook / twitter / instagram / youtube | Social links |
| description | Club history (EN) |
| badge / logo / banner / fanart | Media |

#### Player

| Field | Description |
|---|---|
| playerId | TheSportsDB player ID |
| player / playerAlternate | Name fields |
| team / teamId / team2 | Club affiliation |
| sport / nationality / position / side | Classification |
| birthDate / birthLocation | Personal |
| dateSigned / signing / wage / agent | Contract |
| number / height / weight | Physical |
| description | Biography (EN) |
| thumb / cutout / render | Media |

#### Event

| Field | Description |
|---|---|
| eventId / event / eventAlternate | Identity |
| sport / league / season / round | Classification |
| homeTeam / awayTeam (with IDs and badges) | Teams |
| homeScore / awayScore / spectators | Result |
| date / dateLocal / time / timestamp | Schedule |
| venue / city / country | Location |
| status / postponed | State |
| video / thumb / poster / banner | Media |

#### League, Table row, Sport, Country, Venue

Full normalized records with all public fields.

### Who is it for?

- **Sports apps and fan sites** building team and fixture catalogs
- **Fantasy sports platforms** pulling rosters, schedules, and results
- **Betting and odds tools** sourcing historical match data
- **Data journalists** analyzing league standings and player transfers
- **Research and analytics** teams building multi-sport datasets

### Pricing

**$0.60 per 1,000 results.** No subscription.

| Results | Cost |
|---|---|
| 100 | $0.06 |
| 1,000 | $0.60 |
| 10,000 | $6.00 |

### How to use it

1. Pick a **Mode**.
2. Fill in the mode's inputs (query, teamId, leagueId, season, date, etc.).
3. Optionally replace **API Key** with a premium key for higher limits.
4. Set **Max Items** (default 500).
5. Click **Start**.

### Output example

```json
{
  "recordType": "team",
  "teamId": "133604",
  "team": "Arsenal",
  "teamShort": "ARS",
  "sport": "Soccer",
  "league": "English Premier League",
  "leagueId": "4328",
  "formedYear": 1892,
  "stadium": "Emirates Stadium",
  "stadiumCapacity": 60338,
  "stadiumLocation": "Holloway, London, England",
  "country": "England",
  "website": "www.arsenal.com",
  "twitter": "twitter.com/arsenal",
  "description": "Arsenal Football Club is a professional football club based in Islington, London...",
  "badge": "https://www.thesportsdb.com/images/media/team/badge/...",
  "logo": "https://www.thesportsdb.com/images/media/team/logo/...",
  "scrapedAt": "2026-09-24T12:00:00.000Z"
}
```

### Technical details

- **Official TheSportsDB v1 API** — `https://www.thesportsdb.com/api/v1/json/{key}/`. Free public key `3` requires no signup\[reference:5].
- **20 modes** covering search, lookup, schedules, season schedules, league tables, and reference data\[reference:6].
- **Rate limit:** 100 requests/minute. The actor defaults to 700ms between requests to stay under\[reference:7].
- **No browser, no proxy** — pure REST JSON.
- **Normalized output** — `str*`, `int*`, `id*` prefixes are flattened to clean field names.
- **Premium key support** — pass your own key for higher limits and live scores.

### Known limits

- **Free key `3` is rate-limited and shared.** ~100 req/min across all users. For production runs, register a premium key at thesportsdb.com.
- **Some premium endpoints are blocked for key 3.** Live scores and video highlights require a paid key. Search, lookup, schedules, and tables work on the free key\[reference:8].
- **Season string format varies by sport.** Soccer uses `2023-2024`; NFL/NBA use `2023` or `2023-2024` depending on the league.
- **League table endpoint only works for soccer-style leagues.** Basketball and American football standings use a different structure.
- **Coverage is community-maintained.** Small leagues and minor competitions may have incomplete data.

### FAQ

**Do I need an API key?** No — key `3` is the public free key. Register at thesportsdb.com for higher limits and premium endpoints.

**Do I need a proxy?** No. Datacenter IPs are accepted.

**What sports are covered?** Soccer, American Football (NFL + NCAA), Basketball (NBA + NCAA), Baseball (MLB), Ice Hockey (NHL), Motorsport (F1, NASCAR, MotoGP), MMA (UFC, Bellator), Rugby, Handball, and more.

**How do I find a league ID?** Use `leagues` mode to list all leagues, or `leaguesByCountry` to filter by country.

**How do I find a team ID?** Use `teams` mode with a team name. The response includes `teamId`, which you can pass to `eventsNextTeam`, `eventsLastTeam`, or `teamLookup`.

**How do I export data?** After a run, go to Storage → Export as JSON, CSV, Excel.

### Support

Open an issue on the Actor's page for bugs or feature requests.

# Actor input Schema

## `mode` (type: `string`):

Which TheSportsDB dataset to fetch.

## `query` (type: `string`):

Search term — team name, player name, or team name for teamPlayers. Used in teams, players, teamPlayers.

## `teamId` (type: `string`):

TheSportsDB team ID (e.g. 133604 for Arsenal). Used in teamLookup, eventsNextTeam, eventsLastTeam.

## `playerId` (type: `string`):

TheSportsDB player ID. Used in playerLookup.

## `leagueId` (type: `string`):

TheSportsDB league ID (e.g. 4328 for English Premier League). Used in leagueLookup, eventsNextLeague, eventsPastLeague, eventsSeason, eventsRound, table.

## `eventId` (type: `string`):

TheSportsDB event ID. Used in eventLookup.

## `venueId` (type: `string`):

TheSportsDB venue ID. Used in venueLookup.

## `season` (type: `string`):

Season string (e.g. 2023-2024). Used in eventsSeason, eventsRound, table.

## `round` (type: `string`):

Round number. Used in eventsRound.

## `date` (type: `string`):

Date in YYYY-MM-DD. Used in eventsByDay.

## `country` (type: `string`):

Country name (e.g. England). Used in leaguesByCountry.

## `sport` (type: `string`):

Sport filter (Soccer, Basketball, American Football, etc.). Used in eventsByDay and leaguesByCountry.

## `apiKey` (type: `string`):

TheSportsDB API key. Default 3 is the free public key (no signup, ~100 req/min). Premium key from thesportsdb.com raises limits.

## `maxItems` (type: `integer`):

Hard cap on records per run.

## `requestDelayMs` (type: `integer`):

Delay between API requests. Free key allows 100 req/min — default 700ms stays under.

## Actor input object example

```json
{
  "mode": "teams",
  "query": "Arsenal",
  "teamId": "",
  "playerId": "",
  "leagueId": "",
  "eventId": "",
  "venueId": "",
  "season": "",
  "round": "",
  "date": "",
  "country": "",
  "sport": "",
  "apiKey": "3",
  "maxItems": 500,
  "requestDelayMs": 700
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("aurenic/thesportsdb-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("aurenic/thesportsdb-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call aurenic/thesportsdb-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,aurenic/thesportsdb-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/hkSpfiFIMJKfNJaaQ/builds/rjvl8TogMocfqf68v/openapi.json
