{"id":15406789,"url":"https://github.com/dannyben/php-quandl","last_synced_at":"2025-04-14T19:11:42.860Z","repository":{"id":56962118,"uuid":"24800902","full_name":"DannyBen/php-quandl","owner":"DannyBen","description":"Easy access to the Quandl Data API using PHP","archived":false,"fork":false,"pushed_at":"2018-06-12T15:37:48.000Z","size":90,"stargazers_count":54,"open_issues_count":0,"forks_count":13,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-28T07:34:15.602Z","etag":null,"topics":["api","api-client","php","php-quandl","quandl","quandl-api"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DannyBen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-04T20:35:15.000Z","updated_at":"2022-12-13T16:14:23.000Z","dependencies_parsed_at":"2022-08-21T09:20:55.165Z","dependency_job_id":null,"html_url":"https://github.com/DannyBen/php-quandl","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fphp-quandl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fphp-quandl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fphp-quandl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fphp-quandl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DannyBen","download_url":"https://codeload.github.com/DannyBen/php-quandl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248943458,"owners_count":21186958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","php","php-quandl","quandl","quandl-api"],"created_at":"2024-10-01T16:25:23.960Z","updated_at":"2025-04-14T19:11:42.840Z","avatar_url":"https://github.com/DannyBen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHP Quandl\n==========\n\n[![Latest Stable Version](https://poser.pugx.org/dannyben/php-quandl/v/stable)](https://packagist.org/packages/dannyben/php-quandl)\n[![Build Status](https://travis-ci.com/DannyBen/php-quandl.svg?branch=master)](https://travis-ci.com/DannyBen/php-quandl)\n[![Maintainability](https://api.codeclimate.com/v1/badges/3fcbce3c55d20f908c8e/maintainability)](https://codeclimate.com/github/DannyBen/php-quandl/maintainability)\n\n---\n\nThis library provides easy access to the [Quandl API][1] using PHP.\n\nIt provides several convenience methods to common Quandl API endpoints, as\nwell as a generic method to access any of Quandl's endpoints directly.\n\n\n---\n\nGeting Started\n--------------\n\nInclude the `Quandl.php` class in your code, and run one of the examples. \n\nTo install with composer:\n\n```sh\n$ composer require dannyben/php-quandl\n```\n\nExamples\n--------\n\nThis is a basic call. It will return a PHP object with price\ndata for AAPL:\n\n```php\n$api_key = \"YOUR_KEY_HERE\";\n$quandl = new Quandl($api_key);\n$data = $quandl-\u003egetSymbol(\"WIKI/AAPL\");\n```\n\nYou may pass any parameter that is mentioned in the Quandl\ndocumentation:\n\n```php\n$quandl = new Quandl($api_key);\n$data = $quandl-\u003egetSymbol($symbol, [\n\t\"sort_order\"      =\u003e \"desc\",\n\t\"rows\"            =\u003e 10,\n\t\"column_index\"    =\u003e 4, \n]);\n```\n\nThe date range options get a special treatment. You may use\nany date string that PHP's `strtotime()` understands.\n\n```php\n$quandl = new Quandl($api_key, \"csv\");\n$data = $quandl-\u003egetSymbol($symbol, [\n\t\"trim_start\" =\u003e \"today-30 days\",\n\t\"trim_end\"   =\u003e \"today\",\n]);\n```\n\nYou can also search the entire Quandl database and get a list of\nsupported symbols in a data source:\n\n```php\n$quandl = new Quandl($api_key);\n$data = $quandl-\u003egetSearch(\"crude oil\");\n$data = $quandl-\u003egetList(\"WIKI\", 1, 10);\n```\n\nTo access any Quandl API endpoint directly, use the `get` method\n\n```php\n$quandl = new Quandl($api_key);\n$data = $quandl-\u003eget(\"databases/WIKI\");\n```\n\nMore examples can be found in the [examples.php](https://github.com/DannyBen/php-quandl/blob/master/examples.php) file \n\nCaching\n-------\n\nYou may provide the `quandl` object with a cache handler function.\nThis function should be responsible for both reading from your cache and storing to it. \n\nSee the [example_cache.php](https://github.com/DannyBen/php-quandl/blob/master/example_cache.php) file.\n\n\nReference\n---------\n\n### Constructor\n\nThe constructor accepts two optional parameters: `$api_key` and `$format`:\n\n```php\n$quandl = new Quandl(\"YOUR KEY\", \"csv\");\n```\n\nYou may also set these properties later (see below);\n\n\n\n\n\n\n### Public Properties\n\n\n#### `$api_key`\n\n```php\n$quandl-\u003eapi_key = \"YOUR KEY\";\n```\nSet your API key\n\n#### `$format`\n\n```php\n$quandl-\u003eformat = 'csv';\n```\n\nSet the output format. Can be: `csv`, `xml`, `json`, and `object` \n(which will return a php object obtained with `json_decode()`).\n\n\n#### `$force_curl`\n\n```php\n$quandl-\u003eforce_curl = true;\n```\n\nForce download using curl. By default, we will try to download with \n`file_get_contents` if available, and fall back to `curl` only as a last \nresort.\n\n\n#### `$no_ssl_verify`\n\n```php\n$quandl-\u003eno_ssl_verify = true;\n```\n\nDisables curl SSL verification. Set to true if you get an error saying \n\"SSL certificate problem\".\n\n\n#### `$timeout`\n\n```php\n$quandl-\u003etimeout = 60;\n```\n\nSet the timeout for the download operations.\n\n\n#### `$last_url`\n\n```php\nprint $quandl-\u003elast_url;\n```\n\nHolds the last API URL as requested from Quandl, for debugging.\n\n\n#### `$error`\n\n```php\nprint $quandl-\u003eerror;\n```\n\nIn case there was an error getting the data from Quandl, the request \nresponse will be `false` and this property will contain the error message.\n\n#### `$was_cached`\n\n```php\nprint $quandl-\u003ewas_cached;\n```\n\nWhen using a cache handler, this property will be set to `true` if the \nresponse came from the cache.\n\n\n\n\n### Methods\n\n#### `get`\n\n```php\nmixed get( string $path [, array $params ] )\n\n// Examples\n$data = $quandl-\u003eget( 'datasets/EOD/QQQ' );\n$data = $quandl-\u003eget( 'datasets/EOD/QQQ', ['rows' =\u003e 5] );\n```\n\nReturns an object containing the response from any of Quandl's API\nendpoints. The format of the result depends on the value of \n`$quandl-\u003eformat`.\n\nThe optional parameters array is an associative `key =\u003e value`\narray with any of the parameters supported by Quandl.\n\nYou do not need to pass `auth_token` in the array, it will be \nautomatically appended.\n\n\n#### `getSymbol`\n\n```php\nmixed getSymbol( string $symbol [, array $params ] )\n\n// Examples\n$data = $quandl-\u003egetSymbol( 'WIKI/AAPL' );\n$data = $quandl-\u003egetSymbol( 'WIKI/AAPL', ['rows' =\u003e 5] );\n```\n\nReturns an object containing data for a given symbol. The format\nof the result depends on the value of `$quandl-\u003eformat`.\n\nThe optional parameters array is an associative `key =\u003e value`\narray with any of the parameters supported by Quandl.\n\nYou do not need to pass `auth_token` in the array, it will be \nautomatically appended.\n\n\n#### `getSearch`\n\n```php\nmixed getSearch( string $query [, int $page, int $per_page] )\n\n// Examples\n$data = $quandl-\u003egetSearch( \"gold\" );\n$data = $quandl-\u003egetSearch( \"gold\", 1, 10 );\n```\n\nReturns a search result object. Number of results per page is \nlimited to 300 by default.\n\nNote that currently Quandl does not support CSV response for this \nnode so if `$quandl-\u003eformat` is \"csv\", this call will return a JSON\nstring instead.\n\n\n#### `getList`\n\n```php\nmixed getList( string $source [, int $page, int $per_page] )\n\n// Examples\n$data = $quandl-\u003egetList( 'WIKI' );\n$data = $quandl-\u003egetList( 'WIKI', 1, 10 );\n```\n\nReturns a list of symbols in a given source. Number of results per page is \nlimited to 300 by default.\n\n\n#### `getMeta`\n\n```php\nmixed getMeta( string $source )\n\n// Example\n$data = $quandl-\u003egetMeta( 'WIKI' );\n```\n\nReturns metadata about a symbol.\n\n\n#### `getDatabases`\n\n```php\nmixed getDatabases( [int $page, int $per_page] )\n\n// Examples\n$data = $quandl-\u003egetDatabases();\n$data = $quandl-\u003egetDatabases( 1, 10 );\n```\n\nReturns a list of available databases. Number of results per page is \nlimited to 100 by default.\n\n\n#### `getBulk`\n\n\u003e This feature is only supported with premium databases.\n\n```php\nboolean getBulk( string $database, string $path [, boolean $complete] )\n\n// Examples\nboolean getBulk( 'EOD', 'eod-partial.zip' );\nboolean getBulk( 'EOD', 'eod-full.zip', true );\n```\n\nDownloads the entire database and saves it to a ZIP file. If `$complete` \nis true (false by default), it will download the entire database, otherwise,\nit will download the last day only.\n\n\n\n[1]: https://www.quandl.com/help/api\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Fphp-quandl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdannyben%2Fphp-quandl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Fphp-quandl/lists"}