tutorial

How to Get Player Props via API: A Developer Guide

How to Get Player Props via API

Developers can get player props via API by querying pre-match market feeds for specific football events. This process involves identifying the correct event ID, filtering for player-specific market groups, and parsing the normalised JSON response to extract lines and odds. By using a managed data feed, you avoid the technical overhead and fragility associated with scraping bookmaker websites directly.

section: developer looking at json data, clean workspace, minimalist aesthetic

Prerequisites

To follow this tutorial, you need a few basic tools and access to a reliable data source. Most professional integrations require the following setup:

  • An active API key from a provider like UK Odds API.
  • A programming environment set up for HTTP requests, such as Python with the requests library or Node.js with native fetch.
  • Familiarity with JSON parsing to handle nested market structures.
  • A clear understanding of the event ID you wish to query for player-specific markets.

Step 1: Fetching the Event ID

Before you can access player props, you must locate the specific football fixture. You can search for events by date to retrieve a list of available matches. This step ensures you have the correct event ID required for subsequent market queries.

import requests

API_KEY = "YOUR_API_KEY"
BASE = "https://api.ukoddsapi.com"
headers = {"X-Api-Key": API_KEY}

params = {
    "schedule_date": "2026-05-15",
    "has_odds": "true"
}

response = requests.get(f"{BASE}/v1/football/events", headers=headers, params=params)
events = response.json()
event_id = events["events"][0]["event_id"]

The response includes an array of event objects. Each object contains the event ID, league name, and the teams involved. You should store the event ID to use in the next step, where you will request the detailed market data.

Step 2: Querying Player Prop Markets

Once you have the event ID, you can request the full odds package. Player props, such as player to score or total shots, are typically found within the full market package. Ensure your request specifies the correct package to include these advanced markets.

url = f"{BASE}/v1/football/events/{event_id}/odds"
params = {"package": "full", "odds_format": "decimal"}

response = requests.get(url, headers=headers, params=params)
data = response.json()

The JSON response returns a structured list of markets. You need to iterate through the markets array to find groups labeled as player props or specific scorer markets. The structure provides the selection name, the current line, and the decimal odds offered by various bookmakers.

{
  "event_id": "EV12345",
  "markets": [
    {
      "market_name": "Anytime Goalscorer",
      "market_group": "scorer",
      "selections": [
        {
          "selection_name": "Harry Kane",
          "odds": 1.95,
          "bookmaker_code": "UO001"
        }
      ]
    }
  ]
}

section: close up of code editor, focus on json structure, soft lighting

Step 3: Normalising the Data

After retrieving the JSON, you often need to normalise the data for your application. Since different bookmakers might use slightly different naming conventions for players, mapping these to a consistent internal ID system is a common best practice.

const market = data.markets.find(m => m.market_group === 'scorer');
const playerOdds = market.selections.map(s => ({
    player: s.selection_name,
    price: s.odds,
    provider: s.bookmaker_code
}));

This step transforms the raw API response into a clean format that your frontend or database can consume. By filtering for the specific market group, you isolate the player props from other match-winner or total-goals markets, allowing for a cleaner data pipeline.

Common mistakes

  • Requesting the core package instead of the full package when player props are missing.
  • Hardcoding event IDs instead of fetching them dynamically from the event list endpoint.
  • Failing to handle pagination when querying events for a busy match day.
  • Ignoring the status field in the selection object, which indicates if a market is suspended.
  • Not implementing a retry mechanism for transient network errors during high-traffic periods.

Options and alternatives

Approach Reliability Maintenance Data Depth
Managed API High Low High
Custom Scraper Low Very High Variable
Manual Data Entry Low Extreme Low

Using a managed API provides a consistent JSON structure and reliable uptime. In contrast, custom scrapers often break when bookmakers update their site layout, leading to significant maintenance debt.

FAQ

Can I get player props for all football leagues?

Coverage depends on the specific bookmaker data available for a given fixture. Most major leagues are well-supported, but lower-tier matches may have limited player prop market availability.

How do I handle different odds formats?

Most professional APIs allow you to specify the format in your request parameters. By setting the odds_format parameter to decimal, you ensure consistent data across all bookmaker sources.

What should I do if a market is missing?

First, verify that you are requesting the full package. If the market is still missing, it is likely that no bookmakers are currently offering odds for that specific prop for that fixture.

How often should I refresh the data?

For pre-match markets, polling frequency should be balanced against your rate limits. A refresh interval of a few minutes is usually sufficient for pre-match lines, as they do not change as rapidly as in-play odds.

Is the data normalised?

Yes, professional APIs normalise data from multiple bookmakers into a single, consistent JSON format. This allows you to compare odds across different providers without writing custom parsers for each one.

Conclusion

Integrating player props into your application allows for deeper user engagement and more sophisticated betting analysis. By choosing a robust, pre-match football odds JSON feed, you bypass the complexities of scraping and focus on building features that matter to your users.

For developers looking to streamline their data pipeline, UK Odds API offers a reliable, normalised feed covering 27 UK bookmakers.