简体   繁体   English

NANOPOOL API 到 Python 请求

[英]NANOPOOL API to Python requests

For a little project on Arduino, i'm trying to read information of my miners on NANOPOOL with PYTHON.对于 Arduino 上的一个小项目,我正在尝试使用 PYTHON 在 NANOPOOL 上读取我的矿工的信息。

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 API 纳米池: 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 } }我应该在这个例子中收到“624.16”:{“status”:true,“data”:{“h1”:624.16,“h3”:679.30,“h6”:719.41,“h12”:691.21,“h24”: 636.37 } }

But i receive "0"但我收到“0”

I think it is a problem with address, but i don't find a solution !我认为这是地址问题,但我没有找到解决方案! Someone can help me ?有人可以帮助我吗?

I find the solve !我找到了解决办法! i must insert the adresse in the url like that : https://api.nanopool.org/v1/zec/avghashrate/t1UtZktQLxzxyonziphEsrXzD6xdLheevQH我必须像这样在 url 中插入地址: https : //api.nanopool.org/v1/zec/avghashrate/t1UtZktQLxzxyonziphEsrXzD6xdLheevQH

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM