How do I compare in-play cricket odds with a win probability model?
At each in-play price, the median margin-free price, our win probability after the last ball bowled before it, the score and the gap.
Code verified November 3, 2026. One call to get_market_vs_model, 10 credits.
The call
T20s, ODIs and one-day matches where we hold in-play prices and ball times. Prices are from team 1's side.
import requests
import pandas as pd
API_KEY = "YOUR_API_KEY"
resp = requests.post(
"https://mcp.yorkerapi.com/v1/get_market_vs_model",
headers={"x-api-key": API_KEY},
json={
"match_id": "1422119",
},
timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]
snaps = pd.DataFrame(data["snapshots"])
print(snaps[["last_ball", "runs", "wickets", "market_team1", "model_team1", "gap"]])
print("widest gap", data["widest_gap"]["gap"], "after", data["widest_gap"]["last_ball"])
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.
{
"match_id": "1422119",
"team1_id": "royal-challengers-bengaluru",
"team2_id": "chennai-super-kings",
"winner_id": "chennai-super-kings",
"snapshots": [
{
"snapshot_at": "2024-03-22 15:10:39+00",
"market_team1": 0.3769,
"books": 28,
"innings": 1,
"last_ball": "8.6",
"last_ball_at": "2024-03-22 15:10:14+00",
"runs": 63,
"wickets": 3,
"model_team1": 0.2696,
"gap": -0.1073
},
{
"snapshot_at": "2024-03-22 15:25:39+00",
"market_team1": 0.2259,
"books": 28,
"innings": 1,
"last_ball": "11.4",
"last_ball_at": "2024-03-22 15:23:09+00",
"runs": 78,
"wickets": 5,
"model_team1": 0.1733,
"gap": -0.0526
},
"...9 more"
],
"widest_gap": {
"snapshot_at": "2024-03-22 17:40:39+00",
"market_team1": 0.2105,
"books": 27,
"innings": 2,
"last_ball": "11.4",
"last_ball_at": "2024-03-22 17:40:21+00",
"runs": 106,
"wickets": 3,
"model_team1": 0.4269,
"gap": 0.2164
},
"count": 11,
"method": "market_team1 is the median margin-free in-play price on team 1 across books. model_team1 is our win probability after the last ball bowled before that snapshot, from team 1's side. gap is model minus market."
}What to do next
- get_win_probability (10 credits). The model's whole line for the match, over by over.
- get_line_movement (10 credits). Every pregame price before the same match.
More guides
Start with 500 free credits every month
No card. REST or MCP.