At this page, you'll find technical details and guidelines to integrate our REST API within your application or faucet.
If you are a webmaster or a non-developer, then this page is probably not meant for you. Instead, you can click here and download our free faucet script to launch your own faucet with our API in no time.
Appropriate Usage of API
In order to keep the service running from everyone seamlessly, we request you to NOT to hammer our servers with spammy, unintended API calls. We've written a bit about avoiding these excessive unintended API usage from your account.
For example, when you're calling the send function, we automatically return your balance after sending the transaction, so obviously, it would not make sense to send another request for getbalance method. Please avoid sending requests for the information you already have.
Also, we recommend that you cache the data such as balance, user hash and other information. It would be wise to reload this information every 5 minutes or so using cron jobs or daemons. Do not call our API for every public page.
API Methods
Using our API is very easy and straightforward. All you need is to send a HTTP POST request to our end-points with the required parameters such as api_key and currency and the response is returned in JSON. Each request contains a status and message which tells about the status of your request - 200 for a successful request.
Get balance of the faucet (getbalance, balance):
Request URL(s)
https://faucetpay.io/api/v1/balance
https://faucetpay.io/api/v1/getbalance
Parameters
api_key A valid API Key from the website
currency Defaults to "BTC", can be explicitly set
Return Values
currency The currency you set while making the request
{
"status": 456,
"message": "The address does not belong to any user."
}
Send payment (send):
Request URL
https://faucetpay.io/api/v1/send
Parameters
api_key A valid API Key from the website
to The address which you wanna pay amount to
currency Defaults to "BTC", can be explicitly set
referral Indicate if this is a normal or referral payment. Set to true for a referral payment.
Return Values
rate_limit_remaining You will get this value which indicates how much can still be paid out with the set rate limit. Ignore if you haven't set any rate limit.
currency The currency in which you paid up.
balance The balance remaining after you paid up (in satoshis).
balance_bitcoin The balance remaining after you paid up (in coin value).
payout_id A unique identifier for this transaction.
payout_user_hash Contains the hash of user to whom the address belongs. Use it to identify the user.