Jump to content

API Import Bet History: to Google Sheets


Seoulmate

Featured Comment

Posted

Hi Guys has anyone managed to find away to import their bet history via Stakes API into gooogle sheets?

I think the limit is 500 wagers.

Is this something that is easy to do? or does it require a large amount of scripting?

Appreciate any advice offered, thanks.

Posted

Yes, the limit is 500 and that might not be really difficult, what might be a little more difficult would be to try with the Bet Archive. You can either download them manually (which I don't really recommend, but everyone does what they think is the best), or you can try to write a script to download them all, and you'll have a few json files, which are really easy to read and further write in Google Spreadsheets. I don't think there is of any use the API Stake has if you want more than 500 bets.

Posted

I am hoping there is a much easier way to view bet history including the really really old betIDs which are in the early days of years ago too if possible.

Posted
19 minutes ago, skywallkee said:

Yes, the limit is 500 and that might not be really difficult, what might be a little more difficult would be to try with the Bet Archive. You can either download them manually (which I don't really recommend, but everyone does what they think is the best), or you can try to write a script to download them all, and you'll have a few json files, which are really easy to read and further write in Google Spreadsheets. I don't think there is of any use the API Stake has if you want more than 500 bets.

Ideally Id just like to have a google sheet auto update with the last 500 bets using the stake api.

Ive downloaded the json formatted files converted the files to csv format imported to google sheets, its far too time consuming.

Posted

Yes you should be able to do this within Google Sheets - I will see if i can help with this here when I have a little free time. I def think there needs to be some better way of viewing your roll history. The JSON download is nice and all, but its just raw data which needs to be converted like you said. Even then, its got a lot of data points that are unnecessary and its missing some really important ones such as the front end bet ID. instead it shows the "real" ID of the bet, however we cant really do anything with this. Anyhow, ill see what I can do to help with getting the APi to fill data points within Google Sheets.

Posted

Now few weeks change everything statistics , transaction history and so many other things I think this is not good old settings very good and easy watch everything but now so many things missing

Posted

I think it has to be for something external. And it should be done as soon as possible. Because the site has been changing a lot here. 

I don't see much interest in saving these things. But there are those who like to see and write down everything.

Posted
On 1/6/2020 at 5:52 PM, blockbet said:

Yes you should be able to do this within Google Sheets - I will see if i can help with this here when I have a little free time. I def think there needs to be some better way of viewing your roll history. The JSON download is nice and all, but its just raw data which needs to be converted like you said. Even then, its got a lot of data points that are unnecessary and its missing some really important ones such as the front end bet ID. instead it shows the "real" ID of the bet, however we cant really do anything with this. Anyhow, ill see what I can do to help with getting the APi to fill data points within Google Sheets.

for my own purposes I just need the result from each limbo roll, if that makes it any easier

Posted

Okay so as a few of you (and maybe more) don't really know how to do it, I made you a little script in Python that works. Use with caution, as I didn't put any validators, so if you run it with wrong data, it won't affect your account in any way, but the script will simply crash.

Here you can download the script: (I don't know for how long I will keep it on my drive, might be for a few days, or years, so take it now if you know you need it) https://drive.google.com/open?id=1VK_MCk5jjhlYuhN0D8wlTpCTrOpTV7zD

And some steps on how to use it:

1. You will need to install Python (if you don't have it already installed). If you have Windows 10, then you can simply go to the Microsoft Store, write Python and you can select any Python 3.7 or Python 3.8, as any of them will work with this script.

image.thumb.png.783c1c0b4d0f8caeb0c931e67147cd34.png

On that page you'll press Get (it's Free so don't worry about anything, no matter the country), and then Install.

NOTE: If you have another Windows than 10, then you might want to install it from here: https://www.python.org/downloads/ (and BE SURE to check Add to Path while installing and Install PIP otherwise it won't work at all). If you have Linux or Mac OS, then I'm pretty sure you might've had it already installed by default, if not, the link provided above works for you too.

2. If you finished/already had Python installed, then you will also need Python Requests to use it (as in order to communicate with Stake's API we need to make requests). You can do it like this:

- Press the Start Menu

- Write CMD and an app named "Command Prompt" will appear. Right click it and select "Run as Administrator"

NOTE: For Linux/Mac OS you just have to open the Command Line, which you should pretty much be aware of how to do so

- You'll see a black box, in which you'll have to write:

pip install requests

OR

pip3 install requests

(It might vary, but both should work if you have Python installed correctly)

3. Now you have Python and Python Requests installed, you can proceed in using the script. You can open it with any editor (notepad works too, it doesn't really matter) and you'll see the code which will look like this:

image.thumb.png.3c0f3f328fb2111dfdcc5c63d7aac728.png

The parts of code I have underlined are the only ones that you should modify (if you don't know what you're doing). The 50 underlined are the number of bets to extract from history. The first pair of quotes will take your Stake username (the platform, not the forum username), the second quotes is the game you want to get your bets from; I wrote in this post all the available games:

 The third pair of quotes is the name of the CSV file it will import the games to and the fourth pair is your token you get from Stake's Account Settings. If you have your account on public then you can also leave that pair blank.

4. After editing the file by your needs, now you can save it and run as following:

Open the Command Prompt again (check out the instructions from above) and write: "cd PATH_TO_FILE" where PATH_TO_FILE is where it is located at. For me, it is on Desktop, so I'll write: "cd C:/Users/skywallkee/Desktop" (WITHOUT quotes). Now, you can write "python3 StakeBetsToCSV.py" (again, WITHOUT quotes).

5. After this step, you're done, you have all your past 500 bets saved in a CSV file which you can import on Google Spreadsheets. From now on, you'll only need to edit the Game name from the file and the number of bets you want to extract and then simply run the app. (meaning you only need to do from now on steps 3 and 4).

If you have any questions, don't ask me. 😂 (I'm joking) Feel free to ask any question. I might not modify this code for your needs, you can do whatever you want with it from now on :D

image.png

Posted
2 hours ago, Jelanstream said:

I don't know what is the easy way to see old old bets I want to see my 50,000x on limbo hit that's very old but I don't know how to see it.

Best create your own topic and ask that question, "How to find an Old bet?"
Very few people will see your question buried here, aside from that its not so cool to hijack an existing topic, for your own needs.

3 hours ago, skywallkee said:

Okay so as a few of you (and maybe more) don't really know how to do it, I made you a little script in Python that works. Use with caution, as I didn't put any validators, so if you run it with wrong data, it won't affect your account in any way, but the script will simply crash.

Here you can download the script: (I don't know for how long I will keep it on my drive, might be for a few days, or years, so take it now if you know you need it) https://drive.google.com/open?id=1VK_MCk5jjhlYuhN0D8wlTpCTrOpTV7zD

And some steps on how to use it:

1. You will need to install Python (if you don't have it already installed). If you have Windows 10, then you can simply go to the Microsoft Store, write Python and you can select any Python 3.7 or Python 3.8, as any of them will work with this script.

image.thumb.png.783c1c0b4d0f8caeb0c931e67147cd34.png

On that page you'll press Get (it's Free so don't worry about anything, no matter the country), and then Install.

NOTE: If you have another Windows than 10, then you might want to install it from here: https://www.python.org/downloads/ (and BE SURE to check Add to Path while installing and Install PIP otherwise it won't work at all). If you have Linux or Mac OS, then I'm pretty sure you might've had it already installed by default, if not, the link provided above works for you too.

2. If you finished/already had Python installed, then you will also need Python Requests to use it (as in order to communicate with Stake's API we need to make requests). You can do it like this:

- Press the Start Menu

- Write CMD and an app named "Command Prompt" will appear. Right click it and select "Run as Administrator"

NOTE: For Linux/Mac OS you just have to open the Command Line, which you should pretty much be aware of how to do so

- You'll see a black box, in which you'll have to write:

pip install requests

OR

pip3 install requests

(It might vary, but both should work if you have Python installed correctly)

3. Now you have Python and Python Requests installed, you can proceed in using the script. You can open it with any editor (notepad works too, it doesn't really matter) and you'll see the code which will look like this:

image.thumb.png.3c0f3f328fb2111dfdcc5c63d7aac728.png

The parts of code I have underlined are the only ones that you should modify (if you don't know what you're doing). The 50 underlined are the number of bets to extract from history. The first pair of quotes will take your Stake username (the platform, not the forum username), the second quotes is the game you want to get your bets from; I wrote in this post all the available games:

 The third pair of quotes is the name of the CSV file it will import the games to and the fourth pair is your token you get from Stake's Account Settings. If you have your account on public then you can also leave that pair blank.

4. After editing the file by your needs, now you can save it and run as following:

Open the Command Prompt again (check out the instructions from above) and write: "cd PATH_TO_FILE" where PATH_TO_FILE is where it is located at. For me, it is on Desktop, so I'll write: "cd C:/Users/skywallkee/Desktop" (WITHOUT quotes). Now, you can write "python3 StakeBetsToCSV.py" (again, WITHOUT quotes).

5. After this step, you're done, you have all your past 500 bets saved in a CSV file which you can import on Google Spreadsheets. From now on, you'll only need to edit the Game name from the file and the number of bets you want to extract and then simply run the app. (meaning you only need to do from now on steps 3 and 4).

If you have any questions, don't ask me. 😂 (I'm joking) Feel free to ask any question. I might not modify this code for your needs, you can do whatever you want with it from now on :D

image.png

wow thats amazing man thanks for that, maybe you should post it as a guide in the guide section, so you get more credit for your work.

Posted
1 hour ago, sheenazbay said:

if i want to see bet id more than 500 bet, i download bet archive. maybe you can download bet archive to see all your bets. and i did it and that's easy to do. good luck..

Thats the problem it takes too long to download then convert to csv then filter out what I dont need, and its one history file per day. So you need do download and convert multiple files one by one.

 

Posted
On 1/8/2020 at 5:21 PM, Seoulmate said:

Thats the problem it takes too long to download then convert to csv then filter out what I dont need, and its one history file per day. So you need do download and convert multiple files one by one.

 

yes it does take a long time depending on how many bet archives we want to download, but that's the only way we can know our bet id is above 500 bets, need to be more patient in downloading😃

Posted
2 hours ago, sheenazbay said:

yes it does take a long time depending on how many bet archives we want to download, but that's the only way we can know our bet id is above 500 bets, need to be more patient in downloading😃

You assume I am impatient. This is incorrect. If stake are going to provide an archive it may as well be easy to use. Making it overly complex for players, serves no purpose.

On 1/8/2020 at 2:09 AM, skywallkee said:

Okay so as a few of you (and maybe more) don't really know how to do it, I made you a little script in Python that works. Use with caution, as I didn't put any validators, so if you run it with wrong data, it won't affect your account in any way, but the script will simply crash.

Here you can download the script: (I don't know for how long I will keep it on my drive, might be for a few days, or years, so take it now if you know you need it) https://drive.google.com/open?id=1VK_MCk5jjhlYuhN0D8wlTpCTrOpTV7zD

And some steps on how to use it:

1. You will need to install Python (if you don't have it already installed). If you have Windows 10, then you can simply go to the Microsoft Store, write Python and you can select any Python 3.7 or Python 3.8, as any of them will work with this script.

image.thumb.png.783c1c0b4d0f8caeb0c931e67147cd34.png

On that page you'll press Get (it's Free so don't worry about anything, no matter the country), and then Install.

NOTE: If you have another Windows than 10, then you might want to install it from here: https://www.python.org/downloads/ (and BE SURE to check Add to Path while installing and Install PIP otherwise it won't work at all). If you have Linux or Mac OS, then I'm pretty sure you might've had it already installed by default, if not, the link provided above works for you too.

2. If you finished/already had Python installed, then you will also need Python Requests to use it (as in order to communicate with Stake's API we need to make requests). You can do it like this:

- Press the Start Menu

- Write CMD and an app named "Command Prompt" will appear. Right click it and select "Run as Administrator"

NOTE: For Linux/Mac OS you just have to open the Command Line, which you should pretty much be aware of how to do so

- You'll see a black box, in which you'll have to write:

pip install requests

OR

pip3 install requests

(It might vary, but both should work if you have Python installed correctly)

3. Now you have Python and Python Requests installed, you can proceed in using the script. You can open it with any editor (notepad works too, it doesn't really matter) and you'll see the code which will look like this:

image.thumb.png.3c0f3f328fb2111dfdcc5c63d7aac728.png

The parts of code I have underlined are the only ones that you should modify (if you don't know what you're doing). The 50 underlined are the number of bets to extract from history. The first pair of quotes will take your Stake username (the platform, not the forum username), the second quotes is the game you want to get your bets from; I wrote in this post all the available games:

 The third pair of quotes is the name of the CSV file it will import the games to and the fourth pair is your token you get from Stake's Account Settings. If you have your account on public then you can also leave that pair blank.

4. After editing the file by your needs, now you can save it and run as following:

Open the Command Prompt again (check out the instructions from above) and write: "cd PATH_TO_FILE" where PATH_TO_FILE is where it is located at. For me, it is on Desktop, so I'll write: "cd C:/Users/skywallkee/Desktop" (WITHOUT quotes). Now, you can write "python3 StakeBetsToCSV.py" (again, WITHOUT quotes).

5. After this step, you're done, you have all your past 500 bets saved in a CSV file which you can import on Google Spreadsheets. From now on, you'll only need to edit the Game name from the file and the number of bets you want to extract and then simply run the app. (meaning you only need to do from now on steps 3 and 4).

If you have any questions, don't ask me. 😂 (I'm joking) Feel free to ask any question. I might not modify this code for your needs, you can do whatever you want with it from now on :D

image.png

I notice you don't list the bet result in the script. Is it not possible to obtain the bet result via api?


image.thumb.png.def982ddea9a910acb05975909e92c07.png

Posted
42 minutes ago, Seoulmate said:

You assume I am impatient. This is incorrect. If stake are going to provide an archive it may as well be easy to use. Making it overly complex for players, serves no purpose.

I notice you don't list the bet result in the script. Is it not possible to obtain the bet result via api?


image.thumb.png.def982ddea9a910acb05975909e92c07.png

As far as I'm aware of, those are all the columns you can extract from the API. You can determine whether the bet was a win or not by checking the payout multiplier (I think, am not home now to actually check it, but I believe it is equal to amount multiplier if you won or 0/1 if you lost). A result column would actually be pointless if you can determine it from the columns themselves.

But you can check it out, there might be a result column, as I said, I'm not home to check it myself.

Posted
5 minutes ago, skywallkee said:

As far as I'm aware of, those are all the columns you can extract from the API. You can determine whether the bet was a win or not by checking the payout multiplier (I think, am not home now to actually check it, but I believe it is equal to amount multiplier if you won or 0/1 if you lost). A result column would actually be pointless if you can determine it from the columns themselves.

But you can check it out, there might be a result column, as I said, I'm not home to check it myself.

I play Limbo mostly, there is a result column in the archived json file, I just never see result listed in any examples given. I'd just hate to spend an hour setting everything up only to find I cant actually get the data I need.

  • 1 year later...
Posted
On 1/8/2020 at 1:09 AM, skywallkee said:

Okay so as a few of you (and maybe more) don't really know how to do it, I made you a little script in Python that works. Use with caution, as I didn't put any validators, so if you run it with wrong data, it won't affect your account in any way, but the script will simply crash.

Here you can download the script: (I don't know for how long I will keep it on my drive, might be for a few days, or years, so take it now if you know you need it) https://drive.google.com/open?id=1VK_MCk5jjhlYuhN0D8wlTpCTrOpTV7zD

And some steps on how to use it:

1. You will need to install Python (if you don't have it already installed). If you have Windows 10, then you can simply go to the Microsoft Store, write Python and you can select any Python 3.7 or Python 3.8, as any of them will work with this script.

image.thumb.png.783c1c0b4d0f8caeb0c931e67147cd34.png

On that page you'll press Get (it's Free so don't worry about anything, no matter the country), and then Install.

NOTE: If you have another Windows than 10, then you might want to install it from here: https://www.python.org/downloads/ (and BE SURE to check Add to Path while installing and Install PIP otherwise it won't work at all). If you have Linux or Mac OS, then I'm pretty sure you might've had it already installed by default, if not, the link provided above works for you too.

2. If you finished/already had Python installed, then you will also need Python Requests to use it (as in order to communicate with Stake's API we need to make requests). You can do it like this:

- Press the Start Menu

- Write CMD and an app named "Command Prompt" will appear. Right click it and select "Run as Administrator"

NOTE: For Linux/Mac OS you just have to open the Command Line, which you should pretty much be aware of how to do so

- You'll see a black box, in which you'll have to write:

pip install requests

OR

pip3 install requests

(It might vary, but both should work if you have Python installed correctly)

3. Now you have Python and Python Requests installed, you can proceed in using the script. You can open it with any editor (notepad works too, it doesn't really matter) and you'll see the code which will look like this:

image.thumb.png.3c0f3f328fb2111dfdcc5c63d7aac728.png

The parts of code I have underlined are the only ones that you should modify (if you don't know what you're doing). The 50 underlined are the number of bets to extract from history. The first pair of quotes will take your Stake username (the platform, not the forum username), the second quotes is the game you want to get your bets from; I wrote in this post all the available games:

 The third pair of quotes is the name of the CSV file it will import the games to and the fourth pair is your token you get from Stake's Account Settings. If you have your account on public then you can also leave that pair blank.

4. After editing the file by your needs, now you can save it and run as following:

Open the Command Prompt again (check out the instructions from above) and write: "cd PATH_TO_FILE" where PATH_TO_FILE is where it is located at. For me, it is on Desktop, so I'll write: "cd C:/Users/skywallkee/Desktop" (WITHOUT quotes). Now, you can write "python3 StakeBetsToCSV.py" (again, WITHOUT quotes).

5. After this step, you're done, you have all your past 500 bets saved in a CSV file which you can import on Google Spreadsheets. From now on, you'll only need to edit the Game name from the file and the number of bets you want to extract and then simply run the app. (meaning you only need to do from now on steps 3 and 4).

If you have any questions, don't ask me. 😂 (I'm joking) Feel free to ask any question. I might not modify this code for your needs, you can do whatever you want with it from now on :D

image.png

I'm testing your script but not work

Posted
30 minutes ago, coindropers said:

I'm testing your script but not work

I'm not really sure how you've got the script as I've taken it down from drive. If you have it since before me taking it down, you can at least tell me what happens for it to not work (any error, message, anything). I can't seem to find the Stake API Help thread to redirect you there (might've been taken down).

So your best chance is to use any other tool that does the same (there was some site made by a user of Primedice a while ago, I don't know if it's still up, but you can search for it)

Archived

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

×
×
  • Create New...

Important Information

Privacy Policy Terms of Use