f2pool API supports HTTPS requests to access the mining pool service, which includes support for subaccount management, wallet management, payment information, hashrate, workers and other query functions.
You can activate the API service and get the API token through the website, or contact f2pool customer service agents.
F2P-API-secret
Fill the header with API token on the right field to pass verification.
Note that we only accept POST requests with application/json
For example
curl --request POST {url}
--header 'Content-Type: application/json'
--header 'F2P-API-SECRET: {token}'
--data-raw '{
"currency": "bitcoin",
"user_name": "xxx",
...
}'
{url} is https://api.f2pool.com/v2/{request_name}
You will get the following uniform formatted data if there is a error
{
"code": {ERR_CODE},
"msg": "error_type: description"
}
The available values of the 'currency' field in the API:
bitcoin,bitcoin-cash,conflux,dash,decred,digibyte-qubit,digibyte-scrypt,digibyte-sha256d,digibyte-skein,dogecoin,elacoin,ethereum,ethereum-classic,handshake,hathor,kadena,litecoin,nervos,nmccoin,qitmeer-meer,raven,siacoin-new,verge-blake2s,verge-groestl,verge-lyra,verge-scrypt,verge-x17,xaya,zcash,zen
The hashrate module currently supports only:
bitcoin,bitcoin-cash,litecoin
The hashrate distribution module currently supports only:
Public Messages:
Read-only page data
Name
Type
Mark
description
key
string
/mining-user-{currency}/{key}
is the URI of the read-only page
permissions
string
Different permissions should be separated by comma \* 1 means it has permission to view the mining hashrate and worker list \* 2 means it has permission to view the revenue data, including the payment information \* 3 means it has permission to view the revenue data without payment information
page_name
string
Description of the read-only page
Wallet data
Name
Type
Mark
description
currency
string
Currency type
address
string
Wallet address
threshold
string
Payout threshold
ExtraEntry
Name
Type
Mark
description
key
string
value
string
Account data
Name
Type
Mark
description
mining_user_name
string
Account name
pages
ReadOnlyPage
repeated
Read-only page data
wallets
Wallet
repeated
Wallet address information of all currencies
description
string
Description of the account
Name
Type
Mark
description
mining_user_name
string
Account name
wallets
Wallet
repeated
Wallet address configuration list
Name
Type
Mark
description
key
string
value
string
Name
Type
Mark
description
currency
string
Currency type
address
string
Wallet address
result
string
true/false
msg
string
Error message
Name
Type
Mark
description
mining_user_name
string
Account name
wallet_result
WalletResp
repeated
Fetch account information
Name
Type
Mark
description
mining_user_name
string
Account name
Name
Type
Mark
description
mining_user_name
string
Account name
pages
ReadOnlyPage
repeated
Read-only page data
wallets
Wallet
repeated
Wallet address information of all currencies
description
string
Description of the account
Name
Type
Mark
description
mining_user_name
string
Add new mining account, account name should contain 2-15 lower case letters or numbers, beginning with a letter.
Name
Type
Mark
description
mining_user_name
string
Account name
pages
ReadOnlyPage
repeated
Read-only page data
wallets
Wallet
repeated
Wallet address information of all currencies
description
string
Description of the account
POST /v2/mining_user/list
Name
Type
Mark
description
mining_user_list
MiningUserInfo
repeated
Get the list of all mining accounts
POST /v2/mining_user/wallet/update
POST /v2/mining_user/read_only_page/add
Name
Type
Mark
description
mining_user_name
string
Account name
page_name
string
Description of the read-only page
permissions
string
Permission settings, the same as ReadOnlyPage
Name
Type
Mark
description
mining_user_name
string
Account name
page
ReadOnlyPage
Read-only page
POST /v2/mining_user/read_only_page/delete
Name
Type
Mark
description
mining_user_name
string
Account name
key
string
The key in ReadOnlyPage
Name
Type
Mark
description
mining_user_name
string
Account name
POST /v2/mining_user/balance/withdraw
Name
Type
Mark
description
mining_user_name
string
Account name
currency
string
Currency type
Name
Type
Mark
description
paid_time
int64
Payment timestamp
POST /v2/mining_user/payment/pause
Name
Type
Mark
description
currency
string
Currency type
mining_user_names
string
repeated
Account list
Name
Type
Mark
description
results
ResultsEntry
repeated
result
POST /v2/mining_user/payment/resume
Name
Type
Mark
description
currency
string
Currency type
mining_user_names
string
repeated
Account list
Name
Type
Mark
description
results
ResultsEntry
repeated
result
POST /v2/mining_user/threshold/update
Name
Type
Mark
description
mining_user_name
string
Account name
currency
string
Currency type
threshold
string
Please use values as defined by the website
Name
Type
Mark
description
threshold
string
Payout threshold
Public Messages:
Mining revenue
Name
Type
Mark
description
balance
double
Balance (before 00:00 UTC)
paid
double
Total payment
total_income
double
Total mining revenues
yesterday_income
double
Yesterday’s revenues
estimated_today_income
double
The estimated mining revenue from 00:00 UTC to now
MiningExtra
Name
Type
Mark
description
mining_date
int64
Date of mining
settle_date
int64
Date of settlement
pps
double
PPS revenues
pps_fee_rate
float
The pool fee of the PPS part
tx_fee
double
Reward from transaction fees
tx_fee_rate
float
The pool fee of the reward from transaction fees
hash_rate
double
The average hashrate on the day of mining
PayoutExtra
Name
Type
Mark
description
value
double
Payout amount
address
string
The wallet address or account name that receive the coins
tx_id
string
On-chain transaction ID
paid_time
int64
Payout timestamp
wallet_type
string
The type of the wallet address (mainnet wallet address or third part wallet address)
tip
double
Transaction fee
Name
Type
Mark
description
id
int64
type
string
changed_balance
double
If the changed_balance is greater than 0, it is the income, less than 0, it is the outcome
created_at
int64
The payout timestamp
mining_extra
MiningExtra
Income details
payout_extra
PayoutExtra
Outcome details
Fetch current user's asset details
Name
Type
Mark
description
currency
string
mining_user_name
string
Account name (Only one of mining_user_name
and address
should be used)
address
string
Wallet address
POST /v2/assets/transactions/list
Name
Type
Mark
description
currency
string
Required
mining_user_name
string
Account name (Only one of mining_user_name
and address
should be used)
address
string
Wallet address
type
string
Multiple types are separated by ,
- all
- revenue
Mining revenue - reward
Activity rewards or consumptions - dividend
Income divided by other mining accounts - flash_exchange
Exchange value - payout
Outcome There are more detailed account types in the return value, please refer to the actual situation
start_time
int64
Start timestamp
end_time
int64
End timestamp, must be later than start timestamp
POST /v2/assets/settle_mode/switch
Name
Type
Mark
description
currency
string
Currency Type
mode
string
settle mode
mining_user_name
string
user
activated_at
int64
active time
Name
Type
Mark
description
mode
string
activated_at
int64
active time
Public Messages:
Name
Type
Mark
description
name
string
Account name or worker name
hash_rate
double
Current hashrate
h1_hash_rate
double
The average hashrate of last 1 hour
h24_hash_rate
double
The average hashrate of last 24 hours
h1_stale_hash_rate
double
The average rejected hashrate of last 1 hour
h24_stale_hash_rate
double
The average rejected hashrate of last 24 hours
h24_delay_hash_rate
double
The average delayed hashrate of last 24 hours
local_hash_rate
double
The current local hashrate or reported hashrate
h24_local_hash_rate
double
The average local hashrate or reported hashrate of last 24 hours
Name
Type
Mark
description
timestamp
int64
Timestamp
hash_rate
double
Hashrate
stale_hash_rate
double
Hashrate rejected
delay_hash_rate
double
Hashrate delayed
local_hash_rate
double
Local hashrate or reported hashrate
normal_reward
double
Mining revenues
delay_reward
double
Mining revenues of the delayed hashrate
online_miners
uint32
Online miners
Name
Type
Mark
description
mining_user_name
string
Account name (Only one of mining_user_name
and address
should be used)
address
string
Wallet address
currency
string
Currency type
Name
description
0
Online
1
Offline
2
Expired
Name
Type
Mark
description
hash_rate_info
HashRateInfo
Hashrate information
last_share_at
int64
The time of the last submitted share from the worker
status
WorkerStatus
Current status
host
string
The public IP address
Name
Type
Mark
description
mining_user_name
string
Account name (Only one of mining_user_name
and address
should be used)
address
string
Wallet address
currency
string
Currency type
Name
Type
Mark
description
info
HashRateInfo
Hashrate information
currency
string
Currency type
Hashrate information of multiple account
POST /v2/hash_rate/info_list
Name
Type
Mark
description
reqs
UserMiningReq
repeated
Request account name or wallet address list, the maximum amount is 100
Hashrate historical data (time serial data)
POST /v2/hash_rate/history
Name
Type
Mark
description
mining_user_name
string
Account name (Only one of mining_user_name
and address
should be used)
address
string
Wallet address
currency
string
Currency type
interval
int64
The seconds of interval, it should be divisible by 10 minutes
duration
int64
The seconds of duration, it is up to 30 days
POST /v2/hash_rate/worker/list
Name
Type
Mark
description
mining_user_name
string
Account name (Only one of mining_user_name
and address
should be used)
address
string
Wallet address
currency
string
Currency type
Hashrate historical data (time serial data) of worker
POST /v2/hash_rate/worker/history
Name
Type
Mark
description
mining_user_name
string
Account name (Only one of mining_user_name
and address
should be used )
address
string
Wallet address
currency
string
Currency type
worker_name
string
Worker name
interval
int64
The seconds of interval, it should be divisible by 10 minutes
duration
int64
The seconds of duration, it is up to 3 days
Public Messages:
HashRateDistributionOrder
Requires the order of hashrate distribution
Name
Type
Mark
description
id
int64
start_date
int64
Start timestamp
end_date
int64
End timestamp, must be later than start timestamp
distributor
string
The distributor account name
recipient
string
The recipient account name
hash_rate
double
Hashrate
terminate_at
int64
Return value if the order was ended early, otherwise 0
HashRateDistributionSettlement
Name
Type
Mark
description
id
int64
order
HashRateDistributionOrder
Order
hashes
double
Note that this is the number of hashes, not the hashrate
income
double
Revenue
timestamp
int64
Settlement timestamp of the hashrate distribution
Hashrate distribution information
POST /v2/hash_rate/distribution/info
Name
Type
Mark
description
currency
string
Currency type
distributor
string
The distributor account name
recipient
string
The recipient account name
start_date
int64
Start timestamp
end_date
int64
End timestamp, must be later than start timestamp
hash_rate
double
Hashrate
Name
Type
Mark
description
current_hash_rate
double
The total hashrate
sold_hash_rate
double
The hashrate that has been distributed
remaining_hash_rate
double
The remaining hashrate
List of all orders of hashrate distribution
POST /v2/hash_rate/distribution/orders
Name
Type
Mark
description
currency
string
Currency type
distributor
string
The distributor account name
List of all settlements of hashrate distribution
POST /v2/hash_rate/distribution/settlements
Name
Type
Mark
description
currency
string
Currency type
distributor
string
The distributor account name
Distribute hashrate to an f2pool account
POST /v2/hash_rate/distribute
Name
Type
Mark
description
currency
string
Currency type
distributor
string
The distributor account name
recipient
string
The recipient account name
start_date
int64
Start timestamp
end_date
int64
End timestamp, must be later than start timestamp
hash_rate
double
Hashrate
Terminate hashrate distribution order
POST /v2/hash_rate/distribution/terminate
Name
Type
Mark
description
order_id
int64
Name
Type
Mark
description
reason
string
Public Messages:
Name
Type
Mark
description
id
string
currency
string
Currency type
distributor
string
The distributor account name
recipient
string
The recipient account name
description
string
proportion
double
proportion
Get revenue distribution information
POST /v2/revenue/distribution/info
Name
Type
Mark
description
currency
string
Currency type
distributor
string
The distributor account name
recipient
string
The recipient account name
Distribute revenue to an f2pool account
POST /v2/revenue/distribution/add
Name
Type
Mark
description
currency
string
Currency type
distributor
string
The distributor account name
recipient
string
The recipient account name
description
string
proportion
double
proportion
Name
Type
Mark
description
id
string
currency
string
Currency type
distributor
string
The distributor account name
recipient
string
The recipient account name
description
string
proportion
double
proportion
Terminate revenue distribution record
POST /v2/revenue/distribution/delete
Name
Type
Mark
description
id
int64
distributor
string
The distributor account name
Name
Type
Mark
description
reason
string
Public Messages:
Name
Type
Mark
description
key
string
value
float
Name
Type
Mark
description
height
int64
block_hash
string
base_reward
double
total_reward
double
timestamp
int64
settle_timestamp
int64
Name
Type
Mark
description
page
int32
pagesize
int32
currency
string
Currency Type
Name
Type
Mark
description
lucky
LuckyEntry
repeated
blocklist
Block
repeated
sum
int32
POST /v2/blocks/date_range
Name
Type
Mark
description
start_time
int64
end_time
int64
currency
string
Currency Type
Name
Type
Mark
description
lucky
LuckyEntry
repeated
blocklist
Block
repeated
sum
int32