ESPNcricinfo player career statistics
A player's Statsguru figures for one format: career averages and the career summary split by opposition, ground, host country, year and more (the summary view) (matches, innings, not outs, runs, high score, average, balls, strike rate, hundreds, fifties, ducks, fours, sixes; or the bowling and fielding equivalents). Other views list every innings, match or series.
Every response includes credits_used: the credits this call cost.
Part of the ESPNcricinfo API: 15 endpoints with prices, use cases and example responses.
Parameters
| name | type | description |
|---|---|---|
idrequired | string | Player id (253802 is Virat Kohli; the number in an espncricinfo.com player link). Example: 253802 |
format | test | odi | t20i | international | first-class | list-a | t20 | women-test | women-odi | women-t20i | test (default), odi, t20i, international, first-class, list-a, t20, women-test, women-odi or women-t20i. |
type | batting | bowling | fielding | allround | batting (default), bowling, fielding or allround. |
view | summary | innings | match | series | ground | cumulative | summary (default), innings, match, series, ground or cumulative. |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/espncricinfo/v1/player/stats?id=253802&format=odi" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/espncricinfo/v1/player/stats",
params={"id": "253802", "format": "odi"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/espncricinfo/v1/player/stats");
url.searchParams.set("id", "253802");
url.searchParams.set("format", "odi");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).