Skip to content

Guides

How do I get anytime goalscorer odds and results for a player in Python?

One row per match with a striker's anytime goalscorer price, the number of books and whether he scored. Erling Haaland scored in 20 of 34 priced matches.

Code verified October 12, 2026. One call to get_prop_history, 10 credits.

The call

player_id comes from search_players. The price is the Yes side, in over_odds, and there is no line. A match where he was not in the squad has result null and is a void.

import requests
import pandas as pd

API_KEY = "YOUR_API_KEY"

resp = requests.post(
    "https://mcp.strikerapi.com/v1/get_prop_history",
    headers={"x-api-key": API_KEY},
    json={
        "player_id": "253989",
        "market": "player_goal_scorer_anytime",
        "from_date": "2025-08-01",
        "to_date": "2026-05-31",
    },
    timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]

def implied(odds):
    return 100 / (odds + 100) if odds > 0 else -odds / (-odds + 100)

games = pd.DataFrame(data["games"])
played = games[games["result"].notna()].copy()    # a void (not in the squad) has no result
played["implied"] = played["over_odds"].map(implied)
played["scored"] = played["result"] == "over"
print(data["player_name"], "-", len(games), "priced matches,", len(games) - len(played), "void")
print(played[["game_date", "over_odds", "books", "actual", "scored"]].head(8).to_string(index=False))
print("average price implies", round(played["implied"].mean(), 3), "| scored in", round(played["scored"].mean(), 3))
print(played.groupby(pd.cut(played["implied"], [0, 0.55, 0.65, 1]), observed=True)["scored"].agg(["mean", "count"]).round(2))

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.

{
  "player_id": "253989",
  "player_name": "Erling Braut Haaland",
  "market": "player_goal_scorer_anytime",
  "stat": "goals",
  "bookmaker": null,
  "games": [
    {
      "game_id": "740602",
      "game_date": "2025-08-16",
      "line": null,
      "open_line": null,
      "over_odds": -120,
      "under_odds": null,
      "books": 2,
      "actual": 2,
      "result": "over",
      "margin": null
    },
    {
      "game_id": "740613",
      "game_date": "2025-08-23",
      "line": null,
      "open_line": null,
      "over_odds": -160,
      "under_odds": null,
      "books": 2,
      "actual": 0,
      "result": "under",
      "margin": null
    },
    {
      "game_id": "740617",
      "game_date": "2025-08-31",
      "line": null,
      "open_line": null,
      "over_odds": -120,
      "under_odds": null,
      "books": 2,
      "actual": 1,
      "result": "over",
      "margin": null
    },
    "...31 more"
  ],
  "count": 34,
  "summary": {
    "games": 34,
    "graded": 34,
    "overs": 20,
    "unders": 14,
    "pushes": 0,
    "over_rate": 0.588,
    "avg_line": null,
    "avg_actual": 0.8
  },
  "truncated": false,
  "next_from_date": null
}

What to do next

  • get_player_props (10 credits). Every sportsbook's anytime goalscorer price for all the players in one match.
  • get_shot_map (10 credits). Where the player's shots came from, with expected goals on each.

More guides

Start with 500 free credits every month

No card. REST or MCP.