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: Make our request
  • Step 2: The API response
  • Step 3: Example Page
  • Conclusion

Was this helpful?

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

How-to use the predictions API

PreviousHow-to build a betting odds portalNextHow-to build a fantasy game

Last updated 2 years ago

Was this helpful?

We have discussed how our prediction API works in-depth in our . In this how-to guide, we’ll show you how to implement the predictions of the Champions League group stage. Our prediction API is based on the latest machine learning techniques, which will give you the best predictions possible.

We’ll only be discussing probabilities per match. For the value bet and player contribution models, you can refer to our

Step 1: Make our request

First some general information about the Champions League:

  • League id: 2

  • Current season id: 17299

  • Current stage (Group stage) id: 77448760

  • Current round id: 211704

At the time of writing, the Champions League is in its third round of the group stages. The dates are from 2020-11-03 to 2020-11-04

We use the following URL:

 https://soccer.sportmonks.com/api/v2.0/fixtures/between/2020-11-03/2020-11-04?api_token={API_TOKEN}&include=localTeam,visitorTeam&leagues=2
"data": [
        {
            "id": 17361016,
            "league_id": 2,
            "season_id": 17299,
            "stage_id": 77448760,
            "round_id": 211704,
            "group_id": 244365,
            "aggregate_id": null,
            "venue_id": 177923,
            "referee_id": 16994,
            "localteam_id": 490,
            "visitorteam_id": 7980,
            "winner_team_id": null,
            "weather_report": {
                "code": "clouds",
                "type": "overcast clouds",
                "icon": "https://cdn.sportmonks.com/images/weather/04n.png",
                "temperature": {
                    "temp": 45.77,
                    "unit": "fahrenheit"
                },
                "temperature_celcius": {
                    "temp": 7.7,
                    "unit": "celcius"
                },
                "clouds": "90%",
                "humidity": "100%",
                "pressure": 1026,
                "wind": {
                    "speed": "8.95 m/s",
                    "degree": 170
                },
                "coordinates": {
                    "lat": 55.75,
                    "lon": 37.62
                },
                "updated_at": "2020-11-03T19:45:07.664160Z"
            },
            "commentaries": true,
            "attendance": 8147,
            "pitch": null,
            "details": null,
            "neutral_venue": false,
            "winning_odds_calculated": true,
            "formations": {
                "localteam_formation": "4-4-2",
                "visitorteam_formation": "4-3-2-1"
            },
            "scores": {
                "localteam_score": 1,
                "visitorteam_score": 1,
                "localteam_pen_score": null,
                "visitorteam_pen_score": null,
                "ht_score": "1-1",
                "ft_score": "1-1",
                "et_score": null,
                "ps_score": null
            },
            "time": {
                "status": "FT",
                "starting_at": {
                    "date_time": "2020-11-03 17:55:00",
                    "date": "2020-11-03",
                    "time": "17:55:00",
                    "timestamp": 1604426100,
                    "timezone": "UTC"
                },
                "minute": 94,
                "second": null,
                "added_time": null,
                "extra_minute": null,
                "injury_time": null
            },
            "coaches": {
                "localteam_coach_id": 1068613,
                "visitorteam_coach_id": 452946
            },
            "standings": {
                "localteam_position": 4,
                "visitorteam_position": 2
            },
            "assistants": {
                "first_assistant_id": 12172,
                "second_assistant_id": 12128,
                "fourth_official_id": 15839
            },
            "leg": "1/1",
            "colors": {
                "localteam": {
                    "color": "#F0F0F0",
                    "kit_colors": "#F0F0F0,#F0F0F0,#F0F0F0,#F0F0F0,#C40010,#0046A8,#F0F0F0"
                },
                "visitorteam": {
                    "color": "#002B87",
                    "kit_colors": "#002B87,#002B87,#002B87,#002B87,#C40010,#0046A8,#002B87"
                }
            },
            "deleted": false,
            "localTeam": {
                "data": {
                    "id": 490,
                    "legacy_id": 501,
                    "name": "Lokomotiv Moskva",
                    "short_code": null,
                    "twitter": null,
                    "country_id": 227,
                    "national_team": false,
                    "founded": 1923,
                    "logo_path": "https://cdn.sportmonks.com/images//soccer/teams/10/490.png",
                    "venue_id": 177923,
                    "current_season_id": 17288
                }
            },
            "visitorTeam": {
                "data": {
                    "id": 7980,
                    "legacy_id": 113,
                    "name": "Atlético Madrid",
                    "short_code": "ATM",
                    "twitter": "@Atleti",
                    "country_id": 32,
                    "national_team": false,
                    "founded": 1903,
                    "logo_path": "https://cdn.sportmonks.com/images//soccer/teams/12/7980.png",
                    "venue_id": 140808,
                    "current_season_id": 17480
                }
            }
        },
        {
            "id": 17361028,
            "league_id": 2,
            "season_id": 17299,
            "stage_id": 77448760,
            "round_id": 211704,
            "group_id": 244366,
            "aggregate_id": null,
            "venue_id": 8829,
            "referee_id": 17308,
            "localteam_id": 621,
            "visitorteam_id": 683,
            "winner_team_id": 683,
            "weather_report": {
                "code": "clouds",
                "type": "overcast clouds",
                "icon": "https://cdn.sportmonks.com/images/weather/04n.png",
                "temperature": {
                    "temp": 48.11,
                    "unit": "fahrenheit"
                },
                "temperature_celcius": {
                    "temp": 9,
                    "unit": "celcius"
                },
                "clouds": "90%",
                "humidity": "87%",
                "pressure": 1025,
                "wind": {
                    "speed": "6.71 m/s",
                    "degree": 80
                },
                "coordinates": {
                    "lat": 50,
                    "lon": 36.25
                },
                "updated_at": "2020-11-03T19:30:32.966719Z"
            },
            "commentaries": true,
            "attendance": null,
            "pitch": null,
            "details": null,
            "neutral_venue": false,
            "winning_odds_calculated": true,
            "formations": {
                "localteam_formation": "4-1-4-1",
                "visitorteam_formation": "4-2-3-1"
            },
            "scores": {
                "localteam_score": 0,
                "visitorteam_score": 6,
                "localteam_pen_score": null,
                "visitorteam_pen_score": null,
                "ht_score": "0-4",
                "ft_score": "0-6",
                "et_score": null,
                "ps_score": null
            },
            "time": {
                "status": "FT",
                "starting_at": {
                    "date_time": "2020-11-03 17:55:00",
                    "date": "2020-11-03",
                    "time": "17:55:00",
                    "timestamp": 1604426100,
                    "timezone": "UTC"
                },
                "minute": 93,
                "second": null,
                "added_time": null,
                "extra_minute": null,
                "injury_time": null
            },
            "coaches": {
                "localteam_coach_id": 464141,
                "visitorteam_coach_id": 29710
            },
            "standings": {
                "localteam_position": 1,
                "visitorteam_position": 2
            },
            "assistants": {
                "first_assistant_id": 11658,
                "second_assistant_id": 12150,
                "fourth_official_id": 15834
            },
            "leg": "1/1",
            "colors": {
                "localteam": {
                    "color": "#FC7E00",
                    "kit_colors": "#D94B14,#FC7E00,#D94B14,#D94B14,#C40010,#0046A8,#0A0A0A"
                },
                "visitorteam": {
                    "color": "#F0F0F0",
                    "kit_colors": "#F0F0F0,#F0F0F0,#F0F0F0,#F0F0F0,#0A0A0A,#FFDF1B,#F0F0F0"
                }
            },
            "deleted": false,
            "localTeam": {
                "data": {
                    "id": 621,
                    "legacy_id": 137,
                    "name": "Shakhtar Donetsk",
                    "short_code": "SHK",
                    "twitter": null,
                    "country_id": 86,
                    "national_team": false,
                    "founded": 1936,
                    "logo_path": "https://cdn.sportmonks.com/images//soccer/teams/13/621.png",
                    "venue_id": 8829,
                    "current_season_id": 17381
                }
            },
            "visitorTeam": {
                "data": {
                    "id": 683,
                    "legacy_id": 41,
                    "name": "Borussia M'gladbach",
                    "short_code": "BMG",
                    "twitter": "@borussia",
                    "country_id": 11,
                    "national_team": false,
                    "founded": 1900,
                    "logo_path": "https://cdn.sportmonks.com/images//soccer/teams/11/683.png",
                    "venue_id": 180,
                    "current_season_id": 17361

This URL requests all the Champion League matches of the third round of the group stages. Now that you have an overview of all the Champion League fixture ids, we can start implementing our Prediction API.

Remember the two endpoints?

See our again for a refresher, in case you forgot. You have multiple options. Including the options to either use the or to use thewith probability as include. We’ll analyze the following match between Real Madrid and Inter with fixture id #17361029.

https://soccer.sportmonks.com/api/v2.0/predictions/probabilities/fixture/17361029/?api_token={API_TOKEN}
https://soccer.sportmonks.com/api/v2.0/fixtures/between/2020-11-03/2020-11-04?api_token={API_TOKEN}&include=localTeam,visitorTeam,probability&leagues=2

Step 2: The API response

"fixture_id": 17361029,
        "predictions": {
            "btts": 63.087,
            "over_2_5": 61.667,
            "under_2_5": 38.33,
            "over_3_5": 39.384,
            "under_3_5": 60.614,
            "HT_over_0_5": 82.125,
            "HT_under_0_5": 17.872,
            "HT_over_1_5": 51.346,
            "HT_under_1_5": 48.651,
            "AT_over_0_5": 76.818,
            "AT_under_0_5": 23.18,
            "AT_over_1_5": 42.932,
            "AT_under_1_5": 57.066,
            "home": 43.903,
            "away": 32.803,
            "draw": 23.29,
            "correct_score": {
                "0-0": 4.143,
                "0-1": 6.057,
                "0-2": 4.427,
                "0-3": 2.157,
                "0-4": 0.788,
                "0-5": 0.231,
                "0-6": 0.056,
                "0-7": 0.012,
                "0-8": 0.002,
                "1-0": 7.134,
                "1-1": 10.42,
                "1-2": 7.623,
                "1-3": 3.715,
                "1-4": 1.358,
                "1-5": 0.397,
                "1-6": 0.097,
                "1-7": 0.02,
                "1-8": 0.004,
                "1-9": 0.001,
                "2-0": 6.141,
                "2-1": 8.978,
                "2-2": 6.563,
                "2-3": 3.198,
                "2-4": 1.169,
                "2-5": 0.342,
                "2-6": 0.083,
                "2-7": 0.017,
                "2-8": 0.003,
                "2-9": 0.001,
                "3-0": 3.525,
                "3-1": 5.153,
                "3-2": 3.767,
                "3-3": 1.836,
                "3-4": 0.671,
                "3-5": 0.196,
                "3-6": 0.048,
                "3-7": 0.01,
                "3-8": 0.002,
                "4-0": 1.517,
                "4-1": 2.218,
                "4-2": 1.621,
                "4-3": 0.79,
                "4-4": 0.289,
                "4-5": 0.084,
                "4-6": 0.021,
                "4-7": 0.004,
                "4-8": 0.001,
                "5-0": 0.523,
                "5-1": 0.764,
                "5-2": 0.558,
                "5-3": 0.272,
                "5-4": 0.099,
                "5-5": 0.029,
                "5-6": 0.007,
                "5-7": 0.001,
                "6-0": 0.15,
                "6-1": 0.219,
                "6-2": 0.16,
                "6-3": 0.078,
                "6-4": 0.029,
                "6-5": 0.008,
                "6-6": 0.002,
                "7-0": 0.037,
                "7-1": 0.054,
                "7-2": 0.039,
                "7-3": 0.019,
                "7-4": 0.007,
                "7-5": 0.002,
                "7-6": 0.001,
                "8-0": 0.008,
                "8-1": 0.012,
                "8-2": 0.008,
                "8-3": 0.004,
                "8-4": 0.002,
                "9-0": 0.002,
                "9-1": 0.002,
                "9-2": 0.002,
                "9-3": 0.001
            }
        }

Summary of the data:

Predictions are updated multiple times a day. Take this into account when you start implementing.

Step 3: Example Page

Need some inspiration? The website below shows how you can display the various market predictions for one specific match.

Conclusion

BTTS (Both teams to score) = 63.01% Over 2,5 goals scored = 61.67% Under 3,5 goals scored = 60.14% Home team (Real Madrid) over 0,5 goals scored = 82,13% Away team (Inter) over 0,5 goals scored = 76.82% Real Madrid win probability = 43.90% Inter win probability = 32.80% Draw probability = 23.29% A final score of 1-1 has the highest probability = 10.42% If you used the you will have to repeat this step for all the other Champion League matches.

But, if you used the probability include on one of our or endpoints, you won’t have to.

Our prediction API uses cutting-edge technology developed by Sportmonks’ very own data scientists and development team. If you’re interested in the technology behind our predictions, you can have a look at our

tutorial
prediction tutorial.
Get next probabilities
Get probabilities by fixture id
tutorial
probabilities by fixture id endpoint
fixtures between dates endpoint
probabilities by fixture id endpoint,
fixtures
livescores
prediction API blog.