In this last tutorial, we’re going to discuss our **Prediction API**. We offer the prediction API as a separate add-on. Meaning, you will need to have a plan with this add-on to have access to our prediction model. We’re going to discuss what you can do with the prediction API and how it works.

But first, what is included in our prediction API add-on? Our prediction API has three key models:

**Prediction model**(based on Bayesian principles)Probabilities per match (domestic leagues only) - Winner predictions (home win, away win or draw) - BTTS (Both Teams To Score) prediction - Correct score predictions - Over/under probabilities

Leagues and performance (measuring the performance of probabilities)

**Valuebet model*****Player contribution model****

** The valuebet model processes thousands and thousands of historical odds data and market trends in order to find value opportunities, which are then compared against bookmaker odds.
** Used to calculate probabilities of international cups. The last known line-up is used for the calculations of probabilities. As soon as the new line-up is known, the probability will also be re-calculated*

All three models and algorithms are based on four key principles

**Timely and substantive**The prediction API is updated daily with the latest data from the SportMonks football database**Data controlled**No human intervention is needed. The prediction API runs on statistical analysis results, based on the entire historical SportMonks Football Database**Precise probabilities**The prediction API offers the most precise probabilities possible, thanks to our mathematical probability distribution models**Predictability performance**The success rate and quality of our prediction API are monitored by us, but you can also track our predictions’ performance yourself.

For a full overview of the technology behind our predictions, you can refer to our **blog**.

The prediction model makes predictions about the possible outcomes of fixtures, such as the probability that the home or away team wins, but also the probability of a draw.

The prediction model is created with the latest machine learning techniques and can thus offer you the best predictions possible

The prediction model offers various probabilities and we’re going to show you how to request them and how you should interpret them.

There are actually two options to request the fixture probability:

Let’s start with the first option.

**This endpoint **will give you all the detected fixtures’ probabilities. This will show all probabilities for every single fixture in your plan.

Probabilities are available 21 days before a game starts

This might seem like a lot of data at first, but it is quite straightforward actually. Let’s walk through the data together.

First thing we see is ‘BTTS’, which means Both Teams To Score. The probability that both teams will score a goal is roughly 55%. Next, we see: over 2.5 is roughly 51%, meaning that there’s a 51% chance that there will be over two and a half goals in the game. HT and AT under/over indicate the respective probabilities for the home and away teams. Finally, correct score is a bunch of probabilities for each possible score. So, a final score of 1-1 has a probability of 12.2%

**Note** that the prediction model updates its predictions daily. So, predictions can and will change from day to day.

The second option is to get **probabilities by fixture id.** The only difference is that instead of requesting all fixtures with their probabilities for the next 21 days, you now request one single fixture.

As you can see in our **API reference guide****,** only `fixture`

is allowed as an include. However, as you’ve learned from our **nested includes tutorial,**** **you can enrich the include with a relationship. For example:

`&include=fixture.localTeam,fixture.visitorTeam`

**Please note** that you can also use the `&include=probability`

on one of our **fixture endpoints** or **livescores endpoints**

The **Leagues & performances endpoint** will give you information about which leagues are included in our prediction API and what the performance is per league.

Every league has a performance rating. This rating is continuously updated by our prediction API. The league predictability is a set of metrics that measures the quality and predictive power of the model. For more information about our model, please refer to our **prediction blog.**

You can request the performance of the leagues by using the following URL:

This will return predictions for all the leagues in your subscription. As well as the league’s performance.

For example:

What do we see exactly? The league predictability tells you about the prediction performance of that league. Let’s discuss this.

The league predictability consists of four elements.

**Hit Ratio**Let's take a look at one example. We can see here that for the

**Danish Superliga (league id: 271)**, the ‘hit ratio’ is 0.48 for the 3-way result (1, X, 2) market. The hit ratio is the number of times the model predicted the particular market correctly the last 100 matches of the league. The closer to 1,00, the better it is. You can track and see the real-time predictability performance for all prediction markets per league.**Log Loss**This is the average log loss over the last 100 matches of the league. It measures the quality of the probabilities. The closer the number is to 0, the better it is. The quality is considered poor, medium, good or high based on the log loss.

Poor is < -1.07

Medium is > -1.07

Good is > -1.02

High is > -.98

**Predictability**Not everybody is comfortable with numbers. The predictability is the same poor, medium, good, and high as from log loss. However, this will tell you straight away in words, whether the predictability of the league is good or bad.

**Predictive power**This tells you whether the log loss has been increasing or not, in the last 50 matches. Possible outcomes are up, down, or unchanged. If the predictive power is up, then the league becomes more predictable.

The Value Bet model processes thousands of historical odds data and market trends to find the best value opportunities. In other words, it compares bookmakers odds with each other and then gives you the best value bookmaker.

Once the opening odds are available, the value detection algorithm runs every 10 minutes up to the beginning of the match. Each value detected by the model comes with a set of features described below.

`bet`

: 1 = home, x = draw, 2 = away`bookmaker`

: The name of the bookmaker with the best odd`odd`

: The odd provided by the bookmaker`is_value`

: Indicates if the value bet is still available`stake`

: The stake helps manage the risk that the model would take in the bet. The risk is measured with the volatility of the profit and loss of the value bet strategy. The stake is calculated to have an average risk of one unit.`fair_odd`

: Our algorithm allows you to find the fair odd of a value. The fair odd is useful to play against bookmakers that are not listed in SportMonks. Any odd above the fair odd can be considered as value.

**Please note** that our algorithm detects Value Bets based on all available odds in combination with the fair odd calculated by the Value Bet algorithm. Therefore, not every match has a Value Bet available.

Just like with the probabilities, the value bet API has two options:

**Get next value bets**: This endpoint will give you all the value bets of the next fixtures.**Get value bet by fixture id****:**This endpoint will give you the value bets of one fixture

An example of a response:

Bet has the possible value of 1, X or 2. This represents the 3-Way Result market.

1 = home

X = draw

2 = away

The bookmaker’s name is bet365.

bet365 provides an odd of 19.

The stake assists in managing the risk that the model would take in the bet. The risk is measured with the volatility of the profit and loss of the Value Bet Strategy. The stake is calculated in order to have an average risk of one unit.

The fair odd is calculated with our algorithm. It’s the fair odd of a value. Any odd above the fair odd can be considered as value.

**Please note** that you can also use the`&include=valuebet`

on one of our **fixture endpoints** or **livescores endpoints****.**

Next up is Sportmonks' ID Finder. The easiest tool to find all ID's you need.