Skip to content

Guides

How do I get NRFI odds history in Python?

Each sportsbook's opening and closing 1st inning total for a game. Under the 0.5 line is no run in the first inning (NRFI), over is a run.

Code verified November 3, 2026. One call to get_market_odds, 10 credits.

The call

game_id comes from get_games. Fewer books post this market than the full game.

import requests
import pandas as pd

API_KEY = "YOUR_API_KEY"

resp = requests.post(
    "https://mcp.fastballapi.com/v1/get_market_odds",
    headers={"x-api-key": API_KEY},
    json={
        "game_id": "401696176",
        "market": "totals_1st_1_innings",
    },
    timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]

books = pd.DataFrame([
    {"book": b["bookmaker"], **{f'{o["outcome"]} {o["point"] if o["point"] is not None else ""}'.strip(): o["price"] for o in b["closing"]}}
    for b in data["books"]
])
print(data["label"])
print(books)

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.

Or use the official client: pip install fastballapi

What comes back

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

{
  "game_id": "401696176",
  "market": "totals_1st_1_innings",
  "label": "1st inning total runs (the 0.5 line is no run / a run in the 1st)",
  "scheduled_start": "2025-07-01T01:40:00.000Z",
  "books": [
    {
      "bookmaker": "betmgm",
      "opening": [
        {
          "outcome": "Over",
          "point": 0.5,
          "price": 118
        },
        {
          "outcome": "Under",
          "point": 0.5,
          "price": -150
        }
      ],
      "opening_captured_at": "2025-07-01T01:10:38.000Z",
      "closing": [
        {
          "outcome": "Over",
          "point": 0.5,
          "price": 118
        },
        {
          "outcome": "Under",
          "point": 0.5,
          "price": -150
        }
      ],
      "closing_captured_at": "2025-07-01T01:10:38.000Z",
      "minutes_before_start": 29.4
    },
    "...4 more"
  ],
  "count": 6
}

What to do next

More guides

The same guide for other sports

The latest lines from every book are on the odds board. Rather ask Claude? 16 free Claude skills call these endpoints for you.

Start with 500 free credits every month

No card. REST or MCP.