Using the API provided by the BTC pool to obtain the running status and user account information in real time.
API Call the path as follows:
https://${Endpoint}/${Version}/${Path}
-
Endpoint:
- BTC
- China
cn-pool.api.btc.com - Shenzhen, China
sz-pool.api.btc.com - America
us-pool.api.btc.com - Europe
eu-pool.api.btc.com
- China
- BCH
- China
cn-bccpool.api.btc.com - Shenzhen, China
sz-bccpool.api.btc.com - America
us-bccpool.api.btc.com
- China
- SBTC
- China
cn-sbtcpool.api.btc.com
- China
- UBTC
- China
cn-ubtcpool.api.btc.com
- China
- BTC
-
Version:
v1 -
Path: For specific API paths, see the definitions below
-
Calling the user-related interface requires the
access_keyandpuidauthentication in the querystring.- AccessKey is the user credentials, corresponding to an account, please protect your own AccessKey.
- Puid is the pool account id, used to distinguish between multiple subaccounts under an account.
-
AccessKey and puid can go to the pool.btc.com login account and get it on the subaccount management page.
All response types are application / json, as follows:
{
"data": ...,
"err_no": 0,
"err_msg": null
}In the response body, data, err_no and err_msg are fixed fields. The meaning is as follows:
data, Specific API response data.error_no, Error code,0for normal, not0is wrong, specifically viewerror_msgfield.error_msg, Error message for debugging use. If there is no error, this field does not appear.
GET /account/info
| name | type | note |
|---|---|---|
| access_key | str | |
| puid | int |
{
"err_no": 0,
"data": {
"user_id": 88888,
"user_name": "spica",
"address": "3NA8hsjfdgVkmmVS9moHmkZsVCoLxUkvvv ",
"nmc_address": "",
"rebates_address": "",
"region": "America",
"contact": {
"mail": "",
"phone": {
"country": "86",
"number": "133****3333"
}
},
"alert": {
"hashrate_max": "0",
"hashrate_value": "0",
"hashrate_unit": "T",
"hashrate_alert": 0,
"miner_max": "0",
"miner_value": "0",
"miner_alert": 0,
"alert_interval": 6
}
}
}
GET /account/earn-stats
| name | type | note |
|---|---|---|
| access_key | str | |
| puid | int |
{
"err_no": 0,
"data": {
"total_paid": "0",
"pending_payouts": "0",
"last_payment_time": "0",
"earnings_today": "0",
"earnings_yesterday": "0",
"unpaid": "0"
}
}
GET /account/earn-history
| name | type | note |
|---|---|---|
| access_key | str | |
| puid | int | |
| page | int | |
| page_size | int |
{
"err_no": 0,
"data": {
"page": "1",
"page_size": "50",
"page_count": 1,
"total_count": 50,
"list": [
{
"date": 20170213,
"earnings": 0,
"payment_time": "0",
"payment_tx": "",
"address": "",
"paid_amount": 0,
"diff": 422170566884,
"payment_mode": "PPS",
"earnings_rate": 0
},
{
"date": 20170212,
"earnings": 1380002903,
"payment_time": "2017-02-13 01:45:37",
"payment_tx": "466af581cbf52af00dc0273ced28c17e8b7a7c6a92a4ce0ae104af4ff0d557c0",
"address": "3NA8hsjfdgVkmmVS9moHmkZsVCoLxUkvvv",
"paid_amount": 1380002903,
"diff": 422170566884,
"payment_mode": "PPS",
"earnings_rate": 0.044
},
...
]
}
}
GET /realtime/hashrate
| name | type | note |
|---|---|---|
| access_key | str | |
| puid | int |
{
"err_no": 0,
"data": {
"shares_15m": "22.88",
"shares_15m_unit": "P",
"shares_1d": "23.33",
"shares_1d_unit": "P"
}
}
GET /worker/stats
| name | type | note |
|---|---|---|
| access_key | str | |
| puid | int |
{
"err_no": 0,
"data": {
"workers_active": 1999,
"workers_inactive": 1,
"workers_dead": 1,
"shares_1m": "22.55",
"shares_5m": "22.79",
"shares_15m": "22.85",
"workers_total": 2000,
"shares_unit": "P"
}
}