Programming a crypto-trading bot is a great way to start trading algorithmically. This post will outline how to program your own simple bot by interfacing with the Bittrex API. For this guide you will need Python 3 installed, and a competent text editor. This post will not cover the basics of programming, as there are hundreds of resources that already cover that angle. If you have any questions feel free to comment below. To begin, you will need an API key from Bittrex. Login to your account, and then head to the settings page. Click on the API Keys section, and then create a new one. If you have 2FA enabled, you will need to enter your key before creating it.  Now that we have our key, let's create our bot. The architecture will be very simple. The bot will run indefinitely and query for markets every 30 seconds. Using our simple algorithm the bot will open buy / sell positions. The resulting bot will be extremely dumb, but this guide should serve as a base for you to develop your own trading algorithm. Begin with a fresh Python file, and the contents from below. Make sure to adjust the API_KEY and API_SECRET_KEY values. ```python import time import requests import hashlib import hmac TICK_INTERVAL = 60 # seconds API_KEY = 'my-api-key' API_SECRET_KEY = b'my-api-secret-key' def main(): print('Starting trader bot, ticking every ' + str(TICK_INTERVAL) + 'seconds') def format_float(f): return "%.8f" % f if __name__ == "__main__": main() ``` Running the program now won't do much. The print statement will execute, and we will see some text in the console, but the program will exit immediately after. Most bots run indefinitely until terminated by the operator. Let's setup our bot to do the same. Update the main() method with the following changes, and also add the new tick() method stub. ```python def main(): print('Starting trader bot, ticking every ' + str(TICK_INTERVAL) + 'seconds') while True: start = time.time() tick() end = time.time() # Sleep the thread if needed if end - start < TICK_INTERVAL: time.sleep(TICK_INTERVAL - (end - start)) def tick(): pass ``` Now our bot will run it's tick method every 30 seconds while accounting for any latency in the tick method itself. Next we need to flesh out the tick method. This is where most of the program logic will live. ```python def tick(): print('Running routine') market_summaries = simple_reqest('https://bittrex.com/api/v1.1/public/getmarketsummaries') for summary in market_summaries['result']: market = summary['MarketName'] day_close = summary['PrevDay'] last = summary['Last'] percent_chg = ((last / day_close) - 1) * 100 print(market + ' changed ' + str(percent_chg)) def simple_reqest(url): r = requests.get(url) return r.json() ``` Now if you run the program you'll see that the bot queries all of the available markets on Bittrex and then prints the percentage the market has changed over the last 24 hours. We've also added the simple_request() method which dispatches an HTTP request and then converts the response to JSON. Our bot is cool and all, but it doesn't actually trade any crypto yet. Let's flesh out our advanced algorithm to place buy and sell orders. We'll need a few things including a way to make signed requests which the Bittrex API expects when making trades. ```python def tick(): print('Running routine') market_summaries = simple_reqest('https://bittrex.com/api/v1.1/public/getmarketsummaries') for summary in market_summaries['result']: market = summary['MarketName'] day_close = summary['PrevDay'] last = summary['Last'] percent_chg = ((last / day_close) - 1) * 100 print(market + ' changed ' + str(percent_chg)) if 40 < percent_chg < 60: # Fomo strikes! Let's buy some print('Purchasing 5 units of ' + market + ' for ' + str(format_float(last))) res = buy_limit(market, 5, last) print(res) if percent_chg < -20: # Ship is sinking, get out! sell_limit(market, 5, last) def buy_limit(market, quantity, rate): url = 'https://bittrex.com/api/v1.1/market/buylimit?apikey=' + API_KEY + '&market=' + market + '&quantity=' + str(quantity) + '&rate=' + format_float(rate) return signed_request(url) def sell_limit(market, quantity, rate): url = 'https://bittrex.com/api/v1.1/market/selllimit?apikey=' + API_KEY + '&market=' + market + '&quantity=' + str(quantity) + '&rate=' + format_float(rate) return signed_request(url) def signed_request(url): now = time.time() url += '&nonce=' + str(now) signed = hmac.new(API_SECRET_KEY, url.encode('utf-8'), hashlib.sha512).hexdigest() headers = {'apisign': signed} r = requests.get(url, headers=headers) return r.json() ``` There's quite a bit going on here. Let's break it down. The new logic in our tick() method includes the meat of our algorithm. ```python if 40 < percent_chg < 60: # Fomo strikes! Let's buy some print('Purchasing 5 units of ' + market + ' for ' + str(format_float(last))) res = buy_limit(market, 5, last) print(res) if percent_chg < -20: # Ship is sinking, get out! sell_limit(market, 5, last) ``` As you can see, this algorithm is extremely stupid. This bot trades based only on the 24 hour change of a coin. Despite this silly example, it should serve as a gateway for you to begin fleshing out your own secret algorithm. We've also added some new methods to handle placing buy and sell orders. These methods require an API key because they modify aspects of your account. The final method we added, signed_request(), is needed to send a valid request to Bittrex. The specifics of this are outlined in the Bittrex developer's guide online. I hope this guide helps you on your way to riches! Feel free to ask for help in the comments if you get lost or stuck.
author | tstieff |
---|---|
permlink | programming-your-first-cryptobot |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency","programming","python"],"image":["https://steemitimages.com/DQmddh2BvAr24W3G4jVZoKczKebGsU9bCdX24tErrWoyDSP/api_key.png"],"app":"steemit/0.1","format":"markdown"} |
created | 2017-07-14 23:55:21 |
last_update | 2017-07-14 23:55:21 |
depth | 0 |
children | 27 |
last_payout | 2017-07-21 23:55:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 4.690 HBD |
curator_payout_value | 0.224 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 6,223 |
author_reputation | 474,755,008,115 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,513,611 |
net_rshares | 1,134,790,001,514 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
anthonyc | 0 | 0 | 100% | ||
xaero1 | 0 | 838,145,399,332 | 10% | ||
catotune | 0 | 34,717,795,201 | 100% | ||
steemalf | 0 | 9,752,785,816 | 100% | ||
vidallia | 0 | 14,015,736,211 | 60% | ||
tfj | 0 | 47,759,731,619 | 100% | ||
nicnicy | 0 | 3,121,993,231 | 100% | ||
chasmic-cosm | 0 | 5,445,652,652 | 100% | ||
peterokwara | 0 | 6,061,934,339 | 100% | ||
freefromchainz2 | 0 | 0 | 100% | ||
almost-digital | 0 | 164,397,523,258 | 100% | ||
limnade | 0 | 1,154,320,682 | 100% | ||
cybersphere | 0 | 1,187,515,003 | 100% | ||
arthurhetorical | 0 | 1,164,755,826 | 100% | ||
mohammedfelahi | 0 | 94,890,597 | 100% | ||
stefen | 0 | 138,284,012 | 100% | ||
chrone | 0 | 3,148,739,101 | 100% | ||
jamescash | 0 | 1,102,645,758 | 100% | ||
geneeverett | 0 | 101,396,405 | 100% | ||
nyani14 | 0 | 1,160,673,847 | 100% | ||
tstieff | 0 | 1,149,066,599 | 100% | ||
ramzialhaddadtm | 0 | 969,162,025 | 100% | ||
stevencurrie | 0 | 0 | 100% | ||
n33l4m1n | 0 | 0 | 100% | ||
allanpallan | 0 | 0 | 100% | ||
edgeofspace90 | 0 | 0 | 100% | ||
bon07 | 0 | 0 | 100% | ||
greentree1 | 0 | 0 | 100% | ||
gimpman | 0 | 0 | 100% | ||
sparkstheone | 0 | 0 | 100% | ||
socket1312 | 0 | 0 | 100% | ||
seigneur774 | 0 | 0 | 100% | ||
cryptothing | 0 | 0 | 100% | ||
dgolcher | 0 | 0 | 100% | ||
beastlord | 0 | 0 | 100% | ||
dannycrypto | 0 | 0 | 100% | ||
worstcritic | 0 | 0 | 100% | ||
theshortpencil | 0 | 0 | 100% | ||
hexelbyte | 0 | 0 | 100% | ||
daniel-h | 0 | 0 | 100% | ||
fadyothman | 0 | 0 | 100% | ||
scoobyxo | 0 | 0 | 100% |
Thank you. It is one of the most informative crypto API tutorials i have come across. Code is very clear and easy to follow. I tried to write it myself, but got myself lost in hmac. Your code resolved it brilliantly. One thing what could make this tutorial rock the world would be a function example what calls wallet balances. I am trying to make it work, but I get no response back.
author | allanpallan |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20170824t115527417z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-08-24 11:55:30 |
last_update | 2017-08-24 11:55:30 |
depth | 1 |
children | 1 |
last_payout | 2017-08-31 11:55:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 387 |
author_reputation | 22,772,319 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 12,731,359 |
net_rshares | 0 |
I will cover more of the API calls in part two.
author | tstieff |
---|---|
permlink | re-allanpallan-re-tstieff-programming-your-first-cryptobot-20170914t130540266z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-09-14 13:05:39 |
last_update | 2017-09-14 13:05:39 |
depth | 2 |
children | 0 |
last_payout | 2017-09-21 13:05:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 47 |
author_reputation | 474,755,008,115 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 14,861,553 |
net_rshares | 0 |
Resteemed so i can test it later when i have more time. Thanks for sharing this information
author | gniksivart |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20170715t010636357z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-15 01:06:42 |
last_update | 2017-07-15 01:07:09 |
depth | 1 |
children | 0 |
last_payout | 2017-07-22 01:06:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 91 |
author_reputation | 74,197,147,678,652 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,518,266 |
net_rshares | 0 |
Well done post thanks for sharing
author | hamzaoui |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20170715t000738850z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-15 00:07:54 |
last_update | 2017-07-15 00:07:54 |
depth | 1 |
children | 0 |
last_payout | 2017-07-22 00:07:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 33 |
author_reputation | 2,667,249,998,202 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,514,413 |
net_rshares | 0 |
Nice break down! Seems simple enough.
author | jamescash | ||||||
---|---|---|---|---|---|---|---|
permlink | re-tstieff-2017715t03828643z | ||||||
category | cryptocurrency | ||||||
json_metadata | {"tags":"cryptocurrency","app":"esteem/1.4.7","format":"markdown+html","community":"esteem"} | ||||||
created | 2017-07-15 05:38:42 | ||||||
last_update | 2017-07-15 05:38:42 | ||||||
depth | 1 | ||||||
children | 0 | ||||||
last_payout | 2017-07-22 05:38:42 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 0.000 HBD | ||||||
curator_payout_value | 0.000 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 37 | ||||||
author_reputation | 158,876,890,827 | ||||||
root_title | "Programming your first Cryptobot" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 8,535,360 | ||||||
net_rshares | 0 |
thank you very much for your post actually I am just trying to fetch the balance from bittrex using the api key but it doesnt seem to work https://bittrex.com/api/v1.1/account/getbalance?apikey=key¤cy=BTC this url returns a false response  I researched a little bit more and I found something like we need to add nonce in the url so I appended nonce=str(time.time()) to the url but still it gives some kind of error. and it seems like the url requires some kind of signature inplace of apikey where the signature is some hash value well whatever it is, can you please help me fetch the balance from bittrex this is my basic code I tried from urllib.parse import urlencode import urllib.request import json import time import hmac import hashlib values={} secret='xxxxxxxxxxxxxxxxxxxxxxxxx' key='xxxxxxxxxxxxxxxxxxxxxxx' url = 'https://bittrex.com/api/v1.1/account/' url += 'getbalance' + '?' + urlencode(values) url += '&apikey=' + key url += '&nonce=' + str(int(time.time())) signature = hmac.new(b'key', url, hashlib.sha512).hexdigest() headers = {'apisign': signature} print (url) this code still gives some error
author | maheshmnj |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20180307t151221547z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"image":["https://steemitimages.com/DQmahUZboyQPRaTpmudhdjcLxK4BsiPY21oBi16xTUZM4bz/Capture.PNG"],"links":["https://bittrex.com/api/v1.1/account/getbalance?apikey=key&currency=BTC","https://bittrex.com/api/v1.1/account/"],"app":"steemit/0.1"} |
created | 2018-03-07 15:12:27 |
last_update | 2018-03-07 15:12:27 |
depth | 1 |
children | 0 |
last_payout | 2018-03-14 15:12:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,232 |
author_reputation | 40,762,185,723 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 42,894,158 |
net_rshares | 0 |
Can we expect any follow up on this article with more updates?
author | maryoush |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20170817t100257946z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"busy/1.0.0"} |
created | 2017-08-17 10:02:57 |
last_update | 2017-08-17 10:02:57 |
depth | 1 |
children | 1 |
last_payout | 2017-08-24 10:02:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 62 |
author_reputation | 2,525,621,633 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 12,070,144 |
net_rshares | 0 |
Yes, I plan on writing a follow up this week.
author | tstieff |
---|---|
permlink | re-maryoush-re-tstieff-programming-your-first-cryptobot-20170914t130514688z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-09-14 13:05:15 |
last_update | 2017-09-14 13:05:15 |
depth | 2 |
children | 0 |
last_payout | 2017-09-21 13:05:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 45 |
author_reputation | 474,755,008,115 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 14,861,515 |
net_rshares | 0 |
A sample code on github would also be cool, such that one can download and review later :-)
author | peterokwara |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20170716t231346971z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-16 23:13:51 |
last_update | 2017-07-16 23:13:51 |
depth | 1 |
children | 4 |
last_payout | 2017-07-23 23:13:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 91 |
author_reputation | 10,298,335,755 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,713,662 |
net_rshares | 0 |
A great suggestion indeed. I've uploaded the final product to https://github.com/tmstieff/BittrexBot
author | tstieff |
---|---|
permlink | re-peterokwara-re-tstieff-programming-your-first-cryptobot-20170716t233056059z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"links":["https://github.com/tmstieff/BittrexBot"],"app":"steemit/0.1"} |
created | 2017-07-16 23:30:57 |
last_update | 2017-07-16 23:30:57 |
depth | 2 |
children | 3 |
last_payout | 2017-07-23 23:30:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.021 HBD |
curator_payout_value | 0.007 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 100 |
author_reputation | 474,755,008,115 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,714,395 |
net_rshares | 6,061,934,339 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
peterokwara | 0 | 6,061,934,339 | 100% | ||
dannycrypto | 0 | 0 | 100% |
Can this also apply to Poloniex's API?
author | freefromchainz2 |
---|---|
permlink | re-tstieff-re-peterokwara-re-tstieff-programming-your-first-cryptobot-20170806t032646110z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-08-06 03:26:48 |
last_update | 2017-08-06 03:26:48 |
depth | 3 |
children | 1 |
last_payout | 2017-08-13 03:26:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 38 |
author_reputation | 3,011,488,720 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 10,906,328 |
net_rshares | 0 |
Awesome! Thanks :-)
author | peterokwara |
---|---|
permlink | re-tstieff-re-peterokwara-re-tstieff-programming-your-first-cryptobot-20170718t093047060z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-18 09:30:48 |
last_update | 2017-07-18 09:31:15 |
depth | 3 |
children | 0 |
last_payout | 2017-07-25 09:30:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 19 |
author_reputation | 10,298,335,755 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,856,603 |
net_rshares | 0 |
Simple and clear!
author | podinatutorials |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20180505t134515072z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2018-05-05 13:45:18 |
last_update | 2018-05-05 13:45:18 |
depth | 1 |
children | 0 |
last_payout | 2018-05-12 13:45:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.049 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 17 |
author_reputation | 1,246,112,992,923 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 54,025,690 |
net_rshares | 9,332,334,986 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
podinatutorials | 0 | 9,332,334,986 | 100% |
Hi @tstieff, Thank you for sharing this info! I'm looking for an API that allows me to create content (POSTs). I have been reading the documentation and it seems that we can only retrieve information or just create a comments or up-vote. I wonder if you could point me to some API that allows creating POST in steemit.com. Thanks, @realskilled
author | realskilled |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20171008t201850079z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"users":["tstieff","realskilled"],"app":"steemit/0.1"} |
created | 2017-10-08 20:18:48 |
last_update | 2017-10-08 20:18:48 |
depth | 1 |
children | 0 |
last_payout | 2017-10-15 20:18:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 348 |
author_reputation | -65,196,368,224 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 17,135,957 |
net_rshares | 0 |
This will be very helpful.
author | scoobyxo |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20180511t064446223z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2018-05-11 06:45:00 |
last_update | 2018-05-11 06:45:00 |
depth | 1 |
children | 0 |
last_payout | 2018-05-18 06:45:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 26 |
author_reputation | 1,510,529,784 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 55,091,628 |
net_rshares | 0 |
Thanks, I took inspiration from your post and have created a Godot Engine one: https://steemit.com/utopian-io/@sp33dy/https-rest-calls-crypto-price-monitor for those that know Godot Engine. Demonstrates how to create a simple price checker for any currency (ok, its Bitcoin right now, but easy to change)
author | sp33dy |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20180127t161841482z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"links":["https://steemit.com/utopian-io/@sp33dy/https-rest-calls-crypto-price-monitor"],"app":"steemit/0.1"} |
created | 2018-01-27 16:18:42 |
last_update | 2018-01-27 16:18:42 |
depth | 1 |
children | 0 |
last_payout | 2018-02-03 16:18:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 307 |
author_reputation | 3,475,579,509,208 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 32,776,376 |
net_rshares | 0 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
daniel-h | 0 | 0 | 100% |
This is a C language right?
author | stefen |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20170715t000417232z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-15 00:04:21 |
last_update | 2017-07-15 00:04:21 |
depth | 1 |
children | 2 |
last_payout | 2017-07-22 00:04:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 27 |
author_reputation | 6,803,833,244,756 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,514,210 |
net_rshares | 0 |
This is written using Python, but you could easily translate it to whatever language you're comfortable with.
author | tstieff |
---|---|
permlink | re-stefen-re-tstieff-programming-your-first-cryptobot-20170715t000831165z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-15 00:08:30 |
last_update | 2017-07-15 00:08:30 |
depth | 2 |
children | 1 |
last_payout | 2017-07-22 00:08:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 109 |
author_reputation | 474,755,008,115 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,514,453 |
net_rshares | 0 |
Cool. :-)
author | stefen |
---|---|
permlink | re-tstieff-re-stefen-re-tstieff-programming-your-first-cryptobot-20170715t001011467z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-15 00:10:18 |
last_update | 2017-07-15 00:10:18 |
depth | 3 |
children | 0 |
last_payout | 2017-07-22 00:10:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 9 |
author_reputation | 6,803,833,244,756 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,514,570 |
net_rshares | 0 |
Still working on this? There seem to be now a `V2.0` of the Bittrex API, have you tried it?
author | theshortpencil |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20180222t160652255z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2018-02-22 16:06:51 |
last_update | 2018-02-22 16:07:06 |
depth | 1 |
children | 0 |
last_payout | 2018-03-01 16:06:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 91 |
author_reputation | 28,802,403 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 39,642,252 |
net_rshares | 0 |
Really informative, thank you. I've made my own price bot for steem, it displays the price changed from last, and percent changed. I have it updating every 5 seconds using the CryptoCompare API.
author | vidallia |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20170721t004418047z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-21 00:44:21 |
last_update | 2017-07-21 00:44:21 |
depth | 1 |
children | 1 |
last_payout | 2017-07-28 00:44:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.096 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 194 |
author_reputation | 252,226,177,161 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 9,137,022 |
net_rshares | 24,119,784,079 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
vidallia | 0 | 22,959,110,746 | 100% | ||
tstieff | 0 | 1,160,673,333 | 100% |
Did you do this using the same script?
author | freefromchainz2 |
---|---|
permlink | re-vidallia-re-tstieff-programming-your-first-cryptobot-20170806t032506895z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-08-06 03:25:09 |
last_update | 2017-08-06 03:25:09 |
depth | 2 |
children | 0 |
last_payout | 2017-08-13 03:25:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 38 |
author_reputation | 3,011,488,720 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 10,906,237 |
net_rshares | 0 |
Cool information.
author | xaero1 |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20170714t235926514z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-14 23:59:27 |
last_update | 2017-07-14 23:59:27 |
depth | 1 |
children | 1 |
last_payout | 2017-07-21 23:59:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 17 |
author_reputation | 4,115,208,294,103 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,513,881 |
net_rshares | 1,131,656,499 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
tstieff | 0 | 1,131,656,499 | 100% |
Hope you found it useful!
author | tstieff |
---|---|
permlink | re-xaero1-re-tstieff-programming-your-first-cryptobot-20170715t000054209z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-15 00:00:54 |
last_update | 2017-07-15 00:00:54 |
depth | 2 |
children | 0 |
last_payout | 2017-07-22 00:00:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 25 |
author_reputation | 474,755,008,115 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 8,513,970 |
net_rshares | 0 |
I keep getting an error saying ModuleNotFoundError: No module named 'requests' Any idea what I'm doing wrong?
author | youngmetro |
---|---|
permlink | re-tstieff-programming-your-first-cryptobot-20170922t200139413z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-09-22 20:01:36 |
last_update | 2017-09-22 20:01:36 |
depth | 1 |
children | 1 |
last_payout | 2017-09-29 20:01:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 111 |
author_reputation | 0 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 15,648,679 |
net_rshares | 0 |
Can you see here : https://stackoverflow.com/questions/17309288/importerror-no-module-named-requests
author | dexterdev |
---|---|
permlink | re-youngmetro-re-tstieff-programming-your-first-cryptobot-20180104t182537254z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"links":["https://stackoverflow.com/questions/17309288/importerror-no-module-named-requests"],"app":"steemit/0.1"} |
created | 2018-01-04 18:27:00 |
last_update | 2018-01-04 18:27:00 |
depth | 2 |
children | 0 |
last_payout | 2018-01-11 18:27:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 100 |
author_reputation | 17,771,704,061,240 |
root_title | "Programming your first Cryptobot" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 27,092,009 |
net_rshares | 0 |