Skip to main content

Duel API

Get the probability that Team A will win against Team B

This endpoint requires that valid Bayes team perids and date are sent with the API call:

GET - /api/duel?team1_perid={team1_perid}
&team2_perid={team2_perid}
&date={ISO_DATE}
&best_of={best_of}
&ignore_draw={ignore_draw}
parametertypedescription
team1_peridstringThe Bayes perid for Team 1
team2_peridstringThe Bayes perid for Team 2
date (Optional)ISO date formatThe date for a hypothetical map where the team strengths apply. This date could be for an upcoming map or apply to a map in the past. Should be in format YYYY-MM-DD. If not passed, defaults to today.
best_of (Optional)integerLength of series to be played. Defaults to 1 (= single map).
ignore_draw (Optional)boolIn the case of an even-numbered best-of, there can be draws. Specify whether you want to ignore draws or not. Default behaviour is to not ignore. See below for details.

If the date is for a map in the future the current team strengths apply, no additional extrapolation is taken.

The perids for both teams can be found in the Bayes Fixtures Services.

The parameter ignore_draw works as follows: If the outcome for a given best-of-2 series would have been (win=0.3, draw=0.5, loss=0.2) and you choose to ignore draws, then the draw probability will be dropped and the win probability will be normalised. The predicted value will then be 0.6 as the win chance for team 1. The default behaviour is to not ignore it, which means normally the predicted value would be 0.3.

The JSON response from the API call contains the fields prediction and remark where the prediction is a floating point number that gives the probability of the Team A beating Team B for an upcoming map.

The remark is a string containing additional information and starting with a code:

codedescription
1Match is between two teams from different regions, so the prediction result is uncertain
2Teams are playing on two different circuits, so the prediction result is uncertain
3At least one team does not have enough data to give a good prediction
4Returned default rating due to issues (currently not in use)

If there are no issues with the prediction, the remark is an empty string.

{
'prediction': 0.9874537443543543,
'remark': ''
}