Steem price with Python
codesharedot
Posted on September 21, 2019
Steem is a blockchain-based rewards platform for publishers to monetize content and grow community.
The website steemit rewards its users in steem coin for writing content. This feature isn't available in dev.to yet, but perhaps in the future you'll earn crypto currency with posting.
Price changes
Like any currency or asset, the value fluctuates over time. Is it increasing or decreasing? let's find out with Python
The data is available on coinmarketcap,
#!/usr/bin/python3
r = requests.get("https://coinmarketcap.com/currencies/steem/historical-data/?start=20140101&end={0}".format(enddate))
data = r.text
This link points to an HTML table, not an API call. That's why we need beautifulsoup to parse the data.
#!/usr/bin/python3
soup = BeautifulSoup(data, "html.parser")
table = soup.find('table', attrs={ "class" : "table"})
You can iterate over the table like this:
#!/usr/bin/python3
for row in table.find_all('tr'):
tag = row.findAll('td')
for val in tag:
value = val.text
I add the data to an array and plot it with Python, see source code
This shows it's better to trade steem coin immediately for something else, as its price is decreasing.
Related links:
Posted on September 21, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.