LogoLogo
Quick StartFootball APIContactAPI 3.0
  • Welcome
  • Changelog
  • Getting Started
    • Get Started
    • Documentation for the documentation
  • Endpoint overview
    • Continents
      • GET All Continents
      • GET Continent by ID
    • Countries
      • GET All Countries
      • GET Country by ID
    • Leagues
      • GET All Leagues
      • GET League by ID
      • GET Leagues by Country ID
      • Search Leagues by Name
    • Seasons
      • GET All Seasons
      • GET Season by ID
    • Fixtures
      • GET Fixture by ID
      • GET Last Updated Fixtures
      • GET Fixtures by Date
      • GET Fixtures by Date Range
      • GET Fixtures by Date Range for Team
      • GET Fixtures by Multiple ID's
      • GET Deleted Fixtures
    • Statistics
    • Livescores
      • GET All Livescores
      • GET All In play Livescores
    • News API
      • GET All News
      • GET News For Upcoming Fixtures
      • GET News by Season ID
    • Commentaries
      • Commentaries by Fixture ID
    • Video Highlights
      • Get Video Highlights by Fixture ID
    • Head 2 Head
      • GET Head 2 Head by Team IDs
    • Standings
      • GET Standings by Season ID
      • GET LIVE Standings
      • GET Standings by Season ID and Round ID
      • GET Standings by Season and Date(time)
      • GET Standings Corrections by Season ID
    • Teams
      • GET Team by ID
      • GET Teams by Country ID
      • GET Teams by Season ID
      • Search Team by Name
      • GET Current Leagues by Team ID
      • Get All Leagues by Team ID
    • Players
      • GET Player by ID
      • GET Players by Country ID
      • Search Player by Name
    • Topscorers
      • GET Topscorers by Season ID
      • GET Topscorers Aggregated by Season ID
    • Rivals
      • GET Rivals by Team ID
    • Venues
      • GET Venue by ID
      • GET Venues by Season ID
    • Rounds
      • GET Rounds by Season ID
      • GET Round by ID
    • Odds
      • GET Odds by Fixture ID and Bookmaker ID
      • GET Odds by Fixture ID and Market ID
      • GET Odds by Fixture ID
      • GET Inplay Odds by Fixture ID
    • Coaches
      • GET Coach by ID
    • Stages
      • GET Stage by ID
      • GET Stages by Season ID
    • Bookmakers
      • GET All Bookmakers by Fixture ID
      • GET All Bookmakers
      • GET Bookmaker by ID
    • Markets
      • GET All Fixtures by Market ID
      • GET All Markets
      • GET Market by ID
    • Team Squads
      • GET Team Squad by Team and Season ID
    • TV Stations
      • GET TV Station by Fixture ID
    • Prediction API
      • GET Leagues and Performances
      • GET Probabilities
      • GET Probabilities by Fixture ID
      • GET Value Bets
      • GET Value Bet by Fixture ID
  • Tutorials
    • Introduction to our API
      • Make your first request
      • Set your time zone
      • Pagination
    • Enriching your response
      • Includes
      • Nested includes
    • Filtering, limiting & sorting
      • Filtering
      • Limiting
      • Sorting
    • Schedule, fixtures & livescores
      • Season schedule
      • Fixtures
      • Livescores
    • Statistics
      • Match statistics
      • Team statistics
      • Player statistics
      • Season statistics
    • League & topscorers standings
      • League standings
      • Topscorers standings
    • Odds & predictions
      • Odds
        • Odds by fixture, bookmaker and market id
        • FlatOdds
        • InplayOdds
      • Predictions
  • MySportmonks
    • How-to build a custom plan
    • ID Finder
  • How-to Guides
    • Get Started with our how-to guides
      • How-to build your API requests
    • Livescores & fixtures
      • How-to build a livescore website
      • How-to build a schedule page
    • Match & team pages
      • How-to build a match page with events and statistics
      • How-to build a match page with line-ups/formations
      • How-to build a team page with season stats and squads
    • How-to build standings and topscorer standings
      • League standings
      • Topscorer standings
    • Odds & predictions
      • How-to build a match page with odds
      • How-to build a betting odds portal
      • How-to use the predictions API
    • How-to build a fantasy game
    • Developer tools
      • How-to use Sportmonks' APIs in Postman
    • How-to keep your database in sync
    • World Cup 2022
    • EURO 2024
    • Football widgets
      • How-to set up football widgets in your web application
      • Configurations
      • Widgets overview
        • Livescore widget
        • International Cup widgets
  • API References
    • API reference guide
    • Data features
    • ID Finder
    • Code libraries
    • Demo response files
    • Statuses and definitions
    • API Rate limiting
    • Response codes
    • Meta description
  • General
  • Sportmonks
  • Plans & pricing
  • FAQ
  • Contact
Powered by GitBook
On this page
  • Step 1: Gather the tools
  • Step 2: Decide which market and bookmaker you want to use
  • Step 3: Choose the correct endpoint
  • Step 4: Make your request
  • Step 5: The API Response
  • Step 6: Example match pages with odds

Was this helpful?

Export as PDF
  1. How-to Guides
  2. Odds & predictions

How-to build a match page with odds

PreviousOdds & predictionsNextHow-to build a betting odds portal

Last updated 3 years ago

Was this helpful?

Welcome to the how-to guide about building a match page with odds. For example, what are the odds that Real Madrid will win against Bayern Munich in the Champions League? If Real Madrid has a numerical value of 2.5, while Bayern has 2, and a draw would be 1.5, then the match’s most probable outcome would be a draw. This is due to the draw being the lowest numerical odds value. In this how-to guide, we’ll walk you through the steps of creating a match page that displays pre-match and live odds. There is also a continuation guide called . There we will compare different bookmakers with each other.

Step 1: Gather the tools

You will once again be needing:

  • SportMonks API token

  • A Code editor (Visual studio used in examples)

  • Postman (optional)

You can find a link to another article where we discuss the tools in-depth on our

Step 2: Decide which market and bookmaker you want to use

There are thousands of different markets, such as 3-way results, home/away, first card received, and Asian handicap.

Besides choosing an appropriate market, you also have to choose between various bookmakers, such as 10bet, bet365, 188bet, and many more.

For a full overview of all the markets and bookmakers we offer, use these two endpoints:

https://soccer.sportmonks.com/api/v2.0/markets?api_token={API_TOKEN}
https://soccer.sportmonks.com/api/v2.0/bookmakers?api_token={API_TOKEN}

The most used market is 3-way results. The 3-way result means that there are three possible outcomes: Home team wins (label 1), draw (label X), and visitor team wins (label 2).

Step 3: Choose the correct endpoint

SportMonks provides four different odds endpoints:

https://soccer.sportmonks.com/api/v2.0/fixtures/{ID}?api_token={API_TOKEN}&include=flatOdds&markets=1&bookmakers=2
https://soccer.sportmonks.com/api/v2.0/odds/inplay/fixture/{ID}/?api_token={API_TOKEN}

Step 4: Make your request

For this guide, we’ll be requesting the 3-way result market (market id: 1) and bet365 as our bookmaker (bookmaker id: 2).

Let's analyze a Champions League match between Dynamo Kiev vs Barcelona. At the time of writing this match has yet to be played so it's perfect for an example. Its fixture id is 17361241. We’ll show you both live and pre-match odds:

https://soccer.sportmonks.com/api/v2.0/fixtures/17361241?api_token={API_TOKEN}&include=flatOdds,localTeam,visitorTeam&markets=1&bookmakers=2
https://soccer.sportmonks.com/api/v2.0/odds/inplay/fixture/1736124?api_token={API_TOKEN}&include=localTeam,visitorTeam

These requests will return the live or pre-match odds, as well as the local and visitor teams. We added the includes localTeam,visitorTeam, because we want to have more information about the teams.

Step 5: The API Response

  "localTeam": {
            "data": {
                "id": 556,
                "legacy_id": 172,
                "name": "Dynamo Kyiv",
                "short_code": null,
                "twitter": null,
                "country_id": 86,
                "national_team": false,
                "founded": 1927,
                "logo_path": "https://cdn.sportmonks.com/images//soccer/teams/12/556.png",
                "venue_id": 104,
                "current_season_id": 17381
            }
        },
        "visitorTeam": {
            "data": {
                "id": 83,
                "legacy_id": 130,
                "name": "Barcelona",
                "short_code": "FCB",
                "twitter": "@FCBarcelona",
                "country_id": 32,
                "national_team": false,
                "founded": 1899,
                "logo_path": "https://cdn.sportmonks.com/images//soccer/teams/19/83.png",
                "venue_id": 9236,
                "current_season_id": 17480
            }
        },
        "flatOdds": {
            "data": [
                {
                    "bookmaker_id": 2,
                    "bookmaker_event_id": 95198504,
                    "market_id": 1,
                    "suspended": false,
                    "odds": [
                        {
                            "label": "1",
                            "value": "8.00",
                            "extra": null,
                            "probability": "12.5%",
                            "dp3": "8.0000",
                            "american": 700,
                            "factional": null,
                            "handicap": null,
                            "total": null,
                            "winning": null,
                            "stop": false,
                            "last_update": {
                                "date": "2020-11-18 16:24:12.069667",
                                "timezone_type": 3,
                                "timezone": "UTC"
                            }
                        },
                        {
                            "label": "X",
                            "value": "5.00",
                            "extra": null,
                            "probability": "20%",
                            "dp3": "5.0000",
                            "american": 400,
                            "factional": null,
                            "handicap": null,
                            "total": null,
                            "winning": null,
                            "stop": false,
                            "last_update": {
                                "date": "2020-11-18 16:24:12.069680",
                                "timezone_type": 3,
                                "timezone": "UTC"
                            }
                        },
                        {
                            "label": "2",
                            "value": "1.36",
                            "extra": null,
                            "probability": "73.37%",
                            "dp3": "1.3630",
                            "american": -276,
                            "factional": null,
                            "handicap": null,
                            "total": null,
                            "winning": null,
                            "stop": false,
                            "last_update": {
                                "date": "2020-11-18 16:24:12.069699",
                                "timezone_type": 3,
                                "timezone": "UTC"
                            }
                        }

You can see the betting values per possible outcome. As you know, market has three possible outcomes: Home team wins (label 1), draw (label X), and visitor team wins (label 2). The value represents the odds at the time of requesting.

inplayOdds will show you the same output format asflatOddsbut will be changed actively throughout the match.

Step 6: Example match pages with odds

Congratulations! You now have all the tools ready to create your own odds page. Have a look at this fantastic website for some inspiration!

In the next how-to guide, we'll be discussing how you can build an odds portal.

d

However, many users prefer to request pre-match odds with the and then include flatOdds. This request allows the user to filter on the parameters 'bookmakers' and 'markets' at the same time, rather than only being able to choose either bookmaker or market.

For live odds, we only offer all the markets from bet365. Therefore, the bookmaker and market have already been pre-defined with bookmaker id = 2. For live odds, you can use our endpoint, or use the inplayOdds include our So the example URLs will be:

Note that we use flatOddshere for pre-match odds, but we also have a different include calledoddsandoddComparisonthat is used for the . For more information regarding odds, see our

Also, our predictions are included In this match. Barcelona has the highest probability of winning with 73.37%, followed by a draw (20%) and Dynamo Kiev winning (12.5%). More information is available in our and .

how-to build a betting odds portal
Developer Tools Guide.
Markets endpoint
Bookmaker endpoint
Odds by Fixture and Bookmaker i
Odds by fixture and Market id
Odds by fixture id
Inplay odds by fixture id
Odds as include
fixture by id endpoint
inplay odds by fixture id
livescore/now endpoint.
betting odds portal
odds tutorial.
predictions tutorial
how-to use the predictions API guide