词汇

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