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.
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.
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
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.
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:
getbalance
call.
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.
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://icoinpay.com/api/v1/balance
https://icoinpay.com/api/v1/getbalance
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
https://icoinpay.com/api/v1/balance?api_key=YOUR_API_KEY_HERE¤cy=DOGEExample Response
{ "status": 200, "message": "OK", "currency": "DOGE", "balance": 1000000000000, "balance_bitcoin": 10000 }