API Documentation Integrate your faucet/website with our API

On this page you will find all the necessary information and explanations of our API to easily integrate with a new or existing faucet or website.

The following information is intended for Developers

Migration Move an existing faucet/website to our service

Migration Move an existing faucet/website to our service

In order to keep the service running smooth, and for your users to have an enjoyable experience, we ask that you limit the number of API requests sent from your website/application. Below are a few tips and tricks for doing this.

Don't send a request for data you alredy have/was given

The best example of this is getbalance. There's no need to call it excessively, as the balance is returned in the send API result. The best way to use this is to store it in your database each time you made a payout to avoid sending another getbalance request.

The other example of this is checkaddress. If you already checked an address, don't check it again. Store the check result in a database and query that before making the API call.

example fields for your database: address, valid_result, time_checked, user_hash

Don't send requests from public-facing pages

This means, don't use code which calls the API from a page that the user has control of e.g. withdraw, home page, etc. This is the most common cause for using up your API request limit very quickly.

Again getbalance and send come to mind here, as most faucet scripts tend to place a getbalance call on their home page causing a lot of API requests to be sent. This is a bad practise and should be avoided. A better way is to follow the example from the previous section and store the balance in the database after a payout has been made.

Use background processes/cron jobs

The better way to make API calls is via background processes, also known as cron jobs. These tasks can be set up to run once per minute (or any interval you like) and run a command or PHP script. We highly recommend the use of them for the following tasks:

  • Storing the faucet balance in the database with a getbalance call.
  • Bulk processing a withdraw queue of user payouts instead of sending directly from the withdraw page. This is much more secure and prevents spam/race conditions/double pays.

The above tips and tricks will help you to limit the amount of API requests that your script/website/application makes, resulting in a more secure and faster website for your users.

API Methods All methods and usage explained

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.

Check your balance

Use this method to get your account balance in any supported currency.

Request URL(s)
  • https://icoinpay.com/api/v1/balance
  • https://icoinpay.com/api/v1/getbalance
Parameters
  • api_key Your API key from your faucet in the Manager's Faucet List page
  • currency A valid currency acronym, defaults to BTC
Return Values
  • currency The valid currency you made the request for
  • balance Your non-decimal balance, which is your coin balance multiplied by 10^8 (100000000)
  • balance_bitcoin Regular balance in coin value
Request Example
https://icoinpay.com/api/v1/balance?api_key=YOUR_API_KEY_HERE&currency=DOGE
Example Response
{
"status": 200,
"message": "OK",
"currency": "DOGE",
"balance": 1000000000000,
"balance_bitcoin": 10000
}