PHPackages                             aensley/yahoo-stock-quotes - 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. aensley/yahoo-stock-quotes

AbandonedArchivedLibrary[API Development](/categories/api)

aensley/yahoo-stock-quotes
==========================

Quick and dirty Yahoo stock quotes in PHP

0122PHP

Since Apr 21Pushed 10y ago1 watchersCompare

[ Source](https://github.com/aensley/YahooStockQuotes)[ Packagist](https://packagist.org/packages/aensley/yahoo-stock-quotes)[ RSS](/packages/aensley-yahoo-stock-quotes/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

YahooStockQuotes
================

[](#yahoostockquotes)

Yahoo Stock Quotes in PHP

[![MIT License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://github.com/aensley/YahooStockQuotes/blob/master/LICENSE) [![Build Status](https://camo.githubusercontent.com/e15fb28df5c1649c77e93fb6988a40491f001d089c7fb7ddda380992fc5c9c67/68747470733a2f2f7472617669732d63692e6f72672f61656e736c65792f5961686f6f53746f636b51756f7465732e737667)](https://travis-ci.org/aensley/YahooStockQuotes) [![HHVM Test Status](https://camo.githubusercontent.com/8772b594d2046245282022f72342142d51d07c92fd6a0a56cc486ffca7210b4a/68747470733a2f2f696d672e736869656c64732e696f2f6868766d2f61656e736c65792f7961686f6f2d73746f636b2d71756f7465732e737667)](http://hhvm.h4cc.de/package/aensley/yahoo-stock-quotes) [![GitHub Issues](https://camo.githubusercontent.com/269f3899db919f6d04377856110610eeef642fb8481f7bdf01918faca11e2cfc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f61656e736c65792f5961686f6f53746f636b51756f7465732e737667)](https://github.com/aensley/YahooStockQuotes/issues) [![GitHub Downloads](https://camo.githubusercontent.com/15357f57293b991de2a60805dac37369c416c5b319e7551e7394e29879c06fa0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f61656e736c65792f5961686f6f53746f636b51756f7465732f746f74616c2e737667)](https://github.com/aensley/YahooStockQuotes/releases) [![Packagist Downloads](https://camo.githubusercontent.com/0775de15e28c677456893609851a928ddc1b06f7d25915f7cd21acf2c98da2fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61656e736c65792f7961686f6f2d73746f636b2d71756f7465732e737667)](https://packagist.org/packages/aensley/yahoo-stock-quotes)

[![Code Climate Grade](https://camo.githubusercontent.com/279653f5b142bf9f8b5713fcaf9f8a4452da4a1d943030f4b8771d1368e8b288/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f61656e736c65792f5961686f6f53746f636b51756f7465732f6261646765732f6770612e737667)](https://codeclimate.com/github/aensley/YahooStockQuotes) [![Code Climate Issues](https://camo.githubusercontent.com/3125d75c789deb2f04cf81b85828ccf41e44c5f129bea966d7ed8a9aa50eb0ab/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6973737565732f6769746875622f61656e736c65792f5961686f6f53746f636b51756f7465732e737667)](https://codeclimate.com/github/aensley/YahooStockQuotes) [![Codacy Grade](https://camo.githubusercontent.com/9d82bc3ccef6eab77da45a13aaa3271e600c6b1ba301f314ecbaedf91f54b42c/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f67726164652f3735336566623939356666363462393038376366326534393532653931303338)](https://www.codacy.com/app/awensley/YahooStockQuotes) [![SensioLabsInsight](https://camo.githubusercontent.com/f10d3a3e37de3058fdbef4a95e8a3ff50c55370ce3378f7a95f252255a228e5d/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f62633064643761632d623431332d343461332d626362342d3535653261623138303864392e737667)](https://insight.sensiolabs.com/projects/bc0dd7ac-b413-44a3-bcb4-55e2ab1808d9)

[![Code Climate Test Coverage](https://camo.githubusercontent.com/ef9e9ee0095f76c631830875c2f4fdd68dee405007f1a8e1f7bfbef4f16dd826/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f61656e736c65792f5961686f6f53746f636b51756f7465732f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/aensley/YahooStockQuotes/coverage) [![Codacy Test Coverage](https://camo.githubusercontent.com/13c19b28bbfde21e809b9fc929a526c26b57e32fb4f2b715a6ced3f93fd3fded/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f636f7665726167652f3735336566623939356666363462393038376366326534393532653931303338)](https://www.codacy.com/app/awensley/YahooStockQuotes) [![Codecov.io Test Coverage](https://camo.githubusercontent.com/4dd74d4d0003607755376cc39f1331a898ec4da72f3f41093a762205f54dfc4e/68747470733a2f2f636f6465636f762e696f2f6769746875622f61656e736c65792f5961686f6f53746f636b51756f7465732f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/aensley/YahooStockQuotes?branch=master) [![Coveralls Test Coverage](https://camo.githubusercontent.com/036a7932ae16bbd9baab7658afb149441d640f8419232adf3a9f707155eb4b9b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f61656e736c65792f5961686f6f53746f636b51756f7465732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/aensley/YahooStockQuotes?branch=master)

What it does
------------

[](#what-it-does)

This library makes it simple to access any number of stock prices (and their changes) in your code. It limits itself to one update per day to save your server's (and Yahoo's) resources. It consists of [one code file](https://github.com/aensley/YahooStockQuotes/blob/master/src/Aensley/YahooStockQuotes/YahooStockQuotes.php) and [one cache file](https://github.com/aensley/YahooStockQuotes/blob/master/src/Aensley/YahooStockQuotes/YahooStockQuotes.json). No database necessary.

Merely pass an array of your desired stocks' symbols to the `YahooStockQuotes` constructor and use the [three public functions](#example-usage) where you need them.

Simple.

Requirements
------------

[](#requirements)

There must be a `YahooStockQuotes.json` file in the same directory as the `YahooStockQuotes.php` file.

`YahooStockQuotes.json` must be **WRITABLE** by the user who owns the PHP process (apache, www-data, nginx, hhvm, etc.).

If the file does not exist or is not writable, every page view will require a new request to Yahoo's servers, which will slow down all page views drastically and get your server blocked by Yahoo.

Example usage
-------------

[](#example-usage)

```
