PHPackages                             dannyben/php-quandl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dannyben/php-quandl

ActiveLibrary[API Development](/categories/api)

dannyben/php-quandl
===================

v0.5.2(10y ago)539.3k↓72.1%13MITPHPPHP &gt;=5.4.0

Since Oct 29Pushed 8y ago12 watchersCompare

[ Source](https://github.com/DannyBen/php-quandl)[ Packagist](https://packagist.org/packages/dannyben/php-quandl)[ RSS](/packages/dannyben-php-quandl/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)DependenciesVersions (10)Used By (0)

PHP Quandl
==========

[](#php-quandl)

[![Latest Stable Version](https://camo.githubusercontent.com/93d215bf366fd7a0c13bc97afb38aa5c0021cd65a121da8428c0b04a9d26390f/68747470733a2f2f706f7365722e707567782e6f72672f64616e6e7962656e2f7068702d7175616e646c2f762f737461626c65)](https://packagist.org/packages/dannyben/php-quandl)[![Build Status](https://camo.githubusercontent.com/24f536098fc6d0f1697a5e1d819493501349cf10cb230d8b7ce6e04392c48486/68747470733a2f2f7472617669732d63692e636f6d2f44616e6e7942656e2f7068702d7175616e646c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/DannyBen/php-quandl)[![Maintainability](https://camo.githubusercontent.com/ce6de61ee11f9e32ce1d048e0cc21518501b917c2cb5714eb9654b5d3e89faab/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33666362636533633535643230663930386338652f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/DannyBen/php-quandl/maintainability)

---

This library provides easy access to the [Quandl API](https://www.quandl.com/help/api) using PHP.

It provides several convenience methods to common Quandl API endpoints, as well as a generic method to access any of Quandl's endpoints directly.

---

Geting Started
--------------

[](#geting-started)

Include the `Quandl.php` class in your code, and run one of the examples.

To install with composer:

```
$ composer require dannyben/php-quandl
```

Examples
--------

[](#examples)

This is a basic call. It will return a PHP object with price data for AAPL:

```
$api_key = "YOUR_KEY_HERE";
$quandl = new Quandl($api_key);
$data = $quandl->getSymbol("WIKI/AAPL");
```

You may pass any parameter that is mentioned in the Quandl documentation:

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

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

```
$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:

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

To access any Quandl API endpoint directly, use the `get` method

```
$quandl = new Quandl($api_key);
$data = $quandl->get("databases/WIKI");
```

More examples can be found in the [examples.php](https://github.com/DannyBen/php-quandl/blob/master/examples.php) file

Caching
-------

[](#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.

See the [example\_cache.php](https://github.com/DannyBen/php-quandl/blob/master/example_cache.php) file.

Reference
---------

[](#reference)

### Constructor

[](#constructor)

The constructor accepts two optional parameters: `$api_key` and `$format`:

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

You may also set these properties later (see below);

### Public Properties

[](#public-properties)

#### `$api_key`

[](#api_key)

```
$quandl->api_key = "YOUR KEY";
```

Set your API key

#### `$format`

[](#format)

```
$quandl->format = 'csv';
```

Set the output format. Can be: `csv`, `xml`, `json`, and `object`(which will return a php object obtained with `json_decode()`).

#### `$force_curl`

[](#force_curl)

```
$quandl->force_curl = true;
```

Force download using curl. By default, we will try to download with `file_get_contents` if available, and fall back to `curl` only as a last resort.

#### `$no_ssl_verify`

[](#no_ssl_verify)

```
$quandl->no_ssl_verify = true;
```

Disables curl SSL verification. Set to true if you get an error saying "SSL certificate problem".

#### `$timeout`

[](#timeout)

```
$quandl->timeout = 60;
```

Set the timeout for the download operations.

#### `$last_url`

[](#last_url)

```
print $quandl->last_url;
```

Holds the last API URL as requested from Quandl, for debugging.

#### `$error`

[](#error)

```
print $quandl->error;
```

In case there was an error getting the data from Quandl, the request response will be `false` and this property will contain the error message.

#### `$was_cached`

[](#was_cached)

```
print $quandl->was_cached;
```

When using a cache handler, this property will be set to `true` if the response came from the cache.

### Methods

[](#methods)

#### `get`

[](#get)

```
mixed get( string $path [, array $params ] )

// Examples
$data = $quandl->get( 'datasets/EOD/QQQ' );
$data = $quandl->get( 'datasets/EOD/QQQ', ['rows' => 5] );
```

Returns an object containing the response from any of Quandl's API endpoints. The format of the result depends on the value of `$quandl->format`.

The optional parameters array is an associative `key => value`array with any of the parameters supported by Quandl.

You do not need to pass `auth_token` in the array, it will be automatically appended.

#### `getSymbol`

[](#getsymbol)

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

// Examples
$data = $quandl->getSymbol( 'WIKI/AAPL' );
$data = $quandl->getSymbol( 'WIKI/AAPL', ['rows' => 5] );
```

Returns an object containing data for a given symbol. The format of the result depends on the value of `$quandl->format`.

The optional parameters array is an associative `key => value`array with any of the parameters supported by Quandl.

You do not need to pass `auth_token` in the array, it will be automatically appended.

#### `getSearch`

[](#getsearch)

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

// Examples
$data = $quandl->getSearch( "gold" );
$data = $quandl->getSearch( "gold", 1, 10 );
```

Returns a search result object. Number of results per page is limited to 300 by default.

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.

#### `getList`

[](#getlist)

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

// Examples
$data = $quandl->getList( 'WIKI' );
$data = $quandl->getList( 'WIKI', 1, 10 );
```

Returns a list of symbols in a given source. Number of results per page is limited to 300 by default.

#### `getMeta`

[](#getmeta)

```
mixed getMeta( string $source )

// Example
$data = $quandl->getMeta( 'WIKI' );
```

Returns metadata about a symbol.

#### `getDatabases`

[](#getdatabases)

```
mixed getDatabases( [int $page, int $per_page] )

// Examples
$data = $quandl->getDatabases();
$data = $quandl->getDatabases( 1, 10 );
```

Returns a list of available databases. Number of results per page is limited to 100 by default.

#### `getBulk`

[](#getbulk)

> This feature is only supported with premium databases.

```
boolean getBulk( string $database, string $path [, boolean $complete] )

// Examples
boolean getBulk( 'EOD', 'eod-partial.zip' );
boolean getBulk( 'EOD', 'eod-full.zip', true );
```

Downloads the entire database and saves it to a ZIP file. If `$complete`is true (false by default), it will download the entire database, otherwise, it will download the last day only.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~85 days

Recently: every ~100 days

Total

8

Last Release

3663d ago

PHP version history (2 changes)v0.3.0PHP ~5.4

v0.4.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/155541?v=4)[Dan Bosan](/maintainers/DannyB)[@dannyb](https://github.com/dannyb)

---

Top Contributors

[![DannyBen](https://avatars.githubusercontent.com/u/2405099?v=4)](https://github.com/DannyBen "DannyBen (84 commits)")[![royopa](https://avatars.githubusercontent.com/u/442991?v=4)](https://github.com/royopa "royopa (3 commits)")[![robinvalk](https://avatars.githubusercontent.com/u/3050565?v=4)](https://github.com/robinvalk "robinvalk (2 commits)")[![morticue](https://avatars.githubusercontent.com/u/165028?v=4)](https://github.com/morticue "morticue (1 commits)")

---

Tags

apiapi-clientphpphp-quandlquandlquandl-api

### Embed Badge

![Health badge](/badges/dannyben-php-quandl/health.svg)

```
[![Health](https://phpackages.com/badges/dannyben-php-quandl/health.svg)](https://phpackages.com/packages/dannyben-php-quandl)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
