BetterBets API Documentation

The BetterBets API enables bot makers to write programs/bots which interact with our site. The content below details the available entry points, the paramters expected and the values returned.

All API interfaces return a JSON-encoded object (or object-array) and a HTTP status code 200 upon success. Upon validation failure, "error" field is set to "1" and a HTTP status code 200 is returned. For other types of failures a HTTP return code 500 with an appropriate error object is returned.

Please note that bets under 100 Satoshi are throttled to +- 2.5 bets per second (depending on your network connection)

The base entry point for the API interface is https://betterbets.io/api/


Place a dice bet
Parameters
Name Type Required Description
accessToken string Yes The user's API access token
wager float Yes The amount wagered, in BTC
chance float Yes The chance of winning the bet
direction integer Yes The direction in which the bet is placed {0 = bet low, 1 = bet high}
HTTP 200 OK

{
   'error':'int (0|1)',
   'win':'int (0|1)',
   'balanceOrig':'float (BTC)',
   'balance':'float (BTC)',
   'profit':'float (BTC)',
   'direction':'integer (0|1)',
   'wager':'float (BTC)',
   'target':'float',
   'result':'float',
   'clientSeed':'integer',
   'serverSeed':'string',
   'nextServerSeed':'string',
   'version':'float',
   'maintenance':'integer (0|1)',
   'happyHour':'integer (0|1)'
 }
Return the bet as specified by the 'id' parameter
Parameters
Name Type Required Description
id int Yes The bet ID
HTTP 200 OK

{
   {
   'id':'int',
   'id_mp':'int',
   'coin':'string',
   'game_id':'int',
   'group_turn_id':'int',
   'user_id':'int',
   'username':'string'
   'direction':'int (0|1)',
   'house_edge':'float',
   'bet_amount':'float (BTC)',
   'multiplier':'float',
   'target':'float',
   'result':'float',
   'profit':'float (BTC)',
   'win':'int (0|1)',
   'client_seed':'int',
   'client_seed_sequence':'int',
   'server_seed':'string',
   'server_salt':'string',
   'next_server_seed':'string',
   'time':'datetime'
   }
 }
Return the last 30 bets
Parameters
HTTP 200 OK

{
  [
   {
   'id':'int',
   'id_mp':'int',
   'coin':'string',
   'game_id':'int',
   'group_turn_id':'int',
   'user_id':'int',
   'username':'string'
   'direction':'int (0|1)',
   'house_edge':'float',
   'bet_amount':'float (BTC)',
   'multiplier':'float',
   'target':'float',
   'result':'float',
   'profit':'float (BTC)',
   'win':'int (0|1)',
   'client_seed':'int',
   'client_seed_sequence':'int',
   'server_seed':'string',
   'server_salt':'string',
   'next_server_seed':'string',
   'time':'datetime'
   },
   {....}
  ]
 }
Return a deposit address for the current user
Parameters
Name Type Required Description
accessToken string Yes The user's API access token
HTTP 200 OK

{
   {
   'deposit_address':'string'
   }
 }
Return the 30 highest bets
Parameters
HTTP 200 OK

{
  [
   {
   'id':'int',
   'id_mp':'int',
   'coin':'string',
   'game_id':'int',
   'group_turn_id':'int',
   'user_id':'int',
   'username':'string'
   'direction':'int (0|1)',
   'house_edge':'float',
   'bet_amount':'float (BTC)',
   'multiplier':'float',
   'target':'float',
   'result':'float',
   'profit':'float (BTC)',
   'win':'int (0|1)',
   'client_seed':'int',
   'client_seed_sequence':'int',
   'server_seed':'string',
   'server_salt':'string',
   'next_server_seed':'string',
   'time':'datetime'
   },
   {....}
  ]
 }
Return the last 30 bets of the current user
Parameters
Name Type Required Description
accessToken string Yes The user's API access token
HTTP 200 OK

{
  [
   {
   'id':'int',
   'id_mp':'int',
   'coin':'string',
   'game_id':'int',
   'group_turn_id':'int',
   'user_id':'int',
   'username':'string'
   'direction':'int (0|1)',
   'house_edge':'float',
   'bet_amount':'float (BTC)',
   'multiplier':'float',
   'target':'float',
   'result':'float',
   'profit':'float (BTC)',
   'win':'int (0|1)',
   'client_seed':'int',
   'client_seed_sequence':'int',
   'server_seed':'string',
   'server_salt':'string',
   'next_server_seed':'string',
   'time':'datetime'
   },
   {....}
  ]
 }
Set a new client seed for the current user
Parameters
Name Type Required Description
accessToken string Yes The user's API access token
seed int Yes The new client seed to set
HTTP 200 OK

{
   {
   'error':'int (0|1)',
   'newSeed':'int',
   }
 }
Get global site statistics
Parameters
Name Type Required Description
accessToken string Yes The user's API access token
seed int Yes The new client seed to set
HTTP 200 OK

{
   {
   'siteoff':'int (0|1)',
   'happy_hour_start':'datetime (CET)',
   'happy_hour_end':'datetime (CET)',
   'bankroll_btc':'int (BTC)',
   'url':'string',
   'currency':'string',
   'currency_sign':'string',
   'total_bets':'int',
   'total_wagered':'float',
   'total_wins':'int',
   'total_player_profit':'float',
   'houseEdge':'float',
   'houseEdgeHH':'float',
   'version':'float'
  }
 }
Return the current user's info
Parameters
Name Type Required Description
accessToken string Yes The user's API access token
HTTP 200 OK

{
   {
    'id':'int',
    'balance':'float (BTC)',
    'username':'string',
    'created_at':'datetime (CET)',
    'updated_at':'datetime (CET)',
    'access_token_api':'string',
    'client_seed':'int',
    'server_seed':'string',
    'weekly_bets':'int',
    'weekly_wagered':'float',
    'weekly_he_amount':'float',
    'total_bets':'int',
    'total_wagered':'float',
    'total_wins':'int',
    'total_profit':'float'
   }
 }