1. Go to this page and download the library: Download cryptohopper/sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cryptohopper / sdk example snippets
use Cryptohopper\Sdk\Client;
use Cryptohopper\Sdk\Exceptions\CryptohopperException;
$client = new Client(apiKey: getenv('CRYPTOHOPPER_TOKEN'));
try {
$me = $client->user->get();
$hoppers = $client->hoppers->list();
$ticker = $client->exchange->ticker(exchange: 'binance', market: 'BTC/USDT');
} catch (CryptohopperException $e) {
fwrite(STDERR, "{$e->getCode()} / {$e->getStatus()}: {$e->getMessage()}\n");
if ($e->getCode() === 'RATE_LIMITED' && $e->getRetryAfterMs() !== null) {
fwrite(STDERR, "Retry after {$e->getRetryAfterMs()}ms\n");
}
}
$client = new Client(
apiKey: 'your-40-char-oauth-token',
appKey: 'your-oauth-client-id', // optional, sent as x-api-app-key
);