Skip to content

kelfy/yahoo-finance-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scheb/yahoo-finance-api

This is a PHP client for Yahoo Finance API. It provides easy access to stock quotes via Yahoo's [YQL API] (http://developer.yahoo.com/yql/).

Installation

Download via Composer:

php composer.phar require scheb/yahoo-finance-api

When being asked for the version use dev-master or any different version you want.

Alternatively you can also add the bundle directly to composer.json:

{
    "require": {
        "scheb/yahoo-finance-api": "dev-master"
    }
}

and then tell Composer to install the bundle:

php composer.phar update scheb/yahoo-finance-api

Usage

$client = new \Scheb\YahooFinanceApi\ApiClient();

//Fetch basic data
$data = $client->getQuotesList("YHOO"); //Single stock
$data = $client->getQuotesList(array("YHOO", "GOOG")); //Multiple stocks at once

//Fetch full data set
$data = $client->getQuotes("YHOO"); //Single stock
$data = $client->getQuotes(array("YHOO", "GOOG")); //Multiple stocks at once

//Get historical data
$data = $client->getHistoricalData("YHOO");

//Search stocks
$data = $client->search("Yahoo");

Each function returns the decoded JSON response as an associative array. See the following examples:

About

PHP client for Yahoo Finance API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%