Live now!

Progress of current post

How-to build a match page with odds using Sportmonks’ Football API

Welcome to our comprehensive “How-to build a match page with Odds using Sportmonks’ Football API” guide. This in-depth guide covers everything you need to know about designing match pages, emphasising their importance and providing a detailed walkthrough on leveraging our Football API to achieve this.

Without further ado, let’s dive in and commence building your match page with odds!

Published 1 March 2024
Last updated 10 December 2024
Wesley Van Rooij
How-to build a match page with odds using Sportmonks’ Football API
Contents

What is a match page with odds?

A match page with odds is a dynamic interface furnishing real-time global football match updates supplemented with betting odds. It grants users immediate access to live scores, match statistics, team lineups, and pertinent betting opportunities, enhancing their engagement with ongoing matches.

These pages typically encompass a diverse array of football leagues, accommodating the varied interests of football enthusiasts worldwide. Whether it encompasses the English Premier League, La Liga, Serie A, or international tournaments like the FIFA World Cup, a match page with odds ensures betting experts remain up-to-date with the latest developments in their favoured matches.

So, what prompts the choice to construct a match page with odds utilising Sportmonks’ Football API?

Why opt for a match page with odds using Sportmonks’ Football API?

Thinking about creating a match page with odds? Well, using the Sportmonks Football API is like hitting the jackpot! Here’s why picking this API for your odds-packed match page is a total win:

  • Engaged users: Access to an array of football data, encompassing live scores, events, match statistics, and player insights, ensures your match page with odds delivers accurate and comprehensive information, fostering user engagement.
  • Seamless integration and implementation: Crafted with developers in mind, Sportmonks’ Football API is user-friendly and seamlessly integrates into your website or application. Detailed documentation and swift support facilitate swift implementation, saving development time and effort.
  • Customisation: Tailor the data and features available on your match page with odds to align with your audience’s preferences. Whether prioritising specific leagues, teams, or match events, the API can be configured to suit your precise requirements.
  • Premium Odds Feed: Ready to take your betting game to the next level? Introducing Sportmonks Premium Odds Feed, powered by TXODDS! With data from 180 bookmakers and 42 betting markets, you’ll have the edge you need to make informed decisions. Our odds data ensures you’re always in the know, giving you the ultimate betting experience.

How-to build a match page with Odds using Sportmonks’ Football API

STEP 1: GATHER YOUR TOOLS

Firstly, ensure you have all the necessary tools to kickstart your match odds page project. Here’s what you’ll need:

  • API Token: Begin by obtaining your Sportmonks API token. If you haven’t got one yet, simply head to MySportmonks and create your token.
  • Code Editor: Having a reliable code editor for crafting and refining your page’s code is crucial. We suggest using Visual Studio Code, though any editor you choose will suffice.
  • Postman (Optional): While not essential, having Postman installed can significantly assist in testing and debugging your API requests. Refer to our Postman Guide for a comprehensive guide on using the Sportmonks Football API with Postman.

With these tools, you can construct your match odds page with Sportmonks’ Football API. Let’s get started!

STEP 2: CHOOSE YOUR DISPLAYED LEAGUES

Now that we’ve got our tools ready let’s have some fun deciding what we’re betting on.

Think about which football leagues get you excited to place those bets. Are you covering many of them or focusing on specific ones like the Bundesliga, La Liga, or the English Premier League? Make sure the leagues you choose match up with your subscription plan. Check out our coverage page to see which leagues are included per plan. And if you need a list of all the leagues currently in your plan, the “All Leagues” endpoint has you covered.

Remember: If your plan doesn’t cover matches in the leagues you pick, you won’t get data from the fixtures/livescores API. Keep that in mind while making your choices. Let’s keep the odds in our favour!

STEP 3: Pick your bookmakers and markets

Now that our game plan is ready, let’s spice things up by deciding which markets and bookmakers we want to display.

With thousands of markets to choose from—think 3-way results, home/away, first card received, and Asian handicap—it’s like having various betting options at your fingertips.

But that’s not all! You’ve also got a lineup of bookmakers, including big names like 10bet, bet365, 188bet, and many more.

To see the full range of markets and bookmakers we offer, check out these two endpoints:

  • Markets endpoint: https://api.sportmonks.com/v3/odds/markets?api_token=YOUR_TOKEN
  • Bookmaker endpoint: https://api.sportmonks.com/v3/odds/bookmakers?api_token=YOUR_TOKEN

Just plug in your API token and fire up these requests

Remember, the domain in the URL is odds instead of football. So, pick your market and bookie, and let the betting begin!

Step 4: Choose your endpoint

Now that we’re in the thick of it let’s ensure we’re heading down the right path with our odds endpoints.

Our API offers a variety of odds endpoints to suit your needs:

But here’s a tip: Many users find it handy to request pre-match or in-play odds alongside the livescores or fixtures endpoint and then include odds or inplayOdds. This way, you can filter on both “bookmakers” and “markets” simultaneously, giving you more control over your choices.

So, whether you’re planning or diving into the action, choose the endpoint that fits your game plan, and let’s roll the dice!

Step 5: Build your API request

Now that we’ve set our game plan, it’s time to make our request and get those odds rolling.

In this example, we aim for the 3-way result market (market id: 1) and bet365 as our bookmaker (bookmaker id: 2). We’ll be diving into the Eredivisie showdown between PSV (Team ID: 682) and Feyenoord (Team ID: 72) which, as of now, is yet to kick off. (Fixture ID= 18854206),

We’ll be serving up both live and pre-match odds, so get ready to feast on the action with this request:

Pre-match odds: https://api.sportmonks.com/v3/football/fixtures/18854206?api_token=YOUR_TOKEN&include=odds&filters=bookmakers:2;markets:1

Inplay odds: https://api.sportmonks.com/v3/football/fixtures/18854206?api_token=YOUR_TOKEN&include=inplayOdds&filters=bookmakers:2;markets:1

Are you interested in more information about filtering? Check out our Filtering Tutorial. 

{
  "data": {
    "id": 18854206,
    "sport_id": 1,
    "league_id": 72,
    "season_id": 21730,
    "stage_id": 77464344,
    "group_id": null,
    "aggregate_id": null,
    "round_id": 308426,
    "state_id": 1,
    "venue_id": 181,
    "name": "PSV vs Feyenoord",
    "starting_at": "2024-03-03 13:30:00",
    "result_info": null,
    "leg": "1/1",
    "details": null,
    "length": 90,
    "placeholder": false,
    "has_odds": true,
    "starting_at_timestamp": 1709472600,
    "odds": [
      {
        "id": 88251326003,
        "fixture_id": 18854206,
        "market_id": 1,
        "bookmaker_id": 2,
        "label": "Away",
        "value": "3.50",
        "name": null,
        "sort_order": 2,
        "market_description": "Full Time Result",
        "probability": "28.57%",
        "dp3": "3.500",
        "fractional": "7/2",
        "american": "250",
        "winning": false,
        "stopped": false,
        "total": null,
        "handicap": null,
        "participants": null,
        "created_at": "2024-02-25T17:59:55.000000Z",
        "original_label": "2",
        "latest_bookmaker_update": "2024-02-27 15:13:33"
      },
      {
        "id": 88251326002,
        "fixture_id": 18854206,
        "market_id": 1,
        "bookmaker_id": 2,
        "label": "Draw",
        "value": "3.50",
        "name": null,
        "sort_order": 1,
        "market_description": "Full Time Result",
        "probability": "28.57%",
        "dp3": "3.500",
        "fractional": "7/2",
        "american": "250",
        "winning": false,
        "stopped": false,
        "total": null,
        "handicap": null,
        "participants": null,
        "created_at": "2024-02-25T17:59:55.000000Z",
        "original_label": "Draw",
        "latest_bookmaker_update": "2024-02-27 15:13:33"
      },
      {
        "id": 88251326001,
        "fixture_id": 18854206,
        "market_id": 1,
        "bookmaker_id": 2,
        "label": "Home",
        "value": "2.00",
        "name": null,
        "sort_order": 0,
        "market_description": "Full Time Result",
        "probability": "50%",
        "dp3": "2.000",
        "fractional": "2",
        "american": "100",
        "winning": false,
        "stopped": false,
        "total": null,
        "handicap": null,
        "participants": null,
        "created_at": "2024-02-25T17:59:55.000000Z",
        "original_label": "1",
        "latest_bookmaker_update": "2024-02-27 15:13:33"
      }
    ]
  },

Step 6: Understanding the API response

Now that we’ve made the API request, let us evaluate what the response is.

You’ll find the betting values per possible outcome—home team wins (label 1), draw (label X), and visitor team wins (label 2). These values represent the odds at the time of your request.

If you’re into live-action, keep an eye on the inplayOdds. They’ll give you the same output format as pre-match odds but will be dynamically updated throughout the match, keeping you in the loop with the latest odds changes.

For further betting insights, dive into our How-to Use the Predictions API guide.

This knowledge lets you make informed decisions and improve your betting game. Let’s turn those odds into wins!

Congratulations

Well done! With all your tools in place, it’s time to get inspired and start crafting your odds page. Take a peek at these fantastic websites for some inspiration!

Now that you’ve got the know-how and the creativity let your imagination run wild. Build something unique and share your passion for betting with the world.

So go ahead, dive in, and let’s see what you can create!

Frequently Asked Questions (FAQ)

Do you offer historical odds?
Our API provides a history of odds for fixtures for up to 7 days after kick-off (starting_at). Additionally, we offer the history of changes of each odd. We document the opening odds for each fixture; subsequently, all changes and updates are stored and accessible for your use.
How often are the odds updated?
Our pre-match odds are updated around every 10 minutes. Meaning (worst-case scenario) it can take up to 20 minutes before a change on the bookmakers' site is available in our API feed. Our inplayOdds refresh every second, so that should be pretty much instant.
How to get the lastest odds available?
The best way to achieve this is to request the "odds/pre-match/latest" endpoint every 5 seconds. This way, you only get the odds as close as real-time. The endpoint itself returns odds that were updated within 10 seconds. So, if you request the endpoint every 10 seconds, you may miss some values because making a request also takes some time (can take around ±1 second). Within that second, you are prone to missing updates.
Do you offer winning odds?
We are happy to provide you with more information about our winning odds. Winning odds are calculated automatically during or after a match. Winning odds determine whether an odd has 'won' or not. For example, if the market for an odd was over 2.5 goals and there were 3 goals in that match, the odd will be set to "winning": "true". If there were less than 3 goals in that match, the odd will be set to "winning": "false". Please note that not all markets we cover have winning odds calculations. Every market has a flag marking whether you can expect winning odds for it. You can check the markets here:
Which bookmakers are available in the Premium Odds Feed?
To access the comprehensive list of bookmakers included in our Premium Odds Feed, kindly navigate to the following link: Premium Odds Feed - Bookmakers This link will provide detailed information regarding the bookmakers available, including their bookmaker ID, ensuring transparency and accessibility to our valued users. Please do not hesitate to reach out if you require further assistance or have any additional inquiries.  
Which markets are available in the Premium Odds Feed?
To access the comprehensive list of markets included in our Premium Odds Feed, kindly navigate to the following link: Premium Odds Feed - Markets This link will provide detailed information regarding the markets available, including their market ID, ensuring transparency and accessibility to our valued users. Please do not hesitate to reach out if you require further assistance or have any additional inquiries.
What is the difference between the Standard and Premium Odds Feed?
We would happily explain the difference between our Standard and Premium Odds feeds. First, our Premium Odds feed is developed in partnership with TXOdds, a highly reputable odds provider known for its exceptional data reliability. The Premium Odds feed offers an extensive selection of 42 markets from 145+ different bookmakers, which you can review here. Additionally, we meticulously document the opening odds for each fixture, and all subsequent changes and updates are recorded and made accessible for your use. This functionality enables you to track the evolution of each odd and effectively present these changes to your customers.

Written by Wesley Van Rooij

Wesley van Rooij is a marketing and football expert with over 5 years of industry experience. His comprehensive knowledge of the Sportmonks Football API and a focused approach to APIs in the Sports Data industry allow him to offer insights and support to enthusiasts and businesses. His outstanding marketing and communication skills and technical writing expertise enable him to empathise with developers. He understands their needs and challenges to facilitate the development of cutting-edge football applications that stand out in the market.

Can’t wait to try this yourself? Start now with a free trial and experience the football data you deserve.

Start your free trial