[Python]Average price of Steem for the last 30 Days.steemCreated with Sketch.

in steem •  7 years ago  (edited)

A python script to take all of the daily "close" prices of steem for the last 30 days.

This little script was fun to hack together, i learned some new concepts dealing with APIs, the requests library, and working with some JSON files.  I'm pretty new to Python so don't be too harsh on me, but I would like some feedback!

Would you let me know in the comments , what kind of  information about steem you would find useful to have?

I'm thinking about comparing the data, displayed in a percentage for the price and average volume changed from 30 days back and 60 days back but, i'm not sure. I want YOUR opinion!

$1.82 is the average price

Now to the source code:

import requests; import time
import json
r = requests.get('https://min-api.cryptocompare.com/data/histoday?fsym=STEEM&tsym=USD&limit=30&aggregate=0&e=CCCAGG')
data1 = json.loads(r.text)
coin_price = []

for coin in data1.get('Data'):
	price = coin.get("close")
	coin_price.append(float(price))
	
total = sum(coin_price) / 30
	
print("Steem's average price over last 30 days: ${}".format(round(total,2)))
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Cool post, vidallia, thanks.

What you could look at is how the steem and bitcoin price are correlated.
And do you know which function fits the curve well?
And I'd like to know how the different users rep relate to their steem/steem power/steem dollars in their accounts.

I'm playing around with steempy myself (here and here, for example).


Thanks again for your work!
@qed