# Cricinfo Stats Scraper & Player Analytics (`zapticx/espncricinfo-cricket-stats-player-analytics`) Actor

Scrape Cricinfo player stats, recent form, batting and bowling records. Compare players, apply advanced filters, and export structured cricket data.

- **URL**: https://apify.com/zapticx/espncricinfo-cricket-stats-player-analytics.md
- **Developed by:** [Zapticx](https://apify.com/zapticx) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 raw cricket records

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

## 🏏 Cricinfo Stats Scraper & Player Analytics

**Turn Cricinfo match records into structured cricket data and calculated player insights.**

Scrape real batting and bowling records, analyze recent form, compare players, filter performance by opponent or venue, and export cricket data ready for analysis—without manually working through scorecards.

#### Questions you can answer

- 📊 What is Virat Kohli's strike rate across his last 50 ODI innings?
- ⚔️ How do Virat Kohli and Babar Azam compare over their latest 20 ODI innings?
- 🎯 How many wickets has Jasprit Bumrah taken in his recent ODI matches?
- 🏟️ How does a player perform against a particular opponent or at a supported venue?
- 📈 Is a player's recent form improving or declining? Export dated innings to compare periods in your own analysis; the Actor does not generate a trend score.

**Batting & bowling data · Player comparisons · Recent-form analytics · ODI, Test & T20I · Advanced filters · JSON/CSV/Excel/API-ready output**

### What makes this useful?

| Your goal | What you get |
| --- | --- |
| Understand recent form | The latest qualifying innings or matches, plus calculated totals and rates |
| Compare players fairly | The same format and filters applied to 2–5 players, with each sample size shown |
| Research a specific situation | Opponent, venue, host country, dates, match result and other supported filters |
| Check a statistic | The underlying records, source links and explicit calculation formulas |
| Build a repeatable workflow | Structured exports and API access for spreadsheets, dashboards and AI tools |

### ⚔️ See the result: Kohli vs Babar

**Virat Kohli vs Babar Azam — latest 20 ODI batting innings**

| Player | Innings | Runs | Average | Strike Rate | Highest | 50s | 100s | Not Outs |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| Virat Kohli | 20 | 1,055 | 62.058824 | 100 | 135 | 7 | 4 | 3 |
| Babar Azam | 20 | 669 | 35.210526 | 74.416018 | 102 | 4 | 1 | 1 |

*Verified Actor output captured on August 27, 2026. These are snapshot results, not permanently fixed current statistics. New matches or source corrections can change a later run.*

The Actor also returns **all 40 underlying innings** used to calculate these numbers. Open **Comparison** for the two-row table, **Batting innings** for the evidence, or **All records** for the complete 42-row dataset. Summaries and presentation copies carry no additional record charge.

> **Don't just get an AI-generated answer—get the cricket records and deterministic calculations behind it.** An AI assistant can explain a statistic. When you also need the 50 innings, balls faced, dates, opponents, venues, source URLs, repeatable calculations, CSV/JSON exports or API automation, you need the structured data behind that explanation. Use this Actor on its own or as the evidence source for an AI workflow.

### What data can you extract?

| Data | Included fields and insights |
| --- | --- |
| Batting innings | Runs, balls faced, not-out status, fours, sixes, strike rate, batting position and dismissal |
| Bowling innings | Wickets, runs conceded, balls bowled, overs, maidens, economy and whether the player bowled |
| Match context | Player and match IDs, format, date, opponent, venue and source links |
| Batting summaries | Average, strike rate, highest score, 50s, 100s, ducks, not-outs and boundary metrics |
| Bowling summaries | Wickets, economy, average, strike rate, best bowling, wickets per match and wicket hauls |
| Team exports | Batting or bowling records for one team within a bounded date range |

**Coverage:** men's international **ODI, Test and T20I**, one format per run. Bowling coverage starts in 1980. Available fields depend on the source; unknown values remain null. See [limitations](#limitations) before planning a larger export.

### 🚀 Quick Start

1. Open the Actor's **Input** tab and keep the default settings for your first run.
2. Click **Start**. The default selects Virat Kohli's latest 10 ODI batting innings.
3. Wait for **Succeeded**, then open **Output**. Expect 10 innings and one calculated summary when the full sample is available.
4. Export JSON, CSV or Excel, or retrieve the dataset through the API.

The default needs no dates, profile URL or proxy. To change the player, expand **Single player — recent form only (ignored in comparisons)** and enter a full name.

```json
{
  "mode": "recentForm",
  "player": "Virat Kohli",
  "format": "ODI",
  "discipline": "batting",
  "lastInnings": 10,
  "maxResults": 1000
}
```

> **First-run cost:** 10 raw innings plus the free summary cost **$0.016** in Actor events at the listed prices. `maxResults: 1000` is a ceiling, not a request to collect 1,000 innings.

### Choose your input mode

| Mode | Best for | Required scope | Summary behavior |
| --- | --- | --- | --- |
| `recentForm` | One player's latest qualifying records | Single player; format and sample size | Included unless `includeSummary` is false |
| `playerComparison` | Comparing 2–5 players | Every player in `players`; shared format and filters | Always included, even if `includeSummary` is false |
| `bulk` | Building a team dataset | One team, `dateFrom` and `dateTo` | Optional summaries for the exported rows |

For batting, `lastInnings` selects **1–500 qualifying innings per player**. For bowling, `lastMatches` selects **1–250 qualifying matches per player**. If `lastMatches` is omitted, bowling uses `lastInnings` as its match count.

#### Team bulk example

```json
{
  "mode": "bulk",
  "team": "India",
  "format": "ODI",
  "discipline": "batting",
  "dateFrom": "2025-01-01",
  "dateTo": "2025-12-31",
  "maxResults": 1000
}
```

Choose your own inclusive date range, up to four years. Set `discipline` to `bowling` for a bowling export. `maxResults` caps raw rows globally at **5,000 per run**; summaries are additional. Bulk summaries describe only the rows actually exported—not a complete career or necessarily the entire date range. The manifest reports when the cap is reached.

### Player comparison

Select **Compare players**, then put **ALL players** in **Players to compare — enter ALL players**. Each player is a separate entry. The single-player name, ID and URL fields are ignored; none of them supplies player #1.

```json
{
  "mode": "playerComparison",
  "players": ["Virat Kohli", "Babar Azam"],
  "format": "ODI",
  "discipline": "batting",
  "lastInnings": 20
}
```

**Comparison summaries are automatic.** You never need to enable a summary toggle. Even `"includeSummary": false` is overridden to true for this mode; recent-form and bulk modes still honor false.

In **Output**, use the **left dataset dropdown → Comparison**. For bowling comparisons, select the **Bowling comparison** column view within that dataset. The adjacent column-view buttons change columns, not which records are included.

Each player gets an independent latest qualifying sample. Players can therefore cover different date spans; inspect sample counts and oldest/newest dates before drawing conclusions. Set shared date filters when you need a common period. No subjective ranking, winner or form score is generated.

`maxResults` must accommodate all requested samples. Duplicate resolved players are rejected. List entries can be full names, numeric profile IDs as strings, or Cricinfo profile URLs.

### 📊 Batting analytics

For a larger recent-form sample:

```json
{
  "mode": "recentForm",
  "player": "Virat Kohli",
  "format": "ODI",
  "discipline": "batting",
  "lastInnings": 50
}
```

| Metric | Calculation |
| --- | --- |
| Average | Total runs ÷ dismissals; dismissals = innings − not-outs |
| Strike rate | Total runs ÷ total balls faced × 100 |
| Runs per innings | Total runs ÷ batting innings |
| Highest score | Maximum runs in one innings; not-out status is also returned |
| Fifties / hundreds | Scores of 50–99 / 100 or more; the counts do not overlap |
| Ducks | Dismissed for zero; 0 not out is not a duck |
| Boundary runs | 4 × fours + 6 × sixes |
| Boundary percentage | Boundary runs ÷ total runs × 100 |

DNB/TDNB batting rows are excluded. Rates use aggregate totals, not an average of individual innings rates. If any balls-faced value is missing, aggregate balls faced and strike rate remain null.

### 🎯 Bowling analytics

```json
{
  "mode": "recentForm",
  "player": "Jasprit Bumrah",
  "format": "ODI",
  "discipline": "bowling",
  "lastMatches": 10
}
```

| Metric | Calculation |
| --- | --- |
| Wickets | Sum across the selected records |
| Average | Runs conceded ÷ wickets |
| Strike rate | Balls bowled ÷ wickets |
| Economy | Runs conceded ÷ balls bowled × 6 |
| Wickets per match | Wickets ÷ distinct selected match IDs |
| Best bowling | Most wickets in an innings, then fewest runs conceded |
| Four / five wicket hauls | Exactly 4 / at least 5 wickets in an innings |

**Cricket overs are not decimal numbers:** `9.4` overs means **58 balls**. The Actor returns an overs display string and uses numeric `ballsBowled` for calculations. All derived rates are rounded to six decimal places; zero denominators produce null.

The match window includes source-listed matches in which the player did not bowl. These records have `didBowl: false`, zero balls/wickets/conceded runs and null rates. Test matches may contribute multiple bowling innings. Summary `innings` counts innings actually bowled; `matches` counts distinct selected matches.

### Filter the performance you want to study

Filters apply **before** the latest sample is selected.

| Filter | Use it for |
| --- | --- |
| `opponent`, `team` | A supported opposing or represented team |
| `hostCountry` | Matches in a supported host country |
| `venue` | Adelaide Oval, Lord's, Eden Gardens or Wankhede |
| `homeAwayNeutral` | Source classification: `home`, `away` or `neutral` |
| `dateFrom`, `dateTo` | Inclusive match start dates in `YYYY-MM-DD` format |
| `matchResult` | `won`, `lost`, `tied`, `noResult`, or `draw` for Tests |
| `inningsNumber` | Match innings 1–2 in ODI/T20I, 1–4 in Tests |
| `battingPosition` | Exact batting position, 1–11; batting only |
| `battingSituation` | `battingFirst` or `chasing`; ODI/T20I batting only |

**Against Australia**

```json
{"player": "Virat Kohli", "format": "ODI", "opponent": "Australia", "lastInnings": 20}
```

**While chasing**

```json
{"player": "Virat Kohli", "format": "ODI", "battingSituation": "chasing", "lastInnings": 30}
```

**In England**

```json
{"player": "Babar Azam", "format": "ODI", "hostCountry": "England", "lastInnings": 10}
```

**At Adelaide Oval**

```json
{"player": "Virat Kohli", "format": "ODI", "venue": "Adelaide Oval", "lastInnings": 5}
```

Chasing means team innings 2, not batting position. It does not identify successful chases, revised targets, Super Overs or Test fourth-innings chases. Source `away` means the opposition's home ground, not simply a location outside the player's country. Test dates are match start dates, not the day an innings began.

### 📁 Find and export your results

| Dataset | What it contains | When to use it |
| --- | --- | --- |
| **All records** / Default | Every raw innings and summary record | Complete exports, API workflows and bowling raw records |
| **Comparison** | Only `comparisonSummary` records | A clean 2–5 row comparison table after a successful comparison |
| **Batting innings** | Only `battingInnings` records | Inspect or export batting evidence without summary rows |

The default dataset contains `battingInnings`, `bowlingInnings`, `playerSummary` or `comparisonSummary`, as applicable. **Recent form** returns raw records plus a `playerSummary`; in All records, the **Summary columns (all records)** view makes summary fields easier to read but does not remove raw rows.

For **bowling**, use All records and its bowling column view for raw records, and Comparison → Bowling comparison for comparison summaries. There is no separate bowling-only dataset. Batting innings is empty on bowling runs; Comparison is empty outside comparison mode or if a run fails before generating summaries.

The focused datasets contain unchanged copies from Default. **Do not concatenate them with All records**: that would duplicate records. Existing API consumers can keep using `defaultDatasetId`.

Use the left dataset dropdown to switch outputs. All records remains the initial output; the top Output count refers to Default even when another dataset is selected. Dataset column views only select and format fields—they do not filter record types.

To export a focused dataset, open **Storage → Dataset**, select **Comparison** or **Batting innings**, then export it. The main run Export button exports the complete default dataset. JSON, CSV and Excel are available; API output links are `output.comparison` and `output.battingInnings`.

> **Check completeness before analysis.** Confirm the run succeeded and inspect `RUN-MANIFEST` for warnings. A short nonempty history returns its actual sample size with `sampleComplete: false`; a failed run can retain partial raw records without a completed summary.

### JSON output example

This abbreviated batting record comes from the same verified August 27, 2026 comparison snapshot shown above. Values and URLs are preserved from Actor output.

```json
{
  "recordType": "battingInnings",
  "recordId": "batting:ODI:253802:1496581:2",
  "playerName": "Virat Kohli",
  "playerId": 253802,
  "format": "ODI",
  "matchDate": "2026-07-19",
  "matchId": 1496581,
  "opponent": "England",
  "venue": "Lord's",
  "runs": 74,
  "ballsFaced": 60,
  "notOut": false,
  "strikeRate": 123.333333,
  "matchUrl": "https://www.espncricinfo.com/ci/engine/match/1496581.html",
  "sourceUrl": "https://stats.cricinfo.com/ci/engine/player/253802.html?class=2;orderby=start;orderbyad=reverse;size=100;template=results;type=batting;view=innings"
}
```

Numbers are numeric, flags boolean, unavailable values null, dates ISO, and links absolute. Raw rows also include the query ID and retrieval timestamp.

Some source records still use legacy domains supplied by Cricinfo. The Actor preserves working source URLs exactly so audits and existing integrations remain valid.

### API and automation

Use the Apify API or Python client to run a saved analysis and retrieve its records. Keep your token in a secret environment variable, not in URLs or logs.

This example uses **Apify Python client 2.5.1**. Install it with `pip install apify-client==2.5.1`; client v3 uses a different response-object interface.

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("zapticx/espncricinfo-cricket-stats-player-analytics").call(
    run_input={"player": "Virat Kohli", "format": "ODI", "lastInnings": 30},
    memory_mbytes=256,
)
if not run or run["status"] != "SUCCEEDED":
    raise RuntimeError("Do not treat a failed run's partial dataset as complete")
records = list(client.dataset(run["defaultDatasetId"]).iterate_items())
innings = [row for row in records if row["recordType"] == "battingInnings"]
```

The API slug in this example is the Actor's existing stable identifier. It remains unchanged for compatibility even though the product title now uses Cricinfo.

Save inputs as Apify tasks, schedule repeat runs, trigger downstream work with webhooks, or connect through n8n and Make. Load the JSON into pandas, a warehouse or a dashboard, or give an AI assistant both the calculated summary and its source records. Schedules are not created automatically.

See the [Apify API guide](https://docs.apify.com/academy/api/run-actor-and-retrieve-data-via-api) and [Python client documentation](https://docs.apify.com/api/client/python/).

### 💳 Pricing

**$0.001 per Actor start + $1.50 per 1,000 raw records. Summaries are free.**

One raw record is one saved batting or bowling innings row, including a did-not-bowl participation row. There is no automatic dataset-item fee, no summary event and no duplicate charge for the Comparison or Batting innings copies.

| Example | Billable raw records | Actor event charge |
| --- | ---: | ---: |
| Default recent form + summary | 10 | **$0.016** |
| Latest 50 innings + summary | 50 | **$0.076** |
| Two players × latest 20 innings + summaries | 40 | **$0.061** |
| Bulk export + summaries | 1,000 | **$1.501** |

Formula: **$0.001 + raw records × $0.0015**. Check the Pricing tab for the applicable configured prices. Optional proxy use and applicable account charges or taxes can add costs; the default uses direct access without a proxy.

Set a spending limit that covers the whole sample. The minimum is $0.0025, enough for one start and one raw record. If the next raw batch cannot fit the remaining budget, the run fails clearly instead of silently calculating a shorter recent-form sample. Saved raw rows remain available and charged. A failed or ambiguous query can still incur the start fee. Completed summaries remain free even when the final affordable raw row consumes the remaining record budget.

Start a new run instead of resurrecting an old one to avoid duplicate output and charges. Default memory is 256 MB, with a 1 GB maximum; the start event occurs once within this allocation range.

### Find the right player

Start with a full name such as **Virat Kohli, Babar Azam, Shubman Gill, Jasprit Bumrah, Joe Root, Travis Head, Rachin Ravindra, Shaheen Shah Afridi or Kane Williamson**. Names are discovered live through Cricinfo's player search, not a fixed player list. Coverage is not universal: Cricinfo may omit a player or index a different spelling.

Matching ignores case and repeated spaces. It does not silently accept initials, substrings, spellcheck suggestions or arbitrary fuzzy matches. Search results must identify cricket; the search UID and Cricinfo profile ID must agree, and the statistics page's player and format are checked separately.

#### When a name is ambiguous

Use an optional country or birth-year hint, or supply the exact Cricinfo profile ID/URL. Fame and search ranking are not used to choose between people.

```json
{"player": "Mohammad Rizwan", "playerBirthYear": 1992, "format": "ODI"}
```

```json
{"player": "Rohit Sharma", "playerBirthYear": 1987, "format": "ODI"}
```

```json
{"player": "Steve Smith", "playerBirthYear": 1989, "format": "ODI"}
```

The Steve Smith query considers Steve/Steven candidates to avoid choosing the older Australian player silently. Other unverified nicknames are not expanded. If ambiguity remains, the error and `RUN-MANIFEST` provide candidates with profile IDs/URLs, countries and available birth dates. A capped search asks for a more specific name or an ID rather than trusting incomplete discovery.

**Single-player priority:** `playerUrl` → `playerId` → `player`. An explicit profile URL or ID bypasses name search even if a prefilled name remains; URL wins if URL and ID conflict. Use profile IDs, not Statsguru's internal `player_involve` IDs.

In comparisons, put IDs or URLs directly in the `players` list. `playerCountry` and `playerBirthYear` apply to every name in that list; use IDs for players requiring different hints. `playerCountry` disambiguates identity, whereas `team` filters statistics. Bulk uses the team and ignores the single-player fields.

### Limitations

- **Supported scope:** men's international Test, ODI and T20I; no domestic/franchise or women's cricket, captaincy, series/tournament filters, head-to-head analysis, rolling-window calculations or team-result summaries.
- **Bounded extraction:** up to 500 batting innings or 250 bowling matches per player; 2–5 comparison players; one team and at most four years for bulk; 5,000 raw rows globally and a 60-page safety cap.
- **Source availability:** access, coverage and corrections depend on Cricinfo. HTTP 403 causes a clear failure; the Actor does not retry indefinitely or automatically upgrade to residential proxies.
- **Incomplete fields:** host country, team, match result and home/away/neutral are populated only when constrained by the corresponding filter; otherwise they are null. They are not independently enriched for each match. Direct-ID and bulk names may retain source initials.
- **Venue and history limits:** only the four listed venue filters are supported. Historical pre-1980 bowling is excluded because over lengths can differ.
- **Partial output:** saved batches can survive a later failure. Always check status and the manifest; nonempty output alone does not establish a complete sample.
- **Comparability:** latest-N samples can span different periods. The Actor calculates statistics, not predictions, recommendations or a subjective form score.

### Data sources and transparency

This is an **independent tool, not an official Cricinfo product**. It reads Cricinfo Statsguru innings records, uses the source's structured search and athlete metadata for player discovery, and preserves source URLs and retrieval timestamps. It does not substitute generated statistics for missing records.

Calculations are deterministic for a given set of exported innings. `recordId` identifies a row by discipline, format, player, match and innings; `queryId` associates records with the effective input. Records are selected by date descending, with ties ordered by match ID, innings number and player ID descending, including ties that cross source pages.

The **RUN-MANIFEST** key-value record contains the effective input, source URLs and SHA-256 response hashes, player-resolution provenance, page counts, warnings, status, proxy usage and billing counters. For comparisons submitted with `includeSummary: false`, the original INPUT preserves false while the manifest records the effective true value.

Keep the dataset and manifest for a record of what you retrieved. Repeating a query after new matches or source corrections can legitimately return different records. Focused datasets follow the run's retention policy; export anything you need to keep.

Requests use direct HTTP, are sequential and paced, and retry transient errors at most three times with bounded waits and timeouts. Pagination checks query identity, advancing page numbers, repeated content, duplicate IDs and ordering. Optional Apify proxy settings are used only when you explicitly enable them.

The Actor does not grant a license to Cricinfo data. Review source terms, attribution requirements and permitted downstream use before redistribution, especially commercial reuse. No legal assurance or independent official scorer feed is provided.

# Actor input Schema

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

For comparison, enter ALL players in Players to compare. Single-player fields are used only by Player recent form.

## `players` (type: `array`):

Compare players only: enter the complete list of 2–5 players, including player #1. Example: Virat Kohli and Babar Azam are TWO entries here. The Single player name, ID and URL fields are ignored. Each entry may be a full name, numeric Cricinfo profile ID, or Cricinfo profile URL. Leave empty for recent form/bulk.

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

One format per query; men's international cricket.

## `discipline` (type: `string`):

Batting uses last innings; bowling uses last matches, including did-not-bowl matches.

## `lastInnings` (type: `integer`):

Latest qualifying batting innings per player. Also the default bowling match count when lastMatches is omitted.

## `lastMatches` (type: `integer`):

Bowling only. Includes matches in which the player did not bowl; Test matches may contain two bowling innings.

## `maxResults` (type: `integer`):

Global raw-record cap. Summaries are additional. Must cover all requested comparison samples.

## `player` (type: `string`):

Ignored in Compare players and Team bulk dataset modes. This is NOT player #1 in a comparison: enter every comparison player in Players to compare. Recent form: type a full name, or use URL/ID below.

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

Ignored in comparisons. Put comparison IDs in Players to compare. Recent form: profile ID, not Statsguru's internal player\_involve ID.

## `playerUrl` (type: `string`):

Ignored in comparisons. Put comparison URLs in Players to compare. Recent form: plain HTTPS Cricinfo profile URL; takes precedence over single player ID/name.

## `playerCountry` (type: `string`):

Optional exact country for name disambiguation; applies to all comparison names. Separate from the team statistics filter.

## `playerBirthYear` (type: `integer`):

Optional birth year for same-name players; applies to all comparison names. Use IDs/URLs for mixed comparisons requiring different hints.

## `team` (type: `string`):

Required for bulk; optional source team filter for individual queries.

## `opponent` (type: `string`):

Filter before selecting the latest sample.

## `hostCountry` (type: `string`):

Uses Statsguru's host-country filter; not inferred from team or venue text.

## `venue` (type: `string`):

Verified ground IDs only. Other grounds are not yet supported.

## `homeAwayNeutral` (type: `string`):

Source classification: away means home of opposition, not simply outside player's country.

## `dateFrom` (type: `string`):

Inclusive match start date YYYY-MM-DD. Both dates required for bulk; maximum bulk range four years.

## `dateTo` (type: `string`):

Inclusive match start date YYYY-MM-DD. Both dates required for bulk; maximum bulk range four years.

## `battingSituation` (type: `string`):

ODI/T20I batting only: team innings 1 or 2. Not inferred from batting position.

## `matchResult` (type: `string`):

Source result from selected player's/team's perspective. Draw is Test-only.

## `inningsNumber` (type: `integer`):

1–2 in limited overs, 1–4 in Tests.

## `battingPosition` (type: `integer`):

Exact position, batting only.

## `includeSummary` (type: `boolean`):

Comparison summaries are always included automatically: playerComparison ignores this setting and overrides false to true. In recent-form and bulk modes, disable to omit optional summary rows. Raw records are always returned. Summaries are free.

## `proxyConfiguration` (type: `object`):

Direct HTTP is the tested default. Proxies are used only when explicitly enabled; no automatic residential upgrade.

## Actor input object example

```json
{
  "mode": "recentForm",
  "format": "ODI",
  "discipline": "batting",
  "lastInnings": 10,
  "maxResults": 1000,
  "player": "Virat Kohli"
}
```

# Actor output Schema

## `records` (type: `string`):

No description

## `comparison` (type: `string`):

Only comparisonSummary rows, always generated in playerComparison mode even if includeSummary is false. One row per player; no raw innings mixed in. Empty outside comparison mode or if the run fails before producing summaries.

## `battingInnings` (type: `string`):

Only battingInnings rows, copied unchanged from All records. No additional record charges.

## `manifest` (type: `string`):

No description

# API

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

## JavaScript example

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

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

// Prepare Actor input
const input = {
    "mode": "recentForm",
    "format": "ODI",
    "discipline": "batting",
    "lastInnings": 10,
    "maxResults": 1000,
    "player": "Virat Kohli"
};

// Run the Actor and wait for it to finish
const run = await client.actor("zapticx/espncricinfo-cricket-stats-player-analytics").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 = {
    "mode": "recentForm",
    "format": "ODI",
    "discipline": "batting",
    "lastInnings": 10,
    "maxResults": 1000,
    "player": "Virat Kohli",
}

# Run the Actor and wait for it to finish
run = client.actor("zapticx/espncricinfo-cricket-stats-player-analytics").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 '{
  "mode": "recentForm",
  "format": "ODI",
  "discipline": "batting",
  "lastInnings": 10,
  "maxResults": 1000,
  "player": "Virat Kohli"
}' |
apify call zapticx/espncricinfo-cricket-stats-player-analytics --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zapticx/espncricinfo-cricket-stats-player-analytics"
        }
    }
}

```

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/5EtLelo4tg1QtICJY/builds/MgfUaZD2JYUWF4pEe/openapi.json
