PHP code example of loonpwn / blockfolio-php

1. Go to this page and download the library: Download loonpwn/blockfolio-php 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/ */

    

loonpwn / blockfolio-php example snippets



// Require the Composer autoloader.
ockfolio api instance
$api = new API([
    'BLOCKFOLIO_MAGIC' => '<magic',  // if not declared as an environment variabl
    'BLOCKFOLIO_API_KEY' => '<key>', // if not declared as an environment variable
    'fiat_currency' => 'USD', // optional
    'locale' => 'en-US', // optional
    'use_alias' => true, // optional
]);


$response = $api->get_all_positions();
// display all positions
var_dump($response->positionList);