API Documentation

Request

url: https://api.apostasseguras.com/request

Method: get

Headers

Authorization = Bearerapi_token
api_token - the token provided to you to access the API data

Parameters

product =surebets|middles|valuebets
Type of data requested. Mandatory parameter.

source =bookies
Enumeration of bookmaker IDs for which data needs to be requested. Mandatory parameter.

sport =sports
Enumeration of sport IDs for which data needs to be requested. Mandatory parameter.

limit =25
A limit on the number of entries that can be obtained in one request. By default, this value is set to 25.

cursor =sort_by:id
Parameter to navigate through output results. Depending on whether we need to go forward or backward in the list, sort_by and id should be taken from the last or first records of the current output.
For example, for the output located at the bottom of the page with sort_by:id: 4609118910833099900, id:785141488 (let's assume this is the ID of the last entry in the output), the cursor parameter would look like this:
cursor=4609118910833099900:785141488
Adding this parameter to the request would mean the data output of the next page (if the ID was the last) or the previous page (if the ID was the first).

commissions =betfair:5,betdaq:1.5
Commission values applied to the bets. In this example, it is indicated that a 5% commission will be applied to winnings on bets at Betfair, and a 1.5% commission for Betdaq.

oddsFormat =eu|us|uk|my|hk|pr
Odds display format.
eu - European (decimal)
us - American
uk - British (fractional)
my - Malaysian
hk - Hong Kong
pr - probability

outcomes =2|3
Number of surebet outcomes: can be 2 or 3. If the parameter is not specified or another value is specified (instead of 2 or 3), all possible variants will be displayed.

min_group_size =2
Minimum number of odds used for valuebets comparison and calculation: can be 2 and above. In JSON the field is also displayed as ”similar_size”, written after "id".

Restrictions

No more than 2 requests per second.

Examples of requests

https://api.apostasseguras.com/request?product=surebets&source=1xbet|pinnaclesports|parimatch|marathonbet&sport=Basketball|Football|Tennis
https://api.apostasseguras.com/request?product=surebets&source=1xbet|pinnaclesports|parimatch|marathonbet&sport=Basketball|Football|Tennis&limit=10&cursor=4609118910833099900:785141488

To quickly verify that the API is working, you can use the curl command-line tool to make a request:

curl "https://api.apostasseguras.com/request?product=surebets&source=bet365|22bet|unibet|pokerstars\_es&sport=Football|Volleyball" -H "Authorization: Bearerapi_token"


Result:

general data

{
/* Time when the response was generated */
updated_at: 1684171109017,

/* Whether it is possible to move forward through the list */
can_forward: true,

/* Whether it is possible to move backward through the list */
can_backward: false,

/* The number of records in the output */
limit: 25
}

Bet section:

{
/* Bet ID */
id: 460444138,

/* Tournament name as it appears on the bookmaker's website */
tournament: "Counter-Strike - BLAST Paris Major",

/* Names of the participants as they appear on the bookmaker's website */
teams: ["Fnatic", "G2"],

/* Overvalue of the bet in the range of 0 to 1. If 0, the value has not been calculated yet */
overvalue: 0,

/* Probability of winning the bet in the range of 0 to 1. If 0, the value has not been calculated yet */
probability: 0,

/* Odds value */
value: 4.56,

/* Commission that the bookmaker takes from winnings. Given in the range of 0 to 1 */
commission: 0,

/* Bookmaker's name */
bk: "parimatch",

/* Match ID in the system */
event_id: 460159166,

/* Kind of sport */
sport_id: "CounterStrike",

/* Match start time as indicated on the bookmaker's website */
time: 1684157400000,

/*
There are three types of elements that describe navigation to a bet on the bookmaker's website:
event_nav - link to the match
view_nav - link to a specific market (betting group)
stake_nav - link to a specific bet
If only event_nav is present, it is used as a replacement for viewnav and stakenav. If event_nav and view_nav are present, but stake_nav is absent, view_nav serves as a replacement for stake_nav.
Each of these elements has the same internal structure. Below is a description of one of them - event_nav.
An element describing navigation to a bet on the bookmaker's website. Any data that can be useful in obtaining a direct link to a match or a specific bet is recorded here.
*/
"event_nav": {

   /* an indication that the event link can be opened from an iframe */
   "direct": true,

   /* a list of links to be opened to get to the desired page */
   "links": [

       //the first link named "main"
       {
           /* link name */
           "name": "main",

           /* http request description */
           "link": {

               /* method of the http request */
               "method": "GET",

               /* url */
               "url": "https://www.marathonbet.com/en/betting/Tennis/ITF/England/Roehampton/Men/Singles/Round+of+32/B.Blaydes+vs+F.Bondioli+-+16407509"
           },

           /* list of link names to be opened with this one */
           "requirements": ["x"]
       },

       //second link named "x"
       {
           /* link name */
           "name": "x",

           /* http request */
           "link": {

               /* method of the http request */
               "method": "POST",

               /* url */
               "url": "https://www.marathonbet.com/en/betslip/add.htm",

               /* parameters of the http request */
               "params": {
                   "ch": "{\"ewc\":\"1/1 1\",\"cid\":126110536388,\"prt\":\"CP\",\"ewf\":\"1.0\",\"epr\":\"1.95\",\"prices\":{\"0\":\"19/20\",\"1\":\"1.95\",\"2\":\"-106\",\"3\":\"0.95\",\"4\":\"0.95\",\"5\":\"-1.06\"},\"u\":\"15139400,Total_Games7.Under_23\",\"mainEventTreeId\":\"16407509\"}", 
                   "url": "https://www.marathonbet.com/en/betting/Tennis/ITF/England/Roehampton/Men/Singles/Round+of+32/B.Blaydes+vs+F.Bondioli+-+16407509"
               }
           }, 

           /* maximum delay time between opening this link and the previous link */
           "maxDelay": 1500
       }],

   /*
     Usually, the data in this section is specific to each bookmaker, and you will need to check how to use this field if the code does not provide clear instructions for a particular bookmaker.
     We understand that API users need to know how to place bets quickly, but when selling the API we do not provide detailed documentation on how to perform specific actions with individual bookmakers.
     At best, we can assist users by providing answers to specific questions or, if possible, add some information to the output data that can help with navigation.
   */
   "markers": {
       "id": 2000863629,
       "inValue": 1.95,
       "bk": "marathonbet",
       "externalId": "441036222-126110536388",
       "eventId": "16407509"
   }

}

/* Description of bet characteristics /
type: {
/
Condition corresponding to the bet type; an additional variable parameter describing the bet */
condition: "3.5",

   /*
   This parameter indicates the type of a game situation in which the event takes place.
   regular - the default game situation. For example, bets on the match outcome.
   first - a game situation where teams compete to score the first goal / corner kick / card, etc.
   № 2 - a game situation for the second goal / corner kick / card, etc.
   last - similar to the first situation but for the last goal / corner kick / card, etc.
   openingPartnership - in cricket, the best opening partnership
   and so on.
   */
   game: "regular", 

   /*
   This parameter determines the teams to which the bet applies and can take values such as:
   overall - home and/or away teams
   home - home team
   away - away team
   both - both away and home teams
   */
   base: "overall", 

   /*
   A type of countable results on which the bet is accepted.
   Goal, corner kick, card, frame, set, point, etc. - all fall under "variety."
   */
   variety: "map", 

   /*
   Time period or part of the game for which the bet is accepted.
   For example: overtime, regularTime, period1, set1, etc. - all of them are considered "periods."
   */
   period: "overtime", 

   /*
   This parameter describes the logical meaning of the bet and can take values such as:
   win1 - victory of team 1
   win1RetX - victory of team 1, but if a draw occurs, the bet is returned
   win2 - victory of team 2
   win2RetX - victory of team 2, but if a draw occurs, the bet is returned
   draw - draw
   over - over
   under - under
   yes - happens
   no - not happens
      odd - odd
      even - even
   ah1 - Asian handicap of team 1
   ah2 - Asian handicap of team 2
   eh1 - European handicap of team 1
   ehx - European handicap on draw
   eh2 - European handicap of team 2

   and others
   Some bet types may imply additional conditions. For example, for over and under bets it is the total number,
   and for ah1/ah2/eh1/ehx/eh2 bets it is the handicap value. All such values will be included in a separate condition parameter.
   */

   type: "over", 

   /*
   This parameter is responsible for representing bets in the back/lay format, which can be found on betting exchanges like Betfair.
   By default, all bets have back=true, and this parameter is not present in the output. However, if a bet is a lay bet, then this parameter will have the back:false value.
   */
   back: true,

   /*
   This parameter is responsible for negating a bet, meaning that the player wins if the specified event DOES NOT occur.
   In this case, the output will have no:true. By default, it is no:false.
   */

   no: false,

}
}

/valuebets

records - this is the enumeration of bets that are value bets.

General section for /surebets and /middles

{
/* sorting code, according to which the result is returned */
sort_by: 4609118910833099900

/* record (surebet/middle/valuebet) id */
id: 785141488,

/* start time of the outcome event that relates to this surebet/middle */
time: 1685835600000,

/* time of the surebet/middle creation */
created: 1684229420000,

/* number of surebets/middles related to the specified group of bets */
group_size: 2,

/* collection of bets included in the surebet */
prongs: [...],

/* an optional field; its presence indicates that bets in the surebet/middle may be subject to different rules */
rd: [[0], [1], [1]]
}

/surebets

{
...
/* profitability of the surebet */
profit: 11.2812,

/* ROI (Return on Investment) of the surebet */
roi: 222.6584,

/*
a list of flags, where each flag corresponds to prongs, and each flag can take the following values:
0 - regular bets
1 - probably generative bets
2 - clearly generative bets
A generative bet is a bet that generates a surebet.
*/
generatives: "0,2"
}

/middles

{
...
/* possible loss if only one bet wins */
bet: 0.2452,

/* possible win if both bets win */
win: 0.5097,

/* probability of hitting a middle, i.e., when both bets win */
probability: 0.3379,

/* middle odds, i.e., the ratio of potential win to potential loss */
overvalue: 1.0404,

/*mathematical expectation of the middle. The higher it is, the more advantageous the middle is. */
ev: 0.0099
}