提交請求訊息后,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,
...
}
}