# ESPNcricinfo Statsguru Scraper (`automation-lab/espncricinfo-statsguru-scraper`) Actor

Export normalized historical player, team, match, series, batting, and bowling statistic rows from supplied public ESPNcricinfo Statsguru query URLs.

- **URL**: https://apify.com/automation-lab/espncricinfo-statsguru-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Sports
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.86 / 1,000 item extracteds

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/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

## ESPNcricinfo Statsguru Scraper

Export public ESPNcricinfo Statsguru queries as normalized cricket statistic rows.
Supply the Statsguru URLs you already use for research, choose a result limit, and
receive structured player, team, match, series, or record tables in an Apify
dataset.

The Actor reads the server-rendered Statsguru tables directly. It preserves each
table's current column labels inside a `statistics` object and adds stable source
context such as the query title, table caption, entity link, rank, and scrape
time. No ESPN account, browser automation, or residential proxy is required.

### What can you extract from ESPNcricinfo Statsguru?

Use this Actor with public URLs under
`https://stats.espncricinfo.com/ci/engine/` to extract:

- ranked batting records such as runs, averages, strike rates, and boundaries;
- ranked bowling records such as wickets, averages, economy rates, and hauls;
- player analysis tables exposed by Statsguru queries;
- team summaries and result breakdowns;
- match and series analysis tables when available on the supplied URL;
- stable ESPNcricinfo entity URLs and IDs exposed in table links;
- the original query URL and extraction timestamp for auditability.

The Actor does not invent a fixed cricket-statistics model. Statsguru has many
query shapes, so the source column headings remain the keys in `statistics`.
This preserves fields that differ between batting, bowling, team, and match
views without discarding source context.

### Who is it for?

- **Cricket analysts** building historical player or team comparisons.
- **Sports data teams** turning repeat Statsguru queries into scheduled feeds.
- **Journalists and researchers** collecting source-attributed tables.
- **Fantasy and modelling teams** preparing batting or bowling features.
- **Developers** who need JSON records instead of manually copied HTML tables.
- **Spreadsheet users** exporting repeat queries to CSV, Excel, or Google Sheets.

This Actor is for supplied Statsguru query URLs. It is not a live-score feed,
ball-by-ball API, scorecard crawler, or general ESPNcricinfo site crawler.

### Why use this Actor?

Statsguru query pages are useful but their table shapes vary. This Actor:

1. validates that every input points to the public Statsguru engine;
2. processes multiple queries in one run;
3. parses all captioned result tables that contain statistic rows;
4. normalizes numbers while preserving score/date/text values;
5. stops exactly at `maxItems` across the complete run;
6. adds consistent metadata around every source-shaped statistics object;
7. retries only transient network, HTTP 429, and server failures;
8. fails clearly on unsupported hosts or blocked/non-Statsguru responses.

Direct server-rendered HTML keeps runtime, memory, and infrastructure overhead
low. Duplicate input URLs are processed once.

### Getting started

1. Open a public ESPNcricinfo Statsguru query in your browser.
2. Copy its URL. It must begin with
   `https://stats.espncricinfo.com/ci/engine/`.
3. Add the URL to **Statsguru query URLs**.
4. Set **Maximum statistic rows** for the combined export.
5. Click **Start**.
6. Open **Dataset** to inspect, download, or integrate the normalized rows.

A working small input is:

```json
{
  "startUrls": [
    {
      "url": "https://stats.espncricinfo.com/ci/engine/records/batting/most_runs_career.html?class=1;id=2025;type=year"
    }
  ],
  "maxItems": 25
}
```

### Input parameters

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `startUrls` | array | Yes | 2025 Test batting query | One to 50 public Statsguru engine query URLs. |
| `maxItems` | integer | No | `100` | Combined output cap from 1 to 10,000 rows. |

Input URLs can point to different supported Statsguru table families in the
same run. The Actor applies one shared `maxItems` limit in input order. If the
limit is reached during a query, only the rows that fit are saved.

The Actor intentionally rejects normal ESPN pages, shortened links, non-HTTPS
URLs, and third-party domains. Convert those pages into their public Statsguru
query URL before running.

### Output fields

| Field | Type | Meaning |
| --- | --- | --- |
| `recordType` | string | Inferred `player`, `team`, `match`, `series`, `record`, or `statistics`. |
| `queryTitle` | string | Current HTML title of the Statsguru query result. |
| `tableTitle` | string | Caption of the source result table. |
| `entityName` | string | Primary label shown in the first table column. |
| `entityId` | string or absent | Numeric ESPNcricinfo ID when a primary link exposes one. |
| `entityUrl` | string or absent | Absolute link to the primary source entity. |
| `rank` | number or absent | Record rank exposed by the source row. |
| `rowNumber` | number | One-based position within the source table. |
| `statistics` | object | Source column names mapped to string, number, or null values. |
| `sourceQueryUrl` | string | Validated supplied query URL. |
| `scrapedAt` | string | ISO 8601 extraction timestamp. |

`statistics` is deliberately flexible. A batting table may contain `Runs`,
`Ave`, and `SR`; a bowling table may contain `Wkts`, `Econ`, and `BBI`; team
analysis pages expose their own headings. Check `tableTitle` and the keys in
`statistics` before combining unlike query families.

### Example dataset item

This abbreviated record reflects the Actor's current output shape:

```json
{
  "recordType": "player",
  "queryTitle": "2025 Cricket Team Records & Stats | Cricinfo.com",
  "tableTitle": "Most runs",
  "entityName": "Shubman Gill (IND)",
  "entityId": "1070173",
  "entityUrl": "https://stats.espncricinfo.com/ci/content/player/1070173.html",
  "rank": 1,
  "rowNumber": 1,
  "statistics": {
    "Player": "Shubman Gill (IND)",
    "Mat": 9,
    "Runs": 983,
    "Ave": 70.21
  },
  "sourceQueryUrl": "https://stats.espncricinfo.com/ci/engine/records/batting/most_runs_career.html?class=1;id=2025;type=year",
  "scrapedAt": "2026-08-21T14:42:33.381Z"
}
```

Values such as `269*`, date spans, result descriptions, and composite scores
remain strings. Plain integers and decimals become JSON numbers. A source dash
or blank cell becomes `null`.

### Export ESPNcricinfo data to spreadsheets and pipelines

Apify datasets can be downloaded as JSON, CSV, Excel, XML, or RSS. Common
workflows include:

- schedule the same queries and append snapshots to a data warehouse;
- export batting and bowling queries together for model preparation;
- compare team-analysis rows between scheduled runs;
- connect the dataset to Google Sheets through Make or Zapier;
- load JSON through the Apify API from Python, JavaScript, R, or BI tools;
- retain `sourceQueryUrl` with every downstream record for reproducibility.

For change monitoring, schedule the Actor and compare datasets downstream.
The Actor emits current snapshots; it does not maintain historical diffs or
send alerts itself.

### How much does it cost to export ESPNcricinfo Statsguru rows?

Pay-per-event pricing charges one **Run started** event at $0.00005 per run
and one **Item extracted** event for each saved statistic row. The BRONZE item
price is $0.001428. Higher-volume subscription tiers use strictly lower item
prices shown in the Apify Console before a run starts.

At BRONZE pricing:

| Saved rows | Start | Item events | Estimated total |
| ---: | ---: | ---: | ---: |
| 10 | 0.00005 USD | 0.01428 USD | 0.01433 USD |
| 100 | 0.00005 USD | 0.14280 USD | 0.14285 USD |
| 1,000 | 0.00005 USD | 1.42800 USD | 1.42805 USD |

Only normalized rows actually saved are item-charged. Invalid input, duplicate
input URLs, rejected rows, and empty queries do not create item events. Runtime
platform usage is covered by the Actor's PPE model; users should treat the
Console estimate and active tier as authoritative.

### Schedule recurring Statsguru exports

1. Save a working Actor run as an Apify Task.
2. Give the Task a stable name for the cricket analysis job.
3. Add a daily, weekly, or tournament-specific schedule.
4. Send the resulting dataset to your preferred storage or automation.
5. Compare records using `sourceQueryUrl`, `tableTitle`, `entityId`, and the
   relevant statistic keys.

Statsguru data can change when matches complete or ESPN corrects historical
records. Store timestamps and source URLs if your workflow needs an audit trail.

### Use the Actor through the Apify API

Replace `APIFY_TOKEN` with your token. The run endpoint is:

```text
https://api.apify.com/v2/acts/automation-lab~espncricinfo-statsguru-scraper/runs
```

#### cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~espncricinfo-statsguru-scraper/runs?token=APIFY_TOKEN&waitForFinish=120" \
  -H "Content-Type: application/json" \
  -d '{
    "startUrls": [{
      "url": "https://stats.espncricinfo.com/ci/engine/records/bowling/most_wickets_career.html?class=1;id=2025;type=year"
    }],
    "maxItems": 25
  }'
```

#### JavaScript

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/espncricinfo-statsguru-scraper').call({
  startUrls: [{
    url: 'https://stats.espncricinfo.com/ci/engine/team/6.html?class=2;template=results;type=team',
  }],
  maxItems: 20,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/espncricinfo-statsguru-scraper').call(run_input={
    'startUrls': [{
        'url': 'https://stats.espncricinfo.com/ci/engine/records/batting/most_runs_career.html?class=1;id=2025;type=year'
    }],
    'maxItems': 25,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

### Use ESPNcricinfo Statsguru with MCP

Add the Actor to Claude Code through Apify MCP:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/espncricinfo-statsguru-scraper"
```

#### Claude Desktop

Add this JSON to the Claude Desktop MCP configuration:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/espncricinfo-statsguru-scraper"
    }
  }
}
```

#### Cursor

Add the same `mcpServers.apify.url` entry to your Cursor MCP settings.

#### VS Code

Add the same HTTP MCP URL to your VS Code MCP server configuration.

Example prompts:

- “Export the first 25 rows from this 2025 Test batting Statsguru URL.”
- “Run these batting and bowling query URLs and summarize the top players.”
- “Fetch India ODI team-analysis rows and return the dataset link.”

The MCP client still needs access to your Apify account and will use the Actor's
same validated input contract.

### Performance and reliability

The Actor uses direct HTTP and Cheerio rather than a browser. It runs with
256 MB of memory and requests query pages sequentially to avoid unnecessary
load. Each request has a 30-second timeout. Transient network, rate-limit, and
server failures receive up to two bounded retries.

Deterministic input or HTTP errors are not retried blindly. A blocked,
non-HTML, or structurally unrecognizable response fails the run instead of
silently returning an empty dataset. A valid Statsguru query with no statistic
rows completes successfully with a warning and zero output.

### Limitations

- Only public HTTPS URLs on `stats.espncricinfo.com/ci/engine/` are accepted.
- The Actor does not log in, solve CAPTCHAs, or access subscription-only data.
- Statsguru controls which tables and rows a supplied query returns.
- Source headings can change; downstream code should inspect `tableTitle` and
  `statistics` keys.
- `maxItems` limits output across all inputs in their supplied order.
- The Actor does not crawl normal scorecards or discover query URLs.
- It emits snapshots, not built-in diffs, alerts, forecasts, or live scores.
- ESPNcricinfo may update historical data after the Actor has run.

### Responsible use and legality

Use the Actor only for public data you are permitted to collect. Follow
ESPNcricinfo's applicable terms, robots guidance, and reasonable request rates.
Do not use the output to violate privacy, intellectual-property, contractual,
or database rights. Cricket facts may be public, while presentation and database
compilation can still have legal protections.

ESPN and ESPNcricinfo are trademarks of their respective owners. This Actor is
an independent extraction tool and is not affiliated with or endorsed by ESPN.
You are responsible for your use, retention, and redistribution of output.

### Troubleshooting

#### “Unsupported URL”

Use the full public Statsguru URL beginning with
`https://stats.espncricinfo.com/ci/engine/`. Normal article, scorecard, and
`www.espncricinfo.com` URLs are intentionally rejected.

#### The dataset is empty

Open the exact query URL in a browser and confirm it currently contains a
Statsguru data table. Future date filters and combinations with no matching
matches can legitimately return no rows. Check the run warning and query input.

#### The run fails with an HTTP or response-shape error

Retry later if ESPNcricinfo is temporarily unavailable. Persistent errors can
indicate a changed Statsguru route or upstream blocking. Inspect the Actor log;
it reports the failing query without dumping the full response.

#### I received fewer rows than expected

Increase `maxItems` or change input ordering. The limit is global, so an earlier
query can consume all remaining capacity before later queries are fetched.

#### Different queries have different fields

That is expected. Group rows by `tableTitle` or `sourceQueryUrl` and read the
source-labelled `statistics` object. Do not assume batting and bowling tables
share identical keys.

### FAQ

#### Does this scrape live ESPNcricinfo scores?

No. It exports historical and analytical tables from supplied Statsguru query
URLs. Choose a dedicated live-score Actor for live fixtures and score updates.

#### Can I scrape multiple queries in one run?

Yes. Add up to 50 URLs. Duplicate normalized URLs are processed once, and the
shared `maxItems` limit controls total saved rows.

#### Does it support IPL or Nepal cricket data?

Yes when ESPNcricinfo exposes the requested IPL, Nepal, player, team, or match
scope through a public Statsguru engine query URL. The Actor does not translate
a plain search phrase into a query; supply the resulting Statsguru URL.

#### Does it require a proxy?

No. The current implementation uses direct public HTTP requests and has no
automatic proxy or browser fallback.

#### Can I export CSV or Excel?

Yes. Open the default dataset and choose CSV, Excel, JSON, XML, or another Apify
export format.

#### Are entity IDs always present?

No. `entityId` and `entityUrl` appear when the first source cell links to a
numeric ESPNcricinfo entity. Summary rows such as “overall” may not expose one.

### Related Automation Lab Actors

For live cricket rather than historical Statsguru queries, use
[Cricbuzz Live Match Scores Scraper](https://apify.com/automation-lab/cricbuzz-live-match-scores-scraper).
It serves a different job: current fixtures and score updates from Cricbuzz.

For general sports API patterns, see
[MLB StatsAPI Baseball Data Scraper](https://apify.com/automation-lab/mlb-statsapi-baseball-data-scraper).
It is relevant to multi-sport data teams, but it does not provide cricket data.

### Support

If a previously working public Statsguru engine URL stops producing its visible
table, include the exact input URL, run ID, and expected table caption in your
Apify issue. Do not include private tokens or unrelated account data.

# Actor input Schema

## `startUrls` (type: `array`):

Public https://stats.espncricinfo.com/ci/engine/... query URLs. Add player, team, records, match, or series analysis URLs; duplicate URLs are processed once.

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

Stop after saving this many rows across all supplied queries. The final query is truncated when the limit is reached.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://stats.espncricinfo.com/ci/engine/records/batting/most_runs_career.html?class=1;id=2025;type=year"
    }
  ],
  "maxItems": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

Open all normalized cricket statistic rows in the default dataset.

# 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 = {
    "startUrls": [
        {
            "url": "https://stats.espncricinfo.com/ci/engine/records/batting/most_runs_career.html?class=1;id=2025;type=year"
        }
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/espncricinfo-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 = {
    "startUrls": [{ "url": "https://stats.espncricinfo.com/ci/engine/records/batting/most_runs_career.html?class=1;id=2025;type=year" }],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/espncricinfo-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 '{
  "startUrls": [
    {
      "url": "https://stats.espncricinfo.com/ci/engine/records/batting/most_runs_career.html?class=1;id=2025;type=year"
    }
  ],
  "maxItems": 20
}' |
apify call automation-lab/espncricinfo-statsguru-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/espncricinfo-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/iSvlRzmI34ymBh32f/builds/BAle0bGdbOcUHCkMG/openapi.json
