# ESPNCricinfo APi (`apiguruu/espncricinfo-api-statsguru-scraper`) Actor

The ultimate ESPN Cricinfo scraper and Statsguru API. Programmatically extract live cricket scores, match schedules, scorecards, ball-by-ball updates, and player rankings. Supports direct JSON endpoints and Cricket MCP for AI agents. RESTapi: https://rapidapi.com/matepapava123/api/espncricinfo-api

- **URL**: https://apify.com/apiguruu/espncricinfo-api-statsguru-scraper.md
- **Developed by:** [Mate Papava](https://apify.com/apiguruu) (community)
- **Categories:** Developer tools, Other, News
- **Stats:** 115 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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?

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

## ESPN Cricinfo Scraper - Apify Actor

Scrape cricket data from ESPN Cricinfo including live scores, player stats, team info, rankings, news, and more.

### 🔗 REST API

For a dedicated REST API with instant responses (no actor runs needed), visit:

**[ESPNCricInfo Live API on RapidAPI](https://rapidapi.com/matepapava123/api/espncricinfo-api)**

### Features

- **24 scraping actions** covering all major ESPN Cricinfo data
- **Teams & Players**: Get team lists, player details, search players
- **Live Scores & Matches**: Real-time scores, detailed scorecards
- **Series & Fixtures**: Current, upcoming, and past series
- **Rankings & Stats**: ICC rankings, batting/bowling statistics
- **News**: Cricket news articles and full story content
- **Team Details**: Fixtures, squads, stats, videos, galleries, photos, fan ratings
- **RSS Feeds**: Live scores and team news RSS feeds
- **AI Search**: ESPN's AI-powered cricket search

### Input Parameters

#### Required

| Parameter | Type | Description |
|-----------|------|-------------|
| `action` | string | The scraping action to perform (see Available Actions below) |

#### Action-Specific Parameters

##### Team Parameters

| Parameter | Type | Description | Used By |
|-----------|------|-------------|---------|
| `team_id` | string | Team ID (e.g., '6' for India) | get\_team\_players, get\_team\_details, get\_team\_\* |
| `team_slug` | string | Team slug (e.g., 'india') | get\_team\_players, get\_team\_details, get\_team\_\* |

##### Player Parameters

| Parameter | Type | Description | Used By |
|-----------|------|-------------|---------|
| `player_id` | string | Player ID | get\_player\_details |
| `use_api` | boolean | Use ESPN API instead of scraping (default: true) | get\_player\_details |

##### Search Parameters

| Parameter | Type | Description | Used By |
|-----------|------|-------------|---------|
| `query` | string | Search query string | search\_players, ai\_search |
| `limit` | integer | Max results (1-50, default: 5) | search\_players |
| `tournament` | string | Tournament filter (e.g., 'menstest') | ai\_search |

##### Match Parameters

| Parameter | Type | Description | Used By |
|-----------|------|-------------|---------|
| `match_id` | string | Match ID | get\_match\_details |

##### Series Parameters

| Parameter | Type | Description | Used By |
|-----------|------|-------------|---------|
| `series_id` | string | Series ID | get\_series\_details |
| `series_slug` | string | Series slug | get\_series\_details |
| `status` | string | Filter: 'current', 'upcoming', 'past', 'all' | get\_series |

##### Format & Ranking Parameters

| Parameter | Type | Description | Used By |
|-----------|------|-------------|---------|
| `format` | string | Cricket format: 'test', 'odi', 't20', 't20i' | get\_live\_scores, get\_rankings |
| `ranking_type` | string | 'teams', 'batting', 'bowling', 'all-rounder' | get\_rankings |

##### Statistics Parameters

| Parameter | Type | Description | Used By |
|-----------|------|-------------|---------|
| `stats_type` | string | 'batting', 'bowling', 'team' | get\_stats |
| `stats_format` | string | 'test', 'odi', 't20' | get\_stats |
| `category` | string | Specific category (e.g., 'most-runs') | get\_stats |

##### News Parameters

| Parameter | Type | Description | Used By |
|-----------|------|-------------|---------|
| `story_id` | string | Story ID or slug | get\_story\_details |
| `page` | integer | Page number (default: 1) | get\_news, get\_team\_fan\_ratings |

##### Fan Ratings Parameters

| Parameter | Type | Description | Used By |
|-----------|------|-------------|---------|
| `match_class` | string | Filter: 'tests', 'odis', 't20is', 'all' | get\_team\_fan\_ratings |

### Available Actions

#### Teams & Players

| Action | Description | Required Parameters |
|--------|-------------|---------------------|
| `get_teams` | Get all cricket teams | - |
| `get_team_players` | Get players for a team by format | team\_id |
| `get_player_details` | Get detailed player info and stats | player\_id |
| `search_players` | Search for players | query |

#### Matches

| Action | Description | Required Parameters |
|--------|-------------|---------------------|
| `get_live_scores` | Get live cricket scores | - |
| `get_match_details` | Get full match scorecard | match\_id |

#### Series

| Action | Description | Required Parameters |
|--------|-------------|---------------------|
| `get_series` | Get fixtures/series list | - |
| `get_series_details` | Get series details | series\_id |

#### Rankings & Stats

| Action | Description | Required Parameters |
|--------|-------------|---------------------|
| `get_rankings` | Get ICC rankings | ranking\_type |
| `get_stats` | Get cricket statistics | - |

#### News

| Action | Description | Required Parameters |
|--------|-------------|---------------------|
| `get_news` | Get cricket news articles | - |
| `get_story_details` | Get full article content | story\_id |

#### Team Details

| Action | Description | Required Parameters |
|--------|-------------|---------------------|
| `get_team_details` | Get team home/overview | team\_id, team\_slug |
| `get_team_fixtures` | Get team match schedule | team\_id, team\_slug |
| `get_team_players_list` | Get current squad | team\_id, team\_slug |
| `get_team_stats` | Get team statistics | team\_id, team\_slug |
| `get_team_videos` | Get team videos | team\_id, team\_slug |
| `get_team_squads` | Get historical squads | team\_id, team\_slug |
| `get_team_galleries` | Get photo galleries | team\_id, team\_slug |
| `get_team_photos` | Get team photos | team\_id, team\_slug |
| `get_team_fan_ratings` | Get player fan ratings | team\_id, team\_slug |

#### RSS Feeds

| Action | Description | Required Parameters |
|--------|-------------|---------------------|
| `get_live_scores_rss` | Get live scores RSS feed | - |
| `get_team_news_rss` | Get team-specific news RSS | team\_id |

#### AI Search

| Action | Description | Required Parameters |
|--------|-------------|---------------------|
| `ai_search` | ESPN AI-powered search | query |

### Example Inputs

#### Get Live Scores

```json
{
    "action": "get_live_scores"
}
```

#### Get ICC Team Rankings

```json
{
    "action": "get_rankings",
    "ranking_type": "teams",
    "format": "test"
}
```

#### Get Player Details

```json
{
    "action": "get_player_details",
    "player_id": "253802",
    "use_api": true
}
```

#### Get Team Details

```json
{
    "action": "get_team_details",
    "team_id": "6",
    "team_slug": "india"
}
```

#### Search Players

```json
{
    "action": "search_players",
    "query": "Virat Kohli",
    "limit": 5
}
```

#### Get Series List

```json
{
    "action": "get_series",
    "status": "current"
}
```

#### AI Search

```json
{
    "action": "ai_search",
    "query": "Who has the most centuries in Test cricket?",
    "tournament": "menstest"
}
```

### Output Format

All actions return a consistent output structure:

```json
{
    "action": "get_live_scores",
    "success": true,
    "data": { ... },
    "error": null,
    "timestamp": "2026-03-18T12:00:00.000Z"
}
```

On error:

```json
{
    "action": "get_live_scores",
    "success": false,
    "data": null,
    "error": "Error message here",
    "timestamp": "2026-03-18T12:00:00.000Z"
}
```

### Common Team IDs

| Team | ID | Slug |
|------|-----|------|
| Australia | 1 | australia |
| England | 2 | england |
| South Africa | 3 | south-africa |
| West Indies | 4 | west-indies |
| New Zealand | 5 | new-zealand |
| India | 6 | india |
| Pakistan | 7 | pakistan |
| Sri Lanka | 8 | sri-lanka |
| Zimbabwe | 9 | zimbabwe |
| Bangladesh | 25 | bangladesh |
| Ireland | 29 | ireland |
| Afghanistan | 40 | afghanistan |

### Deployment

```bash
cd rottentomato/cricketinfo-apify-actor
apify login
apify push
```

### Technical Notes

- Uses `curl-cffi` for HTTP requests with anti-bot bypass capabilities
- Parses both JSON data from `__NEXT_DATA__` scripts and HTML fallbacks
- Handles ESPN Cricinfo's modern Next.js-based architecture
- Supports pagination for news and fan ratings endpoints

# Actor input Schema

## `action` (type: `string`):

Select the scraping action to perform

## `team_id` (type: `string`):

REQUIRED for team actions. Team ID (e.g., '6' for India, '1' for Australia). Use get\_teams to find IDs.

## `team_slug` (type: `string`):

REQUIRED for team actions. Team slug (e.g., 'india', 'australia'). Use get\_teams to find slugs.

## `player_id` (type: `string`):

REQUIRED for get\_player\_details. Player ID from search or team players.

## `use_api` (type: `boolean`):

OPTIONAL for get\_player\_details. Use ESPN API instead of scraping (default: true).

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

REQUIRED for search\_players, ai\_search. Search query string.

## `limit` (type: `integer`):

OPTIONAL for search\_players. Max results (1-50, default: 5).

## `tournament` (type: `string`):

OPTIONAL for ai\_search. Tournament filter (e.g., 'menstest', 'menst20i', 'mensodi').

## `match_id` (type: `string`):

REQUIRED for get\_match\_details. Match ID from live scores or series.

## `match_slug` (type: `string`):

OPTIONAL for get\_match\_details. Full match slug for URL (e.g., 'team-a-vs-team-b-1st-match-1527674'). Improves reliability.

## `series_id` (type: `string`):

REQUIRED for series detail actions. Series ID.

## `series_slug` (type: `string`):

OPTIONAL for series detail actions. Series slug for URL construction (e.g., 'ipl-2026-1510719').

## `status` (type: `string`):

OPTIONAL for get\_series. Filter by series status.

## `format` (type: `string`):

OPTIONAL for get\_live\_scores, get\_rankings. Filter by cricket format.

## `ranking_type` (type: `string`):

REQUIRED for get\_rankings. Type of ranking.

## `stats_type` (type: `string`):

OPTIONAL for get\_stats. Type of statistics.

## `stats_format` (type: `string`):

OPTIONAL for get\_stats. Cricket format for stats.

## `category` (type: `string`):

OPTIONAL for get\_stats. Specific category (e.g., 'most-runs', 'most-wickets').

## `story_id` (type: `string`):

REQUIRED for get\_story\_details. Story ID or slug from news list.

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

OPTIONAL for get\_news, get\_team\_fan\_ratings. Page number (default: 1).

## `match_class` (type: `string`):

OPTIONAL for get\_team\_fan\_ratings. Filter by match type.

## `ground_id` (type: `string`):

REQUIRED for get\_ground\_details. Ground object ID (e.g., '56544' for SCG).

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

OPTIONAL for get\_grounds. Country ID to filter grounds (e.g., '6' for India, '2' for Australia).

## `format_slug` (type: `string`):

REQUIRED for get\_format\_records. Format slug (e.g., 'test-matches-1', 'one-day-internationals-2', 'twenty20-internationals-3').

## `category_slug` (type: `string`):

OPTIONAL for get\_format\_records. Record category slug (e.g., 'batting-records-3', 'bowling-records-4').

## `team_slug_id` (type: `string`):

REQUIRED for get\_team\_records. Team slug-ID (e.g., 'india-6', 'australia-2'). Or use team\_name instead.

## `team_name` (type: `string`):

OPTIONAL for get\_team\_records. Team name (e.g., 'india', 'australia'). Used if team\_slug\_id not provided.

## `trophy_slug` (type: `string`):

REQUIRED for get\_trophy\_records. Trophy slug (e.g., 'indian-premier-league-117', 'world-cup-12', 'the-ashes-1').

## `ground_slug` (type: `string`):

REQUIRED for get\_ground\_records. Ground slug for records.

## `decade_slug` (type: `string`):

REQUIRED for get\_decade\_records. Decade slug (e.g., '2020s-202', '2010s-201', '2000s-200').

## `statsguru_class` (type: `string`):

Cricket format for StatsGuru queries. Default: test.

## `statsguru_type` (type: `string`):

Type of statistics for statsguru\_query. Default: batting.

## `statsguru_view` (type: `string`):

How to group/display the results. Default: overall.

## `statsguru_team` (type: `string`):

Filter by team name (e.g., 'india', 'australia') or StatsGuru team ID.

## `statsguru_opposition` (type: `string`):

Filter by opposition team name or ID.

## `statsguru_host` (type: `string`):

Filter by host country name or ID.

## `statsguru_ground` (type: `string`):

Filter by ground ID (e.g., '131' for Adelaide Oval).

## `statsguru_season` (type: `string`):

Filter by season (e.g., '2023/24', '2024').

## `statsguru_orderby` (type: `string`):

Sort column (e.g., 'runs', 'batting\_average', 'wickets', 'hundreds', 'bowling\_average', 'dismissals').

## `statsguru_page` (type: `integer`):

Page number for paginated results. Default: 1.

## `statsguru_home_or_away` (type: `string`):

Filter by home/away status.

## `statsguru_result` (type: `string`):

Filter by match result.

## `statsguru_spanmin` (type: `string`):

Start date filter (e.g., '01 Jan 2020').

## `statsguru_spanmax` (type: `string`):

End date filter (e.g., '31 Dec 2023').

## Actor input object example

```json
{
  "action": "get_live_scores",
  "use_api": true,
  "limit": 5,
  "ranking_type": "teams",
  "stats_type": "batting",
  "stats_format": "test",
  "page": 1,
  "statsguru_class": "test",
  "statsguru_type": "batting",
  "statsguru_view": "overall",
  "statsguru_page": 1
}
```

# Actor output Schema

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

Scraped cricket data from ESPN Cricinfo stored in the default dataset. For StatsGuru actions, each result includes: headers (column names), rows (data rows with player/team info and parsed links/IDs), pagination (total results, current page, pages available), query metadata (class, type, view, url), and summary row if present.

# 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 = {
    "action": "get_live_scores",
    "ranking_type": "teams"
};

// Run the Actor and wait for it to finish
const run = await client.actor("apiguruu/espncricinfo-api-statsguru-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 = {
    "action": "get_live_scores",
    "ranking_type": "teams",
}

# Run the Actor and wait for it to finish
run = client.actor("apiguruu/espncricinfo-api-statsguru-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 '{
  "action": "get_live_scores",
  "ranking_type": "teams"
}' |
apify call apiguruu/espncricinfo-api-statsguru-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apiguruu/espncricinfo-api-statsguru-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/MIr9GsoUrQ4z2yldb/builds/aA668SNKGjqfms8wz/openapi.json
