2017 © Pedro Peláez
 

library quandl-elephant-api

A API to provide easy access to the Quandl API using PHP

image

royopa/quandl-elephant-api

A API to provide easy access to the Quandl API using PHP

  • Saturday, March 12, 2016
  • by royopa
  • Repository
  • 2 Watchers
  • 0 Stars
  • 77 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Quandl Elephant API

http://royopa.github.io/quandl-elephant-api, (*1)

This project is a fork of php-quandl, a great API to provide easy access to the Quandl API using PHP., (*2)

The name of this project was changed to answer the PHP Licensing., (*3)

Build Status Latest Stable Version Total Downloads Latest Unstable Version License Scrutinizer Code Quality, (*4)

Install

To install with composer:, (*5)

composer require royopa/quandl-elephant-api

Examples

This is a basic call. It will return a PHP object with price data for AAPL:, (*6)

use Royopa\Quandl;

$api_key = "YOUR_KEY_HERE";
$quandl  = new Quandl($api_key);
$data    = $quandl->getSymbol("GOOG/NASDAQ_AAPL");

You may pass any parameter that is mentioned in the Quandl documentation:, (*7)

use Royopa\Quandl;

$quandl = new Quandl($api_key);
$data = $quandl->getSymbol($symbol, [
    "sort_order"      => "desc",
    "exclude_headers" => true,
    "rows"            => 10,
    "column"          => 4, 
]);

The date range options get a special treatment. You may use any date string that PHP's strtotime() understands., (*8)

use Royopa\Quandl;

$quandl = new Quandl($api_key, "csv");
$data = $quandl->getSymbol($symbol, [
    "trim_start" => "today-30 days",
    "trim_end"   => "today",
]);

You can also search the entire Quandl database and get a list of supported symbols in a data source:, (*9)

use Royopa\Quandl;

$quandl = new Quandl($api_key);
$data   = $quandl->getSearch("crude oil");
$data   = $quandl->getList("WIKI", 1, 10);

More examples can be found in the examples.php file, (*10)

Caching

You may provide the quandl object with a cache handler function. This function should be responsible for both reading from your cache and storing to it., (*11)

See the example_cache.php file., (*12)

Reference

Constructor and public properties

The constructor accepts two optional parameters: $api_key and $format:, (*13)

$quandl = new Quandl("YOUR KEY", "csv");

You may also set these properties later:, (*14)

$quandl->api_key = "YOUR KEY";
$quandl->format  = "json";

$format can be one of csv, xml, json, and object (which will return a php object obtained with json_decode())., (*15)

After each call to Quandl, the property $last_url will be set for debugging and other purposes. In case there was an error getting the data from Quandl, the result will be false and the property $error will contain the error message., (*16)

getSymbol

mixed getSymbol( string $symbol [, array $params ] )

Returns an object containing data for a given symbol. The format of the result depends on the value of $quandl->format., (*17)

The optional parameters array is an associative key => value array with any of the parameters supported by Quandl., (*18)

You do not need to pass auth_token in the array, it will be automatically appended., (*19)

getSearch

mixed getSearch( string $query [, int $page, int $per_page] )

Returns a search result object. Number of results per page is limited to 300 by default., (*20)

Note that currently Quandl does not support CSV response for this node so if $quandl->format is "csv", this call will return a JSON string instead., (*21)

getList

mixed getList( string $source [, int $page, int $per_page] )

Returns a list of symbols in a given source. Number of results per page is limited to 300 by default., (*22)

Tests

From the project directory, tests can be ran using:, (*23)

./vendor/bin/phpunit

The Versions

12/03 2016

dev-master

9999999-dev

A API to provide easy access to the Quandl API using PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Danny Ben Shitrit
by Rodrigo Prado de Jesus (royopa)

02/07 2015

dev-scrutinizer-patch-2

dev-scrutinizer-patch-2

A API to provide easy access to the Quandl API using PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Danny Ben Shitrit
by Rodrigo Prado de Jesus (royopa)

18/06 2015

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1

  Sources   Download

MIT

The Requires

  • php ~5.4

 

The Development Requires

18/06 2015

dev-dev

dev-dev

  Sources   Download

MIT

The Requires

  • php ~5.4

 

19/05 2015

v0.3.3

0.3.3.0

  Sources   Download

MIT

The Requires

  • php ~5.4

 

04/05 2015

v0.3.2

0.3.2.0

  Sources   Download

MIT

The Requires

  • php ~5.4

 

13/12 2014

v0.3.1

0.3.1.0

  Sources   Download

MIT

The Requires

  • php ~5.4

 

29/10 2014

v0.3.0

0.3.0.0

  Sources   Download

MIT

The Requires

  • php ~5.4