PHP code example of barchart / ondemand-client

1. Go to this page and download the library: Download barchart/ondemand-client 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/ */

    

barchart / ondemand-client example snippets




use Barchart\OnDemand\Client;

$ondemand = new Client('YOUR API KEY');
$results = $ondemand->getQuote(['symbols' => 'AAPL,AMZN']);

// Generic request
$results = $ondemand->makeRequest('getQuote', ['symbols' => 'AAPL,AMZN']);