詞彙

提交請求訊息后,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 礦機資料 (列表)
位置 0 礦機名稱
位置 1 礦機算力
位置 2 過去1小時算力
位置 3 過去1小時過期拒絕數
位置 4 過去24小時算力
位置 5 過去24小時過期總算力
位置 6 最近提交Share時間
位置 7 擴展字段
value_workers 歷史收益 (字典)
礦機 1 歷史收益
礦機 2 歷史收益

請求示例

所有的 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 訪問伺服器,目前可以獲取以下幣種的資料:

  1. BTC - 比特幣

    https://api.f2pool.com/bitcoin/user
  2. BCH - Bitcoin Cash

    https://api.f2pool.com/bitcoin-cash/user
  3. LTC - 萊特幣

    https://api.f2pool.com/litecoin/user
  4. ETC - 以太坊經典

    https://api.f2pool.com/ethereum-classic/user
  5. ETHW - ethw

    https://api.f2pool.com/ethereumpow/user
  6. ZEC - 零幣

    https://api.f2pool.com/zec/user
  7. ZEN - Horizen

    https://api.f2pool.com/zen/user
  8. DASH - 達世幣

    https://api.f2pool.com/dash/user
  9. HNS - Handshake

    https://api.f2pool.com/handshake/user
  10. KDA - Kadena

    https://api.f2pool.com/kadena/user
  11. CKB - Nervos CKB

    https://api.f2pool.com/nervos/user
  12. RVN - 渡鴉幣( 用戶名 )

    https://api.f2pool.com/raven/user
  13. CFX - Conflux

    https://api.f2pool.com/conflux/user
  14. ALEO - Aleo

    https://api.f2pool.com/aleo-test3/user
  15. ETC+ZIL - etc+zil

    https://api.f2pool.com/etc-zil/user
  16. KAS - Kaspa

    https://api.f2pool.com/kaspa/user
  17. IRON - Iron Fish

    https://api.f2pool.com/ironfish/user
  18. BEL - Bells

    https://api.f2pool.com/bells/user
  19. SPACE - MicroVisionChain

    https://api.f2pool.com/microvisionchain/user
  20. ZEPH - Zephyr

    https://api.f2pool.com/zephyr/user
  21. NEXA - Nexa

    https://api.f2pool.com/nexa/user
  22. SC - 云儲幣

    https://api.f2pool.com/siacoin-new/address
  23. RVN - 渡鴉幣( 位址 )

    https://api.f2pool.com/ravenp/address
  24. ZIL - zil

    https://api.f2pool.com/zilliqa-etc-zil/address
  25. ETC - etc

    https://api.f2pool.com/zilliqa-etc/address
  26. DNX - Dynex

    https://api.f2pool.com/dynex/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

請求礦機過去24小時算力資料

礦機歷史算力資料 請求 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,
        ...
    }
}