# Sports Data Scraper — Live Scores, Stats & Schedules (`sian.agency/sports-data-scraper`) Actor

Sports data scraper covering 30+ sports — football, basketball, tennis, F1, MMA, esports. Live scores, fixtures, results, league standings, match lineups, statistics and odds, team squads, transfers and player profiles. 15 operations, one clean dataset per run. No API key.

- **URL**: https://apify.com/sian.agency/sports-data-scraper.md
- **Developed by:** [SIÁN OÜ](https://apify.com/sian.agency) (community)
- **Categories:** Sports, Developer tools, Business
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Sports Data Scraper — Live Scores, Stats & Schedules 🚀

[![SIÁN Agency Store](https://img.shields.io/badge/Store-SI%C3%81N%20Agency-1AE392)](https://apify.com/sian.agency?fpr=sian) [![Instagram AI Transcript Extractor](https://img.shields.io/badge/Store-Instagram%20AI%20Transcript%20Extractor-E4405F)](https://apify.com/sian.agency/instagram-ai-transcript-extractor?fpr=sian) [![TikTok AI Transcript Extractor](https://img.shields.io/badge/Store-TikTok%20AI%20Transcript%20Extractor-25F4EE)](https://apify.com/sian.agency/best-tiktok-ai-transcript-extractor?fpr=sian) [![Smart Idealista Scraper](https://img.shields.io/badge/Store-Smart%20Idealista%20Scraper-1AE392)](https://apify.com/sian.agency/smart-idealista-scraper?fpr=sian)

#### ⚽ Extract live sports data from 30+ sports — football, basketball, tennis, F1, MMA, esports. 15 operations, one clean dataset per run.

##### Perfect for sports analysts, fantasy sports developers, betting researchers, and data scientists who need structured sports data at scale.

***

### 🔎 What is the Sports Data Scraper — and when should you use it?

The **Sports Data Scraper** turns tournaments, teams, players and matches across 30+ sports into clean, structured rows you can filter, export and feed straight into a spreadsheet, database or AI agent. No account, no portal API key, no browser automation to maintain.

**Use it when you need:** fixtures and results with scores, league tables with home-only and away-only splits, squads, transfers, and team and player profiles. For a single match you get lineups with formations, a minute-by-minute goal and card timeline, per-statistic breakdowns and pre-match odds by market. Live scores cover what is in play right now in football, basketball, tennis, ice hockey, MMA and motorsport.

**Use something else when:** you want one sport covered in depth. Use [Football API Scraper](https://apify.com/sian.agency/football-api-scraper?fpr=sian) for 18 football-only operations, with expected goals, squad market values and contract-end dates. Use [Basketball API Scraper](https://apify.com/sian.agency/basketball-api-scraper?fpr=sian) for basketball box scores with points, rebounds, assists and plus-minus, plus conference standings. Use [Tennis Point-by-Point Scraper](https://apify.com/sian.agency/tennis-point-by-point-scraper?fpr=sian) for every point of a tennis match in play order, plus the match and set statistics. Use [Sports Betting Odds Scraper](https://apify.com/sian.agency/sports-betting-odds-scraper?fpr=sian) for moneyline, spread and totals lines from 8+ bookmakers side by side. Live scores here run on football, basketball, tennis, ice hockey, MMA and motorsport. Other sports still work for tournament search, fixtures, tables and match detail.

### 🤖 Use with AI agents

Already connected to the [Apify MCP server](https://mcp.apify.com)? Just ask for this Actor by name: sian.agency/sports-data-scraper

**Your agent can pay for its own runs.** This Actor is eligible for [agentic payments](https://docs.apify.com/platform/actors/publishing/monetize), so an agent can discover it, run it and settle the bill over [x402](https://www.x402.org/) (USDC on Base) or [Skyfire](https://www.skyfire.xyz/) — without an Apify account or API token of its own. Billing is the same either way: per successful row, never for errors.

Otherwise copy this prompt into Claude, ChatGPT, Cursor or any MCP-enabled assistant:

```text
I want structured data across 30+ sports using the Apify Actor `sian.agency/sports-data-scraper`.

Use it when I need: fixtures and results with scores, league tables with home-only and away-only splits, squads, transfers, and team and player profiles. For a single match you get lineups with formations, a minute-by-minute goal and card timeline, per-statistic breakdowns and pre-match odds by market. Live scores cover what is in play right now in football, basketball, tennis, ice hockey, MMA and motorsport.

Don't use it when: you want one sport covered in depth — use football-api-scraper or basketball-api-scraper or tennis-point-by-point-scraper or sports-betting-odds-scraper instead.

How to call it: set `operation` to one of
  searchTournaments -> needs `query` (a competition name), returns Tournament IDs
  tournamentSeasons -> needs `tournamentId`, returns Season IDs
  seasonEvents      -> needs `tournamentId` + `seasonId`, paginated with `page` and `maxPages`
  standings         -> needs `tournamentId` + `seasonId` (+ `standingsType`: "total", "home" or "away")
  teamDetails       -> needs `teamId`
  teamSquad         -> needs `teamId`
  teamTransfers     -> needs `teamId`
  teamEvents        -> needs `teamId`, paginated
  playerDetails     -> needs `playerId`
  matchDetails / matchIncidents / matchLineups / matchStatistics / matchOdds
                    -> each needs `eventId`, taken from any seasonEvents, teamEvents or liveScores row
  liveScores        -> needs `sport`: "football", "basketball", "tennis", "ice-hockey", "mma" or "motorsport".

Start with this input:
{
  "operation": "searchTournaments",
  "query": "Premier League"
}

Ask me which sport and competition I care about, and whether I want fixtures, a league table, or one match in detail, then run the Actor and summarise the results as a table.
```

**Things you can ask your agent for:**

- *Find the Serie A tournament ID, pull this season's fixtures, and list every match that ended in a draw.*
- *Take this match ID and give me the lineups, the goal and card timeline, and the full match statistics.*
- *Show me which basketball games are in play right now and what the scores are.*

Machine-readable API, MCP config and OpenAPI definition for this Actor are published at [apify.com/sian.agency/sports-data-scraper.md](https://apify.com/sian.agency/sports-data-scraper.md).

### 📋 Overview

**Sports Data Scraper is your all-in-one sports data pipeline.** No API key management, no complex integrations — pick an operation, provide IDs, and get clean structured data instantly. Covers football (soccer), basketball, tennis, Formula 1, MMA, esports, and 25+ more sports.

**Why professionals choose us:**

- ✅ **30+ Sports Covered**: Football, basketball, tennis, F1, MMA, esports, cricket, rugby, and more
- ⚡ **15 Operations**: Tournaments, seasons, fixtures, league tables, squads, transfers, player and team profiles, plus match detail, lineups, incidents, statistics, odds and live scores
- 🎯 **Clean Structured Data**: Every row comes with curated camelCase fields + raw upstream data
- 💰 **Pay-Per-Result**: Only charged for successful extractions — errors are free
- 💎 **No API Key Needed**: We handle the upstream — just configure and run
- 🔄 **Pagination Built-In**: Automatically fetches multiple pages for events and match history

### ✨ Features

- 🔍 **Tournament Search**: Find any tournament across 30+ sports by keyword
- 📅 **Season Discovery**: Browse all seasons within a tournament
- ⚽ **Match Events**: Extract full match schedules with scores, teams, and status
- 🏅 **Team Profiles**: Get detailed team info — name, country, sport, logos
- 🏟️ **Team Match History**: Paginated match history for any team
- 👤 **Player Profiles**: Extract player details — name, position, nationality, team
- 📄 **Smart Pagination**: Automatically fetch multiple pages with configurable limits
- 🔁 **Auto-Retry**: Exponential backoff on transient errors (429, 502, 503, 504)
- 📊 **HTML Reports**: Every run generates a visual summary report
- 📥 **Multiple Exports**: JSON, CSV, Excel — export directly from Apify dataset

### 🎬 Quick Start

Extract sports data in three simple steps. No configuration needed.

```bash
## Search for tournaments
curl -X POST https://api.apify.com/v2/acts/sian.agency~sports-data-scraper/runs?token=[YOUR_TOKEN] \
-d '{"operation":"searchTournaments","query":"Premier League"}'
```

### 🚀 Getting Started (3 Simple Steps)

#### Step 1: Choose Your Operation

Select from 15 operations. Start with searchTournaments if you have no IDs yet — every other operation takes an ID that an earlier call returns.

#### Step 2: Provide IDs or Keywords

Use tournament names for search, or IDs (from previous runs) for detailed lookups. IDs chain naturally: search → seasons → events → teams → players.

#### Step 3: Run and Download

Get clean structured data in seconds. Export as JSON, CSV, or Excel directly from the Apify dataset.

**That's it! In under 10 seconds, you'll have:**

- Tournament listings with sport and category data
- Season histories with year and name
- Match events with scores, teams, timestamps, and round info
- Team profiles with country, short name, and logos
- Player profiles with position, nationality, and team affiliation

***

### 📥 Input Configuration

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | string | Yes | Data extraction operation to run |
| query | string | For searchTournaments | Search keyword for finding tournaments |
| tournamentId | integer | For tournamentSeasons, seasonEvents | Tournament ID from search results |
| seasonId | integer | For seasonEvents | Season ID from tournamentSeasons results |
| teamId | integer | For teamDetails, teamEvents | Team ID from seasonEvents results |
| playerId | integer | For playerDetails | Player ID from teamDetails results |
| eventId | integer | For all match\* operations | Match ID from seasonEvents, teamEvents or liveScores |
| standingsType | string | No | Which league table for standings: total, home or away (default: total) |
| sport | string | No | Which sport liveScores returns (default: football) |
| page | integer | No | Starting page for paginated ops (default: 0) |
| maxPages | integer | No | Max pages to fetch for paginated ops (default: 5, max: 50) |

**Operations:**

| Operation | Description | Required Input |
|-----------|-------------|----------------|
| searchTournaments | Search tournaments by keyword | `query` |
| tournamentSeasons | List seasons for a tournament | `tournamentId` |
| seasonEvents | Match events for a tournament season (paginated) | `tournamentId`, `seasonId` |
| teamDetails | Team profile | `teamId` |
| teamEvents | Team match history (paginated) | `teamId` |
| playerDetails | Player profile | `playerId` |
| standings | League table, total/home/away | `tournamentId`, `seasonId` |
| teamSquad | Squad list for a team | `teamId` |
| teamTransfers | Transfers in and out | `teamId` |
| matchDetails | One match, full detail | `eventId` |
| matchLineups | Confirmed lineups and formations | `eventId` |
| matchIncidents | Goals, cards and substitutions minute by minute | `eventId` |
| matchStatistics | Match statistics, split by half | `eventId` |
| matchOdds | Pre-match odds | `eventId` |
| liveScores | Every match in play right now | nothing |

**Example — Search Tournaments:**

```json
{
  "operation": "searchTournaments",
  "query": "Premier League"
}
```

**Example — Season Events (paginated):**

```json
{
  "operation": "seasonEvents",
  "tournamentId": 17,
  "seasonId": 52186,
  "maxPages": 3
}
```

**Example — Player Details:**

```json
{
  "operation": "playerDetails",
  "playerId": 336579
}
```

***

### 📤 Output

Results are saved to the Apify dataset with **20+ fields** per row including:

| Field | Type | Description |
|-------|------|-------------|
| tournamentId | integer | Unique tournament identifier |
| tournamentName | string | Tournament/competition name |
| seasonId | integer | Season identifier |
| seasonName | string | Season name (e.g. "2024/2025") |
| eventId | integer | Match/event identifier |
| eventName | string | Match/event name |
| startTime | integer | Match start time (Unix timestamp) |
| homeTeam | object | Home team details (id, name, shortName, slug) |
| awayTeam | object | Away team details (id, name, shortName, slug) |
| homeScore | integer | Home team score |
| awayScore | integer | Away team score |
| matchStatus | object | Match status details |
| teamId | integer | Team identifier |
| teamName | string | Team name |
| teamCountry | object | Country info |
| playerId | integer | Player identifier |
| playerName | string | Player name |
| playerPosition | string | Playing position |
| \_operation | string | Operation that produced this row |
| \_fetchedAt | string | ISO timestamp |
| status | string | Row status: "success" or "error" |

**Example — Search Tournaments output:**

```json
{
  "tournamentId": 17,
  "tournamentName": "Premier League",
  "tournamentSlug": "premier-league",
  "sport": { "name": "Football", "slug": "football" },
  "category": { "name": "England", "slug": "england" },
  "_operation": "searchTournaments",
  "_fetchedAt": "2026-05-28T00:10:00.000Z",
  "status": "success"
}
```

**Example — Season Events output:**

```json
{
  "eventId": 12345678,
  "eventName": "Arsenal vs Chelsea",
  "startTime": 1748395200,
  "homeTeam": { "id": 42, "name": "Arsenal", "shortName": "ARS" },
  "awayTeam": { "id": 38, "name": "Chelsea", "shortName": "CHE" },
  "homeScore": 2,
  "awayScore": 1,
  "matchStatus": { "type": "finished" },
  "roundInfo": { "round": 28 },
  "_operation": "seasonEvents",
  "_fetchedAt": "2026-05-28T00:12:00.000Z",
  "status": "success"
}
```

***

### 💼 Use Cases & Examples

#### 1. 🏆 Sports Analytics Dashboard

**Build real-time analytics dashboards for 30+ sports leagues worldwide.**

**Input:** Tournament search → season events (paginated)
**Output:** Match results, scores, team performance data, round info
**Use:** Feed live data into Tableau, Power BI, or custom dashboards for league-wide performance tracking.

#### 2. 🎯 Fantasy Sports Data Feed

**Power fantasy sports platforms with up-to-date player and team data.**

**Input:** Player details + team match history (paginated)
**Output:** Player positions, nationalities, team affiliations, historical match data
**Use:** Calculate player form, fixture difficulty, and team strength metrics for fantasy scoring models.

#### 3. 📊 Betting Odds Research

**Gather historical match results and team form for betting analysis.**

**Input:** Season events (multiple pages) + team events
**Output:** Historical scores, home/away performance, round-by-round results
**Use:** Build predictive models with historical performance data across leagues and tournaments.

#### 4. 📰 Live Score Aggregation

**Build live score aggregation services across multiple sports.**

**Input:** Season events for multiple tournaments
**Output:** Match status, scores, start times, team details
**Use:** Aggregate live match data from football, basketball, tennis, F1, and more into a unified feed.

#### 5. 🗄️ Team & Player Database

**Build comprehensive databases of teams and players across sports.**

**Input:** Team details + player details (chained from search results)
**Output:** Team names, countries, logos, player positions, nationalities
**Use:** Populate a sports encyclopedia or directory with structured data from 30+ sports.

#### 6. 📈 League Season Analysis

**Track full season progression — fixtures, results, and standings data.**

**Input:** Tournament seasons → season events (max pages: 50)
**Output:** Complete fixture list with scores, round numbers, timestamps
**Use:** Analyze season patterns, identify upset trends, and track title races across leagues.

***

### 🔗 Integration Examples

#### JavaScript/Node.js

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

const client = new ApifyClient({ token: 'YOUR_TOKEN' });

// Search for tournaments
const run = await client.actor('sian.agency/sports-data-scraper').call({
  operation: 'searchTournaments',
  query: 'Premier League'
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_TOKEN')

## Get season events (paginated)
run = client.actor('sian.agency/sports-data-scraper').call(
    run_input={
        'operation': 'seasonEvents',
        'tournamentId': 17,
        'seasonId': 52186,
        'maxPages': 3
    }
)

for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(item)
```

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/sian.agency~sports-data-scraper/runs?token=YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"operation": "searchTournaments", "query": "Champions League"}'
```

#### Automation Workflows (N8N / Zapier / Make)

1. **Trigger**: Schedule (daily/hourly) or webhook
2. **HTTP Request**: Call actor API with operation + IDs
3. **Process**: Handle JSON results — filter, transform, enrich
4. **Action**: Save to database, send notifications, update dashboards

***

### 📊 Performance & Pricing

#### FREE Tier (Try It Now)

- Full feature access — all 15 operations available
- Test with real data, same quality as paid
- No credit card required
- Perfect for evaluation and small projects

#### PAID Tier (Production Ready)

- **Unlimited** results per run with pagination
- Pay-per-result: only charged for successful extractions
- Faster processing, no rate limits
- Priority support

💰 **Transparent pricing — only pay for successful results**

🔗 [View current pricing](https://apify.com/sian.agency/sports-data-scraper?fpr=sian)

***

### ❓ Frequently Asked Questions

**Q: How many results can I extract per run?**
A: Paginated operations (seasonEvents, teamEvents) support up to 50 pages per run. Single-result operations (teamDetails, playerDetails) return one detailed result per run.

**Q: Which sports are covered?**
A: 30+ sports including football (soccer), basketball, tennis, Formula 1, MMA, esports, cricket, rugby, handball, volleyball, baseball, ice hockey, and more.

**Q: What output formats are available?**
A: JSON, CSV, Excel — export directly from the Apify dataset. All formats include the same structured fields.

**Q: How do I find tournament/team/player IDs?**
A: Chain operations naturally: searchTournaments → tournamentSeasons → seasonEvents → teamDetails → playerDetails. Each operation's output contains the IDs needed for the next.

**Q: Do I need an API key?**
A: No. The actor handles upstream authentication. Just configure your Apify token and run.

**Q: Is historical data available?**
A: Yes. Use seasonEvents to get past match results and teamEvents for historical team performance.

***

### 🐛 Troubleshooting

**"No tournaments found" error**

- Try broader search terms (e.g., "Premier" instead of "Premier League 2024/2025")
- Check spelling of tournament names
- Some regional tournaments may use local language names

**"Team/Player not found" error**

- Verify the ID is correct — get IDs from seasonEvents or teamDetails outputs
- The ID may refer to a delisted or inactive entity

**Empty results on paginated operations**

- The season or team may have no upcoming events — try a different season
- Some tournaments only have events during their active season

***

### ⚖️ Is it legal to scrape data?

Our actors are ethical and do not extract any private user data. They only extract publicly available sports data — tournament schedules, match results, team rosters, and player statistics. We believe our actors, when used for ethical purposes, are safe to use.

However, you should be aware that your results could contain personal data. Personal data is protected by the **GDPR** in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

You can also read Apify's blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

***

### 🤝 Support

[![Telegram Support](https://img.shields.io/badge/Telegram-Support%20Group-0088cc?logo=telegram)](https://t.me/+vyh1sRE08sAxMGRi)

**Join our active support community**

- For issues or questions, open an issue in the actor's repository
- Check [SIÁN Agency Store](https://apify.com/sian.agency?fpr=sian) for more automation tools
- ✉️ <apify@sian-agency.online>

***

**Built by [SIÁN Agency](https://www.sian-agency.online)** | **[More Tools](https://apify.com/sian.agency?fpr=sian)**

# Actor input Schema

## `operation` (type: `string`):

Which dataset to pull. One operation per run. searchTournaments: find a tournament by name. tournamentSeasons: its seasons. seasonEvents: fixtures/results. teamDetails / teamEvents / teamSquad / teamTransfers: club data. playerDetails: one player. standings: league table. matchDetails / matchIncidents / matchLineups / matchStatistics / matchOdds: one match, by eventId. liveScores: everything in play right now for one sport.

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

🔍 Search keyword for finding tournaments. Required for searchTournaments operation.

## `tournamentId` (type: `integer`):

🏆 The unique-tournament ID (use searchTournaments to find it). Required for tournamentSeasons and seasonEvents.

## `seasonId` (type: `integer`):

📅 The season ID within a tournament. Required for seasonEvents. Use tournamentSeasons to discover available seasons.

## `teamId` (type: `integer`):

🏅 The team ID. Required for teamDetails and teamEvents operations. Find team IDs from seasonEvents results.

## `playerId` (type: `integer`):

👤 The player ID. Required for playerDetails operation. Find player IDs from teamDetails results.

## `page` (type: `integer`):

📄 Page number for paginated results (seasonEvents, teamEvents). Default: 0.

## `maxPages` (type: `integer`):

📄 Maximum number of pages to fetch for paginated operations. Default: 5, max: 50.

## `eventId` (type: `integer`):

Match ID for the match\* operations. Get one from seasonEvents, teamEvents or liveScores (the `eventId` field). Example: 12436564.

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

Which sport to return live matches for. Only used by the liveScores operation. Example: football.

## `standingsType` (type: `string`):

Which league table to return. Only used by the standings operation. Example: total.

## Actor input object example

```json
{
  "operation": "searchTournaments",
  "query": "Premier League",
  "page": 0,
  "maxPages": 5,
  "eventId": 12436564,
  "sport": "football",
  "standingsType": "total"
}
```

# Actor output Schema

## `output` (type: `string`):

Tournaments, seasons, events, teams, or player profiles — one flat row per upstream item with curated camelCase fields plus the raw upstream data spread alongside.

## `report` (type: `string`):

HTML report with run status, success/error row counts, success rate, pages fetched, duration, and the inputs used — written even on fatal crash.

# 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 = {
    "query": "Premier League",
    "eventId": 12436564,
    "sport": "football",
    "standingsType": "total"
};

// Run the Actor and wait for it to finish
const run = await client.actor("sian.agency/sports-data-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 = {
    "query": "Premier League",
    "eventId": 12436564,
    "sport": "football",
    "standingsType": "total",
}

# Run the Actor and wait for it to finish
run = client.actor("sian.agency/sports-data-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 '{
  "query": "Premier League",
  "eventId": 12436564,
  "sport": "football",
  "standingsType": "total"
}' |
apify call sian.agency/sports-data-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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