A PHP library for accessing quotes through Yahoo finance API
It offers a simple API to access Yahoo! Finance data.
This API Client enables you to work with the Yahoo! Finance API.
<?php
require_once '../vendor/autoload.php';
$config = new \Robsen77\YahooFinance\Config\Config();
$api = new \Robsen77\YahooFinance\Api($config);
$quoteEntity = $api->getQuote("YHOO");
$price = $quoteEntity->getCurrentPrice();
echo "current price (YHOO): $price\n";
?>
For more examples, look into the examples directory.
There are two options for obtaining the files for the client library.
If you don't have installed Composer now, follow the instructions described at getcomposer.org. Actually this package is not available at packagist.org! So you have to configure your composer.json as follows:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/robsen77/yahoo-finance"
}
],
"require": {
"robsen77/yahoo-finance": "dev-master"
}
}
If your composer.json is not blank, feel free to put the things to the right place ;).
The library is available on GitHub. It can be cloned into a local repository with the git clone method.
git clone https://github.com/robsen77/yahoo-finance.git
solved or in progress:
- current quotes
- history quotes
not solved:
- sectors (open)
- cash flow (open)
- income statement (open)
- industry (open)
- key statistics (open)