cryptsyapi-php API library
PHP wrapper for Cryptsy.com for use with the Cryptsy.com API. Simple abstraction layer on top of existing API interfaces, and automatic JSON decoding on response., (*1)
Pull requests accepted and encouraged. :), (*2)
First, sign up for an account at Cryptsy.com and request an API key under Account > Settings, (*3)
Download and include the crypstyapi.php class:, (*4)
require_once 'path/to/cryptsyapi.php';
Or preferably install via Composer, (*5)
"cryptsyapi-php/cryptsyapi-php": "dev-master"
Instantiate the class and set your API key and API Secret., (*6)
$apiKeys = array('api_key' => 'API_KEY_HERE', 'api_secret' => 'API_SECRET_HERE'); $cryptsy = new CryptsyAPI($apiKeys); $info = $cryptsy->get_info();
More usage examples in example.php, (*7)
The wrapper abstracts most methods listed at https://www.cryptsy.com/pages/api using the same interface names. For example, to get your current open orders:, (*8)
$orders = $cryptsy->get_all_my_orders(); echo $orders;
To make requests that require parameters (eg. creating a buy or sell order or grabbing orders by market), pass through each parameter in an associative array. For example, the request below will create a buy order using the necessary parameters:, (*9)
$create_order = $crypsty->create_order( array('marketid' => 5, 'ordertype' => 'Buy', 'quantity' => 500, 'price' => 0.0000123) );
Note: Error checking has not been fully implemented, please enforce your own checks on top of the wrapper., (*10)