Our API is designed to be compatible with faucets coming from Faucethub.io.
It's fully coped methods from this docs https://faucethub.io/api
To start working on a new api, you will need to change the api keys and change the api url from https://faucethub.io/api/v1/
to https://bitcointrain.club/api/FaucetHubPolyfill/
Below you can see a copy of the documentation from faucethub.io.
One point. There are no limits on calls to api at this moment.
Using our API is easy, as every request you make is a HTTP POST
request with a set of parameters
such as your API key and currency and returned in JSON format.
If the request was successful, the JSON object will contain a status
attribute equal to
200
along with an optional message
attribute. If the request failed you will get a
separate code and message
attribute explaining the problem/error in further detail.
In the parameters list for each method there are REQUIRED parameters and OPTIONAL ones
NOTE A full list of status codes and errors with further explanation and suggestions is available at the bottom of this page in the Troubleshooting section.
Use this method to get your account balance in any supported currency.
https://bitcointrain.club/api/FaucetHubPolyfill/balance
https://bitcointrain.club/api/FaucetHubPolyfill/getbalance
currency
The valid currency you made the request forbalance
Your non-decimal balance, which is your coin balance multiplied by 10^8 (100000000)
balance_bitcoin
Regular balance in coin valuehttps://bitcointrain.club/api/FaucetHubPolyfill/balance?api_key=YOUR_API_KEY_HERE¤cy=DOGEExample Response
{ "status": 200, "message": "OK", "currency": "DOGE", "balance": 1000000000000, "balance_bitcoin": 10000 }
Use this method to get a list of all the currencies we support on our platform and their status.
https://bitcointrain.club/api/FaucetHubPolyfill/currencies
currencies
An array of currency acronyms (e.g. BTC)currencies_names
A full array including the acronym, name and wallet/payout status (enabled
true or false)
https://bitcointrain.club/api/FaucetHubPolyfill/currencies?api_key=YOUR_API_KEY_HEREExample Response
{ "status": 200, "message": "OK", "currencies": [ "BTC", "LTC", "DOGE" ], "currencies_names": [ { "name": "Bitcoin", "acronym": "BTC", "enabled": true }, { "name": "Litecoin", "acronym": "LTC", "enabled": true }, { "name": "Dogecoin", "acronym": "DOGE", "enabled": true } ] }
If your site has manual payouts and you are unable to show the user a message real-time, then you can use this method to check if their currency address belongs to an account.
https://bitcointrain.club/api/FaucetHubPolyfill/checkaddress
This method will return status
as 200
for a valid address, and 456
for
an address that does not belong to an account.
payout_user_hash
A unique hash corresponding to the individual user on FaucetHub. Store this
value and use it to check how much was paid to each user to prevent fraud on your faucet.
https://bitcointrain.club/api/FaucetHubPolyfill/checkaddress?api_key=YOUR_API_KEY_HERE&address=CURRENCY_ADDRESS_HEREExample Response
{ "status": 200, "message": "OK", "payout_user_hash": "SOME_HASH" }
Use this method to send coins to an address, the main method of our API.
https://bitcointrain.club/api/FaucetHubPolyfill/send
true
, 1
,
or
simply leave it blank. Use it to indicate that this payout is a referral earning
currency
The valid currency you made the request forbalance
Your non-decimal balance after the payout, which is your coin balance multiplied by
10^8 (100000000)
balance_bitcoin
Regular balance in coin valuerate_limit_remaining
If you enabled Rate Limiting on this faucet, you will get this value
which
indicates how much can still be paid out with the set rate limits
payout_id
A unique value representing the payout ID of this sending transaction, useful for
keeping track internally
payout_user_hash
A unique hash corresponding to the individual user on FaucetHub. Store this
value and use it to check how much was paid to each user to prevent fraud on your faucet.
https://bitcointrain.club/api/FaucetHubPolyfill/send?api_key=YOUR_API_KEY_HERE¤cy=BTC&amount=500&to=CURRENCY_ADDRESS_HEREExample Response
{ "status": 200, "message": "OK", "rate_limit_remaining": 0.00004514, "currency": "BTC", "balance": 290000, "balance_bitcoin": 0.002900, "payout_id": 1234, "payout_user_hash": "SOME_HASH" }
Use this method to get the last few payouts you did, up to 10.
https://bitcointrain.club/api/FaucetHubPolyfill/payouts
rewards
An array of payout datahttps://bitcointrain.club/api/FaucetHubPolyfill/payouts?api_key=YOUR_API_KEY_HERE&count=2Example Response
{ "status": 200, "message": "OK", "rewards": [ { "to": "USER_HASH_HERE", "amount": 1, "date": "17-11-16 10:38:48 GMT" }, { "to": "USER_HASH_HERE", "amount": 1, "date": "17-11-16 10:38:33 GMT" } ] }
Having a problem with integrating our API? Received an error code and need to know what it means? Check the list below for all errors and what they mean with help and suggestions.
{"status":402,"message":"This site has insufficient funds to send the payout."}
The return message should be self-explanatory. Your balance is not high enough to make the payout which was requested. You will need to top-up your account balance from the Faucet Manager wallet or FREE Top-up section.
{"status":404,"message":"API Error: Invalid API method."}
The API method you sent was not valid. Please check the API Methods section above this one for a list of valid methods and their usage.
{"status":403,"message":"API Error: Invalid API key."}
The API you provided for the request does not match up to any faucet in our system, and is therefore invalid. Please get your API key from your faucet/website in the Faucet List page in Faucet Manager.
{"status":410,"message":"API Error: Provided currency is not valid."}
The currency you provided in the request is not on our list of supported currencies. At this time our
supported
currency acronyms are ["BTC", "ETH", "LTC", "DOGE", "BCH", "ZEC", "DASH"]
{"status":412,"message":"API Error: Coin address invalid."}
You will see this error only when sending a payout, if the provided address does not appear to be a valid one. This is up to your users to use a proper coin address for the currency in question.
{"status":414,"message":"API Error: Parameters missing.","missing_params":["api_key","currency"]}
You are missing one or more required parameters for the method you are using. Check the API Methods section
above to make sure you are sending all the required parameters. We provide an array of missing param keys in
the
missing_params
attribute in the response.
{"status":441,"message":"Too many API requests, please try again later."}
If you send too many API requests in a given time frame your account will be blocked from making further requests for a short time.
The following limits are in place for all users:
If you are exceeding these limits more often, then you can upgrade your limits on the API Upgrades page on the Faucet Manager.
{"status":450,"message":"The send limit set by the site owner has been reached, please try again later."}
You will get this message if you are trying to send a payout which will exceed the Rate Limits set in your faucet/website's settings. If you did not enable the Rate Limit, you should not get this message at any point.
{"status":452,"message":"API access disabled by site owner."}
If you set the API status for your faucet to disabled (status from ON to OFF) you will get this message for every request which is made. Switch it back on to resolve the error.
{"status":411,"message":"API Error: Unsupported request method."}
If you try to send anything other than a HTTP POST
request you will get this error.
{"status":401,"message":"API Error: Access denied."}
If you have enabled the Access Control List on your account, all unauthorised IP addresses will receive this error when they attempt to make a request. If you get this error unexpectedly, double check the IP address of your server is correctly authorised in your ACL.
{"status":456,"message":"Coin address, email or username does not belong to an account on FaucetHub.io, please make an account and link your address and try again."}
If a user attempts to claim or get a payout at an address which is not tied to a user, they will get this message. It's important to show users this message so they know how to proceed next and that they need to make an account here on FaucetHub.io and link their currency address before they can claim on your faucet/website.
{"status":501,"message":"Maintenance mode, please try again later."}
This errors means that our system is currently in maintenance mode. While in maintenance mode you will not be able to make any API requests.
{"status":999,"message":"Application error, please try again later."}
This message means that something on our end caused the request to fail. If you keep getting this error, please contact support for further assistance.
{"status":187,"message":"Your FaucetHub account has been blocked from receiving payouts."}
The account which you are sending to is not allowed to recieve payouts. When this happens this error will be returned.