NANOPOOL API to Python requests

python python-2.7 api python-requests

340 观看

1回复

16 作者的声誉

For a little project on Arduino, i'm trying to read information of my miners on NANOPOOL with PYTHON.

But, there is a problem, and i don't find the solution.

This is my code:

import requests
address='t1UtZktQLxzxyonziphEsrXzD6xdLheevQH'
content=requests.get('https://api.nanopool.org/v1/zec/avghashrate/:address', params=address)
data=content.json()
t=data['data']['h1']
print(t)

API nanopool : https://zec.nanopool.org/api#api-Miner-AverageHashrates

I should receive "624.16" with this example : { "status": true, "data": { "h1": 624.16, "h3": 679.30, "h6": 719.41, "h12": 691.21, "h24": 636.37 } }

But i receive "0"

I think it is a problem with address, but i don't find a solution ! Someone can help me ?

作者: Thomas Lamy 的来源 发布者: 2017 年 12 月 27 日

回应 1


1

16 作者的声誉

I find the solve ! i must insert the adresse in the url like that : https://api.nanopool.org/v1/zec/avghashrate/t1UtZktQLxzxyonziphEsrXzD6xdLheevQH

作者: Thomas Lamy 发布者: 2017 年 12 月 27 日
32x32