API Documentation

    Introduction


    Libraries

    You can use one of our libraries:

    • PHP Library - simple library, best choice if you already have a working faucet
    • Faucet Script - ready to use faucet script, best choice if you don't have a faucet yet

    API methods and usage


    All APIv1 requests are HTTP POST requests. 1 satoshi = 10^-8 BTC. All responses are JSON with status attribute. status 200 means no error.

    Sending payment

    https://codegrap.com/api/v1/

    Parameters

    • api_key - our API key from Dashboard
    • method - method for sending payment to user are "sendBalance" without quot.
    • address - address to send coins to. It MUST be a valid bitcoin address, emails/usernames aren't supported.
    • amount - amount in satoshi to transfer.

    Response fields

    • balance - Your balance in satoshi.

    Example request

    api_key=4VdBEIAQKPpZ4SWOhQLUMn7mMNVql&method=sendBalance&amount=1&address=DSfPc8GkRGF3Xrp99gHQFFJ7hcFJCqkwYH

    Example response

    {
        "status":200,
        "balance":77519999889
    }

    Checking balance

    https://codegrap.com/api/v1/

    Parameters

    • api_key - our API key from Dashboard
    • method - method for checking balance are "getBalance" without quot.

    Response fields

    • balance - Your balance in satoshi.

    Example request

    api_key=4VdBEIAQKPpZ4SWOhQLUMn7mMNVql&method=getBalance

    Example response

    {
        "status":200,
        "balance":77519999889
    }

    Errors and troubleshooting


    Insufficient funds

    {"status": 402, "message": "Insufficient funds."}

    You don't have enough funds to make payment. Please login to Dashboard to get your deposit address and then send some coins to your own deposit address. Please remember about minimal deposit limits.

    Invalid API key

    {"status": 403, "message": "Invalid API key."}

    Provided API key is invalid. You can find your API keys in "Faucets" tab in Dashboard.

    Invalid API method

    {"status": 404, "message": "Invalid API method."}

    You requested not existing method, you probably misspelled it. Please read our API Documentation.

    Unsupported method

    {"status": 411, "message": "Unsupported method."}

    You send API request using unsupported HTTP method. Please make sure you're sending API requests using HTTP POST method.

    Invalid 'address'

    {"status": 412, "message": "Invalid 'to' address."}

    Our API has validated the provided 'address' and it was invalid.

    Missing parameters

    {"status": 414, "message": "Missing parameters."}

    Your request does not include all required parameters. Read our API Documentation to find out required parameters for specific API method.

    CodeGrap.com is in maintenance mode, try again in five minutes

    {"status": 501, "message": "CodeGrap.com is in maintenance mode, try again in five minutes."}

    You sent API request during planned maintenance. Please wait until the end of maintenance and try again. It is also possible that we're experiencing technical problems.