Skip to content

Guides

How do I get cricket team ratings in Python?

Our Elo for every side in a format, best first, from results alone: Test sides, ODI sides, T20 franchises, men's or women's.

Code verified November 3, 2026. One call to get_ratings, 2 credits.

The call

format is test, odi, t20, first_class or list_a. Teams with no match in two years are left out unless you pass active_since.

import requests
import pandas as pd

API_KEY = "YOUR_API_KEY"

resp = requests.post(
    "https://mcp.yorkerapi.com/v1/get_ratings",
    headers={"x-api-key": API_KEY},
    json={
        "format": "test",
        "team_type": "international",
        "limit": 10,
    },
    timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]

ratings = pd.DataFrame(data["ratings"])
print(ratings[["rank", "name", "rating", "matches"]])
gap = ratings.loc[0, "rating"] - ratings.loc[1, "rating"]
print(ratings.loc[0, "name"], "beats", ratings.loc[1, "name"], round(1 / (1 + 10 ** (-gap / 400)), 3))

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.

{
  "format": "test",
  "active_since": "2024-11-04",
  "ratings": [
    {
      "rank": 1,
      "team_id": "australia",
      "name": "Australia",
      "gender": "male",
      "team_type": "international",
      "rating": 1658,
      "matches": 233,
      "as_of": "2026-10-27"
    },
    {
      "rank": 2,
      "team_id": "south-africa",
      "name": "South Africa",
      "gender": "male",
      "team_type": "international",
      "rating": 1618,
      "matches": 195,
      "as_of": "2026-10-27"
    },
    "...8 more"
  ],
  "count": 10,
  "method": "Our Elo per format from every decided, tied or drawn match since 2001 in the record: start 1500, a tie or draw scores a half, K shrinks with matches played. Franchises and countries are separate pools by fixture, men's and women's sides separate teams."
}

What to do next

  • get_match (5 credits). Both sides' ratings before and after any match.
  • get_schedule (2 credits). Upcoming matches with both sides' ratings.

More guides

The same guide for other sports

Start with 500 free credits every month

No card. REST or MCP.