A simple class for making calls to Bitcoin's API using PHP. This is an old library, I suggest instead using https://github.com/denpamusic/php-bitcoinrpc
Switch branches/tags
Nothing to show
Clone or download
Latest commit ff67be7 Jun 27, 2017
Failed to load latest commit information.
LICENSE Initial commit Oct 3, 2013
README.md Updated README Dec 16, 2016
easybitcoin.php Minor tweaks for PSR2 Jun 27, 2017



A simple class for making calls to Bitcoin's API using PHP.

Getting Started

  1. Include easybitcoin.php into your PHP script:

  2. Initialize Bitcoin connection/object:

    $bitcoin = new Bitcoin('username','password');

    Optionally, you can specify a host, port. Default is HTTP on localhost port 8332.

    $bitcoin = new Bitcoin('username','password','localhost','8332');

    If you wish to make an SSL connection you can set an optional CA certificate or leave blank

  3. Make calls to bitcoind as methods for your object. Examples:


Additional Info

  • When a call fails for any reason, it will return false and put the error message in $bitcoin->error

  • The HTTP status code can be found in $bitcoin->status and will either be a valid HTTP status code or will be 0 if cURL was unable to connect.

  • The full response (not usually needed) is stored in $bitcoin->response while the raw JSON is stored in $bitcoin->raw_response