Want to make your own dice betting bot? Want to earn money while doing it? That is what we are offering.
On this page, you will find information about creating your own bot using the API provided by 999dice.
New players are automatically attached as one of your referrals
on 999dice. That means you earn 0.05% of the value of every bet they
make, win or lose.
We do not care if you make a bot and call it "Bob's Super-Dice
Site". You do not need to mention our website at all. We do not care if
you pass it off as your own site, even. To extend that idea, you could
even create your own website, and have our API serve as your back-end.
What we DO care about is: PLAY FAIR. Be open and honest about
what your bot does and doesn't do. We are keeping a close eye on the API
usage.
If you aren't using a language that already has an implementation of the API, you can still access it using web requests.
- All requests are made to this URL:
https://999dice.me/api/
- All parameters are sent in a POST (not json).
- All results are returned to you as json.
All requests must include the action you wish to perform as the "a"
parameter.
All requests other than CreateAccount
, BeginSession
, and Login
must include a session cookie as the "s"
parameter.
For example: a=GetServerSeedHash&s;=1a2b3c4d5f6 is
requesting the action "GetServerSeedHash" for the user with the session
cookie "1a2b3c4d5f6".
Responses
All requests can receive error responses instead of the normal response.
There are some standard error responses that may be generated for any request:
- error: Message (An error has occured)
- TooFast: 1 (You are performing an action too quickly and have been rate limited)
- TotpFailure: 1 (This action requires a valid Totp code, which was not provided)
Starting a session...
CreateAccount
- Creates a new account for the user.
- Request:
- a: CreateAccount
- Key: Your API Key
- Response:
- Status: Status of the response (success or error).
- AccountId: The user's account ID.
- AccountName: The user's display name.
- Errors:
- InvalidApiKey: 1 (The API key you provided is invalid)
Login
- Begins a session for a user with an existing account protected by a username and password.
- Request:
- a: Login
- Key: Your API Key
- Username: The user's username.
- Password: The user's password.
- Totp (optional): The user's totp code (ie Google Authenticator)
- Response:
- Status: Status of the response (success or error).
- Username: The user's username.
- AccountId: The user's account ID.
- AccountName: The user's display name.
- Email: The user's email address.
- SessionCookie: The value you must pass to future requests for this user during this session.
- Errors:
- InvalidApiKey: 1 (The API key you provided is invalid)
- LoginInvalid: 1 (The username was not found or the password or totp is wrong)
Handling user information...
CreateUser
- Creates a username and password.
- Request:
- a: CreateUser
- AccountId: The user's account ID.
- Username: The user's username.
- Password: The user's password.
- Response:
- Status: Status of the response (success or error).
- Username: The user's username.
- SessionCookie: The value you must pass to future requests for this user during this session.
- Errors:
- AccountHasUser: 1 (This account already has a username and password)
- UsernameTaken: 1 (The username is already taken by someone else)
ChangePassword
- Change the user's password.
- Request:
- a: ChangePassword
- s: User's session cookie
- OldPassword: The user's current password
- NewPassword: The new password.
- Response:
- Status: Status of the response (success or error).
- Errors:
- WrongPassword: 1 (The wrong password was supplied)
UpdateEmail
- Update the user's email address.
- Request:
- a: UpdateEmail
- s: User's session cookie
- Email: The user's email address
- Response:
- Status: Status of the response (success or error).
- Email: The user's email address
UpdateEmergencyAddress
- Update the user's emergency withdrawal address.
- Request:
- a: UpdateEmergencyAddress
- s: User's session cookie
- Currency: The user's currency
- Address: The user's emergency withdrawal address
- Response:
- Status: Status of the response (success or error).
- Address: The user's emergency withdrawal address
Funds...
Withdraw
- Withdraw funds.
- Request:
- a: Withdraw
- s: User's session cookie
- Amount: The number of satoshis to withdraw (100,000,000 satoshis per DOGE). TRON's 2 DOGE
transaction fee will be deducted.
- Address: The Dogecoin address or account ID to receive the withdrawal.
- Currency: btt/tron/doge/shiba
- Response:
- Status: Status of the response (success or error).
- Errors:
- TooSmall: 1 (The withdrawal is too small to process)
- InsufficientFunds: 1 (The user has insufficient funds)
GetDepositAddress
- Get a Dogecoin address where the user can deposit funds.
- Request:
- a: GetDepositAddress
- s: User's session cookie
- Currency: btt/tron/doge/shiba
- Response:
- Status: Status of the response (success or error).
- Address: A Wallet address.
GetBalance
- Get the user's current balance. This is only required if
the user makes a deposit. If you are polling this value, once per 60
seconds is recommended, and should not be more frequently than once per
15 seconds. Ideally, this should be manually checked by the user
clicking a button (they know when they've deposited!).
- Request:
- a: GetBalance
- s: User's session cookie
- Currency: btt/tron/doge/shiba
- Response:
- Status: Status of the response (success or error).
- Balance: The user's current balance.
Betting...
PlaceBet
- Place a bet
- Request:
- a: PlaceBet
- s: User's session cookie
- Amount: The bet amount
- Direction: The bet direction (high/low)
- Chance: The bet chance (5 to 95)
- Currency: btt/tron/doge/shiba
- ProtocolVersion: 2 [All bot owners should update their code to set this value to opt in to the new response format]
- Response:
- Status: Status of the response (success or error).
- BetId: The bet's ID.
- Amount: The bet amount
- Profit: The bet profit
- IsWin: The bet win or loss (true/false)
- Errors:
- ChanceTooHigh: 1 (The chance to win is too high. It must be between 5% and 95%)
- ChanceTooLow: 1 (The chance to win is too low. It must be between 5% and 95%)
- InsufficientFunds: 1 (The user has insufficient funds to make this bet)
- NoPossibleProfit: 1 (There is no possible way for the user to profit from this bet)
- MaxPayoutExceeded: 1 (The bet, if won, would exceed the maximum possible payout for the casino)
PlaceAutomatedBets
- Place a batch of automated bets
- Request:
- a: PlaceAutomatedBets
- s: User's session cookie
- Amount: The bet amount
- Direction: The bet direction (high/low)
- Chance: The bet chance (5 to 95)
- Currency: btt/tron/doge/shiba
- BetCount: The bet counts
- MaxBetSize: Maximum bet size
- ResetIfWin: reset amount if win (true/false)
- IncreaseWin: percentage of increase
- ResetIfLoss: reset amount if loss (true/false)
- IncreaseLoss: percentage of increase
- StopIfMaxBet: stop bet if max bet amount is reached
- ResetIfMaxBet: reset amount if max bet amount is reached
- ProtocolVersion: 2 [All bot owners should update their code to set this value to opt in to the new response format]
- Response:
- Status: Status of the response (success or error).
- BetId: The bet's ID.
- Amount: The bet amount
- Profit: The bet profit
- IsWin: The bet win or loss (true/false)
- Errors:
- ChanceTooHigh: 1 (The chance to win is too high. It must be between 5% and 95%)
- ChanceTooLow: 1 (The chance to win is too low. It must be between 5% and 95%)
- InsufficientFunds: 1 (The user has insufficient funds to make this bet)
- NoPossibleProfit: 1 (There is no possible way for the user to profit from this bet)
- MaxPayoutExceeded: 1 (The bet, if won, would exceed the maximum possible payout for the casino)
- Seed: The server seed used to calculate the bet results.
General Information...
GetCurrencies
- Gets a list of supported currencies.
- Request:
- Response:
- Currencies: A list of currencies.
GetMarketInfo
- Gets a list of supported market.
- Request:
- Response:
- [{"btt":{"minBetSize":"1","maxTradeCount":"300","api_fee":"1","trx_fee":"0.1","point":"18"}},{"tron":{"minBetSize":"0.1","maxTradeCount":"300","api_fee":"1","trx_fee":"0.1","point":"6"}},{"doge":{"minBetSize":"0.00001","maxTradeCount":"200","api_fee":"1","trx_fee":"0.1","point":"8"}},{"shiba":{"minBetSize":"0.5","maxTradeCount":"200","api_fee":"1","trx_fee":"0.1","point":"18"}}]
Samples
Request: a=UpdateEmergencyAddress&s=1a2b3c4d5e6f&Address=1DogecoinAddress123
Response: {success: 1}
Request: a=Withdraw&s=1a2b3c4d5e6f&Amount=5000000&Address=1DogecoinAddress123&Currency=doge
Response: {Pending: 5000000}
or Response: {InsufficientFunds: 1}
Request: a=GetBalance&s=1a2b3c4d5e6f
Response: {Balance: 123450000}
or Response: {TooFast: 1}
Request: a=PlaceBet&s=1a2b3c4d5e6f&PayIn=1000&Low=0&High=499499&ClientSeed=12345678&Currency=doge
Response: {BetId:123, PayOut: 2000, Secret: 222222,
StartingBalance: 5000, ServerSeed:
"a1b2c3d4e5f60708a1b2c3d4e5f60708a1b2c3d4e5f60708a1b2c3d4e5f60708"}
or Response: {BetId:123, PayOut: 0, Secret: 888888,
StartingBalance: 5000, ServerSeed:
"a1b2c3d4e5f60708a1b2c3d4e5f60708a1b2c3d4e5f60708a1b2c3d4e5f60708"}
or Response: {InsufficientFunds: 1}
or Response: {TooFast: 1}
Request: a=PlaceAutomatedBets&s=1a2b3c4d5e6f&BasePayIn=1000&Low=0&High=499499&MaxBets=3&ResetOnWin=1&ResetOnLose=0&IncreaseOnWinPercent=0&IncreaseOnLosePercent=1.0&MaxPayIn=2500&ResetOnLoseMaxBet=0&StopOnLoseMaxBet=0&StopMaxBalance=0&ClientSeed=987654321&Currency=doge
Response: {BetId:123, PayIns: [-1000, -2000, -2500],
PayOuts: [0, 0, 5000], Secrets: [777777, 888888, 222222],
StartingBalance: 5000, Seed:
"a1b2c3d4e5f60708a1b2c3d4e5f60708a1b2c3d4e5f60708a1b2c3d4e5f60708"}
or Response: {BetId:123, PayIns: [-1000, -1000, -1000],
PayOuts: [2000, 2000, 0], Secrets: [222222, 333333, 777777],
StartingBalance: 5000, Seed:
"a1b2c3d4e5f60708a1b2c3d4e5f60708a1b2c3d4e5f60708a1b2c3d4e5f60708"}
or Response: {InsufficientFunds: 1}
or Response: {TooFast: 1}
Request: a=PlaceAutomatedBets&s=1a2b3c4d5e6f&BasePayIn=1000&Low=0&High=499499&MaxBets=200&ResetOnWin=1&ResetOnLose=1&IncreaseOnWinPercent=0&IncreaseOnLosePercent=0&MaxPayIn=2500&ResetOnLoseMaxBet=0&StopOnLoseMaxBet=0&StopMaxBalance=0&ClientSeed=987654321&Currency=trx&Compact=1
Response: {BetId: 123, BetCount: 200, PayIn: -200000,
PayOut: 300000, Seed:
"a1b2c3d4e5f60708a1b2c3d4e5f60708a1b2c3d4e5f60708a1b2c3d4e5f60708",
StartingBalance: 5000}
or Response: {InsufficientFunds: 1}
or Response: {TooFast: 1}