PHP code example of dannyben / php-quandl
1. Go to this page and download the library: Download dannyben/php-quandl 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/ */
dannyben / php-quandl example snippets
$api_key = "YOUR_KEY_HERE";
$quandl = new Quandl($api_key);
$data = $quandl->getSymbol("WIKI/AAPL");
$quandl = new Quandl($api_key);
$data = $quandl->getSymbol($symbol, [
"sort_order" => "desc",
"rows" => 10,
"column_index" => 4,
]);
$quandl = new Quandl($api_key, "csv");
$data = $quandl->getSymbol($symbol, [
"trim_start" => "today-30 days",
"trim_end" => "today",
]);
$quandl = new Quandl($api_key);
$data = $quandl->getSearch("crude oil");
$data = $quandl->getList("WIKI", 1, 10);
$quandl = new Quandl($api_key);
$data = $quandl->get("databases/WIKI");
$quandl = new Quandl("YOUR KEY", "csv");
$quandl->api_key = "YOUR KEY";
$quandl->format = 'csv';
$quandl->force_curl = true;
$quandl->no_ssl_verify = true;
$quandl->timeout = 60;
print $quandl->last_url;
print $quandl->error;
print $quandl->was_cached;
mixed get( string $path [, array $params ] )
// Examples
$data = $quandl->get( 'datasets/EOD/QQQ' );
$data = $quandl->get( 'datasets/EOD/QQQ', ['rows' => 5] );
mixed getSymbol( string $symbol [, array $params ] )
// Examples
$data = $quandl->getSymbol( 'WIKI/AAPL' );
$data = $quandl->getSymbol( 'WIKI/AAPL', ['rows' => 5] );
mixed getSearch( string $query [, int $page, int $per_page] )
// Examples
$data = $quandl->getSearch( "gold" );
$data = $quandl->getSearch( "gold", 1, 10 );
mixed getList( string $source [, int $page, int $per_page] )
// Examples
$data = $quandl->getList( 'WIKI' );
$data = $quandl->getList( 'WIKI', 1, 10 );
mixed getMeta( string $source )
// Example
$data = $quandl->getMeta( 'WIKI' );
mixed getDatabases( [int $page, int $per_page] )
// Examples
$data = $quandl->getDatabases();
$data = $quandl->getDatabases( 1, 10 );
boolean getBulk( string $database, string $path [, boolean $complete] )
// Examples
boolean getBulk( 'EOD', 'eod-partial.zip' );
boolean getBulk( 'EOD', 'eod-full.zip', true );