# TheSportsDB Scraper - Teams, Players & Data (`benthepythondev/thesportsdb-scraper`) Actor

Search TheSportsDB for sports teams or players by name and get structured data: name, sport, league, country, stadium, formed year, social links, badge/thumbnail and description. Fast and reliable via the public TheSportsDB API. For sports data, fan apps, dashboards and datasets.

- **URL**: https://apify.com/benthepythondev/thesportsdb-scraper.md
- **Developed by:** [Ben](https://apify.com/benthepythondev) (community)
- **Categories:** Videos, Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## ⚽ TheSportsDB Scraper

Search **TheSportsDB** for sports **teams** or **players** by name and get clean, structured data — name, sport, league, country, stadium, formed year, social links, badge/thumbnail and description. Powered by the public TheSportsDB API, so it's fast and reliable: no browser, no login, no API key.

Built for sports data products, fan apps, dashboards and datasets. Export to JSON/CSV/Excel, run on a schedule, call via API, or connect to Make, Zapier or n8n.

### 🔎 What is the TheSportsDB Scraper?

Give it team or player names (e.g. "Arsenal", "Lionel Messi") and it returns matching records as structured rows — switch between teams and players with one setting.

#### What data does it extract?

- **Name** (and alternate names) and **sport**
- **League** and **country**
- **Stadium**, capacity and location (teams)
- **Formed year** / birth date and position (players)
- **Social links** (website, Facebook, Twitter, Instagram)
- **Badge / thumbnail** image
- **Description**

### ⬇️ Input

| Field | Type | Description |
|-------|------|-------------|
| `searchTerms` | array | Team or player names, e.g. `Arsenal`. |
| `searchType` | string | `team` or `player`. |

#### Example input

```json
{
  "searchTerms": ["Arsenal", "Real Madrid"],
  "searchType": "team"
}
````

### ⬆️ Output

One record per team:

```json
{
  "type": "team",
  "id": "133604",
  "name": "Arsenal",
  "sport": "Soccer",
  "league": "English Premier League",
  "country": "England",
  "formed_year": "1886",
  "stadium": "Emirates Stadium",
  "stadium_capacity": "60272",
  "website": "www.arsenal.com",
  "twitter": "twitter.com/arsenal",
  "badge": "https://.../badge.png",
  "description": "Arsenal Football Club is a professional football club...",
  "query": "Arsenal"
}
```

### 💡 Use cases

- ⚽ **Sports apps** — enrich teams and players with metadata and images.
- 📊 **Dashboards** — build league and team datasets.
- 🗂️ **Catalogs** — assemble a structured sports database.
- 🤖 **LLM / app pipelines** — feed structured sports data into your tools.

### 📈 Why scrape TheSportsDB?

Sports data is valuable when you need quick, structured enrichment without building a full sports database yourself. TheSportsDB provides team and player metadata across many sports, including names, leagues, countries, stadiums, images and social links. That is enough for many fan apps, internal dashboards, content sites, newsletters, trivia products and LLM tools.

Instead of manually copying team badges, stadium names or player summaries, you can pass a list of names and receive normalized rows. This is useful for prototyping sports products, cleaning messy spreadsheets, enriching a CMS, preparing seed data for an app, or adding context to match schedules and sports-news feeds.

### 🔁 Automation workflow

Use the actor as an enrichment step. First collect team names from fixtures, news articles, league tables or your own database. Then run this scraper with `searchType` set to `team` and merge the returned badge, country, league, stadium and social fields into your system. For player-focused workflows, switch to `player` and enrich rosters, fantasy tools or editorial databases.

For scheduled workflows, refresh the same list weekly or monthly. Team metadata does not change every hour, but badges, descriptions, websites and social handles can change over time. A scheduled run keeps your application data current without expensive API development.

### ✅ Data quality notes

The actor calls TheSportsDB's public API and normalizes the response into stable fields. Some searches can return multiple matches, especially for common player names or clubs with similar names. Use exact names where possible and keep the `query` field so you can trace each output row back to the input that produced it. If a field is not available from the source, it is returned as null instead of being guessed.

### ❓ FAQ

**Do I need an API key or login?** No — it uses the public TheSportsDB API.

**Teams and players?** Yes — set `searchType`.

**Which sports?** Many — soccer, basketball, American football, motorsport and more.

**Do I get images?** Yes — team badges and player thumbnails.

**Are social links included?** Yes — website and social profiles for teams.

**How does pricing work?** Pay per result returned. No subscription.

**Is it legal?** It uses the public TheSportsDB API. Use responsibly and within their terms.

### ⚙️ How it works

The scraper calls the TheSportsDB API directly and returns clean rows — no browser and no key. It looks up each team or player by name and normalizes the response into consistent fields, so you get a tidy table instead of raw JSON. Runs are fast and dependable, which is why the actor keeps passing its daily health check. The same input shape works for one lookup or a long list of names.

### 👥 Who uses sports data?

Sports data is valuable to app developers, media teams, analysts and fan communities. A developer enriches a fantasy app with team metadata; a media site pulls badges and descriptions; an analyst builds a league dataset; a bot feeds structured data into a chat experience. Because every record is plain JSON with consistent fields, it drops straight into a spreadsheet, database, BI tool or LLM pipeline with no custom parsing.

### 📤 Export, schedule & integrate

Every run is saved to a dataset you can export to **JSON, CSV, Excel, XML or RSS**, or pull through the **Apify API**. Wire it into **Make, Zapier, n8n, Google Sheets, Slack** or your **own database**, run it on a **schedule** to keep your data fresh, and call it from AI agents through the **Apify MCP server**.

### 💡 Tips for best results

- Use exact team names for the best matches.
- Switch `searchType` to `player` to enrich rosters.
- Schedule runs to refresh badges and descriptions.
- Combine many names in one run to build a dataset fast.

### ❓ More FAQ

**How fresh is the data?** It is fetched live on each run.

**Can I run it automatically?** Yes — use Apify Schedules (cron).

**Which export formats?** JSON, CSV, Excel, XML and RSS, plus the Apify API.

**Can AI agents use it?** Yes — via the Apify API and MCP server.

### 🔗 You might also like

- [TV Shows Scraper](https://apify.com/benthepythondev/tvmaze-tv-shows-scraper) — TV series & episodes.
- [Deezer Scraper](https://apify.com/benthepythondev/deezer-scraper) — tracks, artists & albums.
- [Steam Games Scraper](https://apify.com/benthepythondev/steam-games-scraper) — game prices & metadata.

***

**Keywords:** thesportsdb scraper, sports data, sports api, team data, player data, football data, soccer api, sports database, league data, fan apps, sports metadata, team badges, sports dataset, sports scraper

# Actor input Schema

## `searchTerms` (type: `array`):

Team or player names, e.g. 'Arsenal', 'Lionel Messi'.

## `searchType` (type: `string`):

Teams or players.

## Actor input object example

```json
{
  "searchTerms": [
    "Arsenal"
  ],
  "searchType": "team"
}
```

# 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 = {
    "searchTerms": [
        "Arsenal"
    ],
    "searchType": "team"
};

// Run the Actor and wait for it to finish
const run = await client.actor("benthepythondev/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 = {
    "searchTerms": ["Arsenal"],
    "searchType": "team",
}

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

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

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

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "Arsenal"
  ],
  "searchType": "team"
}' |
apify call benthepythondev/thesportsdb-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=benthepythondev/thesportsdb-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TheSportsDB Scraper - Teams, Players & Data",
        "description": "Search TheSportsDB for sports teams or players by name and get structured data: name, sport, league, country, stadium, formed year, social links, badge/thumbnail and description. Fast and reliable via the public TheSportsDB API. For sports data, fan apps, dashboards and datasets.",
        "version": "1.0",
        "x-build-id": "YyJtJ6o6ndfOQLVBX"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/benthepythondev~thesportsdb-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-benthepythondev-thesportsdb-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/benthepythondev~thesportsdb-scraper/runs": {
            "post": {
                "operationId": "runs-sync-benthepythondev-thesportsdb-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/benthepythondev~thesportsdb-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-benthepythondev-thesportsdb-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searchTerms": {
                        "title": "Search terms",
                        "type": "array",
                        "description": "Team or player names, e.g. 'Arsenal', 'Lionel Messi'.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "searchType": {
                        "title": "Search type",
                        "enum": [
                            "team",
                            "player"
                        ],
                        "type": "string",
                        "description": "Teams or players.",
                        "default": "team"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
