提交请求信息后,F2Pool API 服务器将通过 JSON 格式的响应返回,返回数据中携带的字段如下:
字段 | 描述 |
---|---|
balance |
余额 |
paid |
已支付 |
payout_history |
支付记录 |
value |
总收益 |
value_last_day |
过去24小时收益 |
stale_hashes_rejected_last_day |
过去24小时过期总算力 |
hashes_last_day |
过去24小时总算力 |
hashrate |
实时算力 |
hashrate_history |
历史算力(过去24小时) |
worker_length |
矿机总数 |
worker_length_online |
在线矿机数 |
列表字段 | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
workers |
矿机数据 (列表) | ||||||||||||||||||||||||
|
|||||||||||||||||||||||||
value_workers |
历史收益 (字典) | ||||||||||||||||||||||||
|
所有的 API 访问都是通过 HTTP 访问的http://api.f2pool.com,所有返回正确数据都以 JSON 的形式接收,如下:
curl https://api.f2pool.com/bitcoin/user
{
"balance": 0.000045036645168645,
"hashes_last_day": 0,
"value": 0.000045036645168645,
"stale_hashes_rejected_last_day": 0,
"workers": [["minerx01", 12650560751040, 0, 0, 1084452716521979904, 2533274790395904, "2018-06-19T10:02:19.810789Z", false]],
"value_workers": {"08ddb9f4552c": 4.211575399188521691, "018": 4.211575399188521691},
"value_last_day": 0,
"hashrate_history": {
"2017-12-21T11:40:00Z": 0
},
"stale_hashes_rejected_last_hour": 0,
"paid": 0,
"hashes_last_hour": 0,
"worker_length_online": 0,
"payout_history": [["2017-11-01T00:00:00Z", "8f8fba3134ce15e9b0001e67cba93c4a2250445310b5cdada1ac676b5a19b8b9", 1.010047060000000000000000]],
"worker_length": 0,
"hashrate": 0
}
请求不同的币种的用户数据需要通过不同的 URL 访问服务器,目前可以获取以下币种的数据:
BTC - 比特币
https://api.f2pool.com/bitcoin/user
BCH - Bitcoin Cash
https://api.f2pool.com/bitcoin-cash/user
LTC - 莱特币
https://api.f2pool.com/litecoin/user
ETC - 以太坊经典
https://api.f2pool.com/ethereum-classic/user
ETHW - ethw
https://api.f2pool.com/ethereumpow/user
ZEC - 零币
https://api.f2pool.com/zec/user
ZEN - Horizen
https://api.f2pool.com/zen/user
DASH - 达世币
https://api.f2pool.com/dash/user
HNS - Handshake
https://api.f2pool.com/handshake/user
KDA - Kadena
https://api.f2pool.com/kadena/user
CKB - Nervos CKB
https://api.f2pool.com/nervos/user
RVN - 渡鸦币( 用户名 )
https://api.f2pool.com/raven/user
CFX - Conflux
https://api.f2pool.com/conflux/user
ALEO TESTNET3 - Aleo Testnet3
https://api.f2pool.com/aleo-test3/user
ALEO STAGING - Aleo staging
https://api.f2pool.com/aleo-staging/user
ALEO - Aleo
https://api.f2pool.com/aleo/user
ETC+ZIL - etc+zil
https://api.f2pool.com/etc-zil/user
KAS - Kaspa
https://api.f2pool.com/kaspa/user
IRON - Iron Fish
https://api.f2pool.com/ironfish/user
SPACE - MicroVisionChain
https://api.f2pool.com/microvisionchain/user
NEXA - Nexa
https://api.f2pool.com/nexa/user
ALPH - Alph
https://api.f2pool.com/alephium/user
FB - Fractal Bitcoin
https://api.f2pool.com/fractal-bitcoin/user
SC - 云储币
https://api.f2pool.com/siacoin-new/address
RVN - 渡鸦币( 地址 )
https://api.f2pool.com/ravenp/address
ZIL - zil
https://api.f2pool.com/zilliqa-etc-zil/address
ETC - etc
https://api.f2pool.com/zilliqa-etc/address
如果向 F2Pool API 服务器请求了除以上币种外的其他币种,或者参数 user/address 不合法,则会收到错误的响应消息:404: Not Found
。注意: 如果向 F2Pool API 服务器频繁地恶意重复请求将会被列入黑名单,或者会收到错误的响应消息:503: GateWay Timeout
。
单个用户 请求 URL:
https://api.f2pool.com/{currency}/{user}
响应:
{
"balance": 0.000045036645168645,
"hashes_last_day": 0,
...
}
F2Pool API 允许一次请求单个用户
的详细数据,也允许一次请求多个用户
的详细数据,请求多用户数据 URL 如下:
多个用户 请求 URL:
https://api.f2pool.com/{currency}/{user1}?multi_account={user1}&multi_account={user2}
响应:
{
user1:{
"balance": 0.000045036645168645,
"hashes_last_day": 0,
...
},
user2:{
"balance": 0.000045036645168645,
"hashes_last_day": 0,
...
}
}
注意:在使用一次查询多用户数据时,URL 中参数:{currency} 位置的后面需要填充一个合法的currency帐户(若是匿名币种,需要是合法的币种地址), 否则系统将返回:404: Not Found
。
矿机历史算力数据 请求 URL
https://api.f2pool.com/{currency}/{user}/{worker_name}
响应:
{
"hashrate_history": {
"2017-12-21T18:50:00Z": 22906492245,
"2017-12-21T19:00:00Z": 16950804262,
"2017-12-21T19:10:00Z": 20157713176,
...
}
}