Jump to content

Does anyone have an approved API list for DICE?


petral20021

Featured Comment

Posted
3 hours ago, kingnayim2 said:

no official documentation for the api is available there were a few topics on the forum but only this one left

there are useful information in this post for your question 

the whole problem is that I don't know where to get the value of the Identifier key

 

Posted
3 minutes ago, petral20021 said:

the whole problem is that I don't know where to get the value of the Identifier key

 

Just inspect the network calls in chrome dev tools.  

Posted
1 hour ago, dupeddonk said:

Just inspect the network calls in chrome dev tools.  

if you play manually, you can see everything in the inspector, and if using the API key, it gives an error

  • Moderator
Posted
14 minutes ago, petral20021 said:

if you play manually, you can see everything in the inspector, and if using the API key, it gives an error

Copy the graphql request it makes when you play from browsers network tab.
Replace 'x-access-token' with your API key (headers).

Then you can edit request variables (like target multi, betsize etc) from query and send that to 'https://api.stake.com/graphql', which should return answer for your placed bet :)

Posted
25 minutes ago, ROkenTratENsaV said:

Copy the graphql request it makes when you play from browsers network tab.
Replace 'x-access-token' with your API key (headers).

Then you can edit request variables (like target multi, betsize etc) from query and send that to 'https://api.stake.com/graphql', which should return answer for your placed bet :)

query: "mutation DiceRoll($amount: Float!, $target: Float!, $condition: CasinoGameDiceConditionEnum!, $currency: CurrencyEnum!, $identifier: String!) {\n diceRoll(\n amount: $amount\n target: $target\n condition: $condition\n currency: $currency\n identifier: $identifier\n ) {\n ...CasinoBet\n state {\n ...CasinoGameDice\n }\n }\n}\n\nfragment CasinoBet on CasinoBet {\n id\n active\n payoutMultiplier\n amountMultiplier\n amount\n payout\n updatedAt\n currency\n game\n user {\n id\n name\n }\n}\n\nfragment CasinoGameDice on CasinoGameDice {\n result\n target\n condition\n}\n"

variables: {target: 50.5, condition: "above", identifier: "Rpw_fwf36OjBGdsR6VSp", amount: 0.00001,…}

where can i find out the value of this variable "identifier"?

  • Moderator
Posted
1 hour ago, petral20021 said:

query: "mutation DiceRoll($amount: Float!, $target: Float!, $condition: CasinoGameDiceConditionEnum!, $currency: CurrencyEnum!, $identifier: String!) {\n diceRoll(\n amount: $amount\n target: $target\n condition: $condition\n currency: $currency\n identifier: $identifier\n ) {\n ...CasinoBet\n state {\n ...CasinoGameDice\n }\n }\n}\n\nfragment CasinoBet on CasinoBet {\n id\n active\n payoutMultiplier\n amountMultiplier\n amount\n payout\n updatedAt\n currency\n game\n user {\n id\n name\n }\n}\n\nfragment CasinoGameDice on CasinoGameDice {\n result\n target\n condition\n}\n"

variables: {target: 50.5, condition: "above", identifier: "Rpw_fwf36OjBGdsR6VSp", amount: 0.00001,…}

where can i find out the value of this variable "identifier"?

You can copy identifier from that Network request and pass same one everytime you send another request to that API endpoint. At least that is how it works for me.

Posted
1 hour ago, ROkenTratENsaV said:

You can copy identifier from that Network request and pass same one everytime you send another request to that API endpoint. At least that is how it works for me.

You don't even need the identifier prop.  You could get rid of it or make it an empty string and it still works.  I think it acts sort of like a cookie to remember the last state of your browser - could be wrong though.

 

3 hours ago, ROkenTratENsaV said:

Copy the graphql request it makes when you play from browsers network tab.
Replace 'x-access-token' with your API key (headers).

Then you can edit request variables (like target multi, betsize etc) from query and send that to 'https://api.stake.com/graphql', which should return answer for your placed bet :)

If you're running the script it in your browser console you can also just call the api key from your local storage like this:

const KEY = JSON.parse(localStorage.getItem("session"));

------

const HEADERS = {"content-type":"application/json","x-access-token":KEY };

 

-----

//then in the post request just put 

"headers": HEADERS,

 

This way you can share the code and reuse it without ever having to touch your api key.  Won't work if you're doing it from a separate terminal though.

 

 

Posted
8 hours ago, ROkenTratENsaV said:

You can copy identifier from that Network request and pass same one everytime you send another request to that API endpoint. At least that is how it works for me.

thanks, everything is good)

  • Moderator
Posted
8 hours ago, dupeddonk said:

You don't even need the identifier prop.  You could get rid of it or make it an empty string and it still works.  I think it acts sort of like a cookie to remember the last state of your browser - could be wrong though.

Probably yeah.

 

 

8 hours ago, dupeddonk said:

If you're running the script it in your browser console you can also just call the api key from your local storage like this:

const KEY = JSON.parse(localStorage.getItem("session"));

------

const HEADERS = {"content-type":"application/json","x-access-token":KEY };

 

-----

//then in the post request just put 

"headers": HEADERS,

 

This way you can share the code and reuse it without ever having to touch your api key.  Won't work if you're doing it from a separate terminal though.

 

 

That's good way to do it 👏 I'm doing my API usage via Python, so that's why my tips and tricks may vary 😃

Posted
9 hours ago, ROkenTratENsaV said:

Probably yeah.

 

 

That's good way to do it 👏 I'm doing my API usage via Python, so that's why my tips and tricks may vary 😃

thanks for the help, I use JS)

  • 11 months later...
Posted
On 1/27/2022 at 5:10 PM, ROkenTratENsaV said:

Probably yeah.

 

 

That's good way to do it 👏 I'm doing my API usage via Python, so that's why my tips and tricks may vary 😃

Can you give me the code to get the balance in python?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

Privacy Policy Terms of Use