Skip to content

Guides

How do I get cricket leaderboards in Python?

The top run scorers, wicket takers or best strike rates in a competition, season or format, counted from the balls.

Code verified November 3, 2026. One call to get_leaders, 5 credits.

The call

stat is runs, batting_average, strike_rate, sixes, wickets, economy or bowling_average. Rate stats need 120 balls unless you pass min_balls.

import requests
import pandas as pd

API_KEY = "YOUR_API_KEY"

resp = requests.post(
    "https://mcp.yorkerapi.com/v1/get_leaders",
    headers={"x-api-key": API_KEY},
    json={
        "stat": "wickets",
        "competition": "ipl",
        "season": "2025",
        "limit": 10,
    },
    timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]

leaders = pd.DataFrame(data["leaders"])
print(leaders[["rank", "name", "wickets", "average", "economy"]])

Replace YOUR_API_KEY with a key from your dashboard. Python needs requests and pandas (pip install requests pandas). JavaScript runs on Node 18 or newer, or in the browser.

What comes back

The data object of the response, trimmed to the first rows. Every field is real output from the run above.

{
  "stat": "wickets",
  "min_balls": 0,
  "leaders": [
    {
      "rank": 1,
      "player_id": "85e0cf10",
      "matches": 15,
      "balls": 354,
      "runs_conceded": 488,
      "wickets": 25,
      "dots": 135,
      "wides": 11,
      "noballs": 0,
      "name": "M Prasidh Krishna",
      "overs": "59",
      "average": 19.52,
      "economy": 8.27,
      "strike_rate": 14.2
    },
    {
      "rank": 2,
      "player_id": "efc04be7",
      "matches": 14,
      "balls": 300,
      "runs_conceded": 408,
      "wickets": 24,
      "dots": 102,
      "wides": 19,
      "noballs": 3,
      "name": "Noor Ahmad",
      "overs": "50",
      "average": 17,
      "economy": 8.16,
      "strike_rate": 12.5
    },
    "...8 more"
  ],
  "count": 10
}

What to do next

More guides

The same guide for other sports

Start with 500 free credits every month

No card. REST or MCP.