API

PHP Library script

Here you can find the Paytoshi PHP library to interact with the APIs.

Download PHP Library

Requirements

  • PHP >= 5.3
  • PHP cURL extension (recommended)
  • allow_fopen_url enabled (if not using cURL)

Usage

These APIs are intended for advanced users that plan to directly interact with Paytoshi.

Want to start a new faucet instead? Download our Faucet Script.


Library

Do you use PHP and want to interact with our APIs? Download the PHP Library linked on this page.

It's REALLY simply to use. Example:

<?php
require 'Paytoshi.php';
$paytoshi = new Paytoshi();
// Create a new payout
$result = $paytoshi->faucetSend(
    'a8p9uevhfgx7ewt1kf09v2n3kfhzkeyxi8ywcehfqnl9is30gq', //Faucet Api key
    '1EhNaUFaVW99in6drLeD8ygrLicAcf8rAc', //Bitcoin address
    100, //Amount
    '127.0.0.1' //Recipient ip
);
// Create a referral payout
$result = $paytoshi->faucetSend(
    'a8p9uevhfgx7ewt1kf09v2n3kfhzkeyxi8ywcehfqnl9is30gq',  //Faucet Api key
    '1EhNaUFaVW99in6drLeD8ygrLicAcf8rAc',  //Bitcoin address
    100, //Amount
    '127.0.0.1', //Recipient ip
    true //Referral flag
);

API v1 - Documentation

Create Faucet Payout

To call this APIs you need to obtain a faucet API key. Log in with your account and get one from the faucet section of your dashboard.

Url

https://paytoshi.org/api/v1/faucet/send

Method

POST

Query parameters
  • apikey: your faucet API key (e.g. a8p9uevhfgx7ewt1kf09v2n3kfhzkeyxi8ywcehfqnl9is30gq)
Body parameters
  • amount: payout amount in satoshi (e.g. 200)
  • address: bitcoin address (e.g. 1EhNaUFaVW99in6drLeD8ygrLicAcf8rAc)
  • ip: the IP address of the client requesting the payout (used to detect abuses)
  • referral: mark a payment as direct or referral (values: 0 or 1) [optional]
Response

Payout in JSON format. Example:

{
    "recipient": "1EhNaUFaVW99in6drLeD8ygrLicAcf8rAc",
    "amount": 100
}

Error example:

{
    "error": true,
    "code": "INVALID_ADDRESS",
    "message": "Invalid Bitcoind address"
}