How do I get first half soccer odds history in Python?
Each sportsbook's opening and closing 1st half total for a match, the market behind most half-time models.
Code verified November 3, 2026. One call to get_market_odds, 10 credits.
The call
game_id comes from list_games. 1st half result is h2h_h1 and the handicap is spreads_h1.
import requests
import pandas as pd
API_KEY = "YOUR_API_KEY"
resp = requests.post(
"https://mcp.strikerapi.com/v1/get_market_odds",
headers={"x-api-key": API_KEY},
json={
"game_id": "401878763",
"market": "totals_h1",
},
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 strikerapi
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": "401878763",
"market": "totals_h1",
"label": "1st half total goals",
"scheduled_start": "2026-10-31T15:00:00.000Z",
"books": [
{
"bookmaker": "fanduel",
"opening": [
{
"outcome": "Over",
"point": 0.5,
"price": -290
},
{
"outcome": "Under",
"point": 2.5,
"price": -1200
}
],
"opening_captured_at": "2026-10-31T14:25:36.000Z",
"closing": [
{
"outcome": "Over",
"point": 0.5,
"price": -290
},
{
"outcome": "Under",
"point": 2.5,
"price": -1200
}
],
"closing_captured_at": "2026-10-31T14:25:36.000Z",
"minutes_before_start": 34.4
},
{
"bookmaker": "pinnacle",
"opening": [
{
"outcome": "Over",
"point": 1,
"price": -121
},
{
"outcome": "Under",
"point": 1,
"price": 103
}
],
"opening_captured_at": "2026-10-31T14:25:36.000Z",
"closing": [
{
"outcome": "Over",
"point": 1,
"price": -121
},
{
"outcome": "Under",
"point": 1,
"price": 103
}
],
"closing_captured_at": "2026-10-31T14:25:36.000Z",
"minutes_before_start": 34.4
}
],
"count": 2
}What to do next
- get_events (10 credits). Every event in the match with its minute, to settle a half-time bet.
- get_odds (5 credits). The full-match moneylines, handicap and total.
More guides
The same guide for other sports
- PuckAPI: How do I get NHL opening and closing odds by sportsbook in Python?
- EndzoneAPI: How do I backtest NFL closing lines in Python?
- FighterAPI: How do I compare UFC closing odds with fight results in Python?
- DunkAPI: How do I backtest NBA closing lines in Python?
- AcesAPI: How do I compare ATP closing odds with the result and Elo in Python?
- BirdieAPI: How do I turn golf major winner odds into probabilities in Python?
- FastballAPI: How do I backtest MLB closing moneylines and run totals in Python?
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.