A simple class for making calls to Bitcoin's API using PHP.
Latest commit 9972667 Dec 16, 2016 @aceat64 Updated README
Failed to load latest commit information.
LICENSE Initial commit Oct 3, 2013
README.md Updated README Dec 16, 2016
easybitcoin.php Merge pull request #9 from shaman/master Jul 21, 2016



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