PHPackages                             krivov/yahoo-finance-api - 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. krivov/yahoo-finance-api

ActiveLibrary[API Development](/categories/api)

krivov/yahoo-finance-api
========================

PHP library for accessing Yahoo Finance data

v4.11.3(1y ago)07MITPHPPHP &gt;=8.3.3

Since Jan 18Pushed 1y agoCompare

[ Source](https://github.com/krivov/yahoo-finance-api)[ Packagist](https://packagist.org/packages/krivov/yahoo-finance-api)[ Docs](https://github.com/krivov/yahoo-finance-api)[ RSS](/packages/krivov-yahoo-finance-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (17)Used By (0)

scheb/yahoo-finance-api
=======================

[](#schebyahoo-finance-api)

[![Build Status](https://camo.githubusercontent.com/0cadb9bb9be41f2d6893f39b8ad5b3f85eb35e678a275dcc53caa228479297f8/68747470733a2f2f7472617669732d63692e6f72672f73636865622f7961686f6f2d66696e616e63652d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/scheb/yahoo-finance-api)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b2fa7def9c36503ec4c9e474f74cace059c3bf183dc2259b57ade5d70aee0759/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73636865622f7961686f6f2d66696e616e63652d6170692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/scheb/yahoo-finance-api/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/387115d1749fa81153ae74de974484c27901102ae585580f7898ce80f5f4337b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73636865622f7961686f6f2d66696e616e63652d6170692f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/scheb/yahoo-finance-api/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/376b933f36d808553ecdedc4b50872bd96287629c62c5a325657dbe437170303/68747470733a2f2f706f7365722e707567782e6f72672f73636865622f7961686f6f2d66696e616e63652d6170692f762f737461626c652e737667)](https://packagist.org/packages/scheb/yahoo-finance-api)[![Total Downloads](https://camo.githubusercontent.com/69687e04b4ce75892cb44388caa1ba5ef31d2a6d69f647981d0c30cd5a9615eb/68747470733a2f2f706f7365722e707567782e6f72672f73636865622f7961686f6f2d66696e616e63652d6170692f646f776e6c6f616473)](https://packagist.org/packages/scheb/yahoo-finance-api)[![License](https://camo.githubusercontent.com/b151478163bd92f0ef5d789431418f33574f5acfd45d44d7ac40e95c0e90df78/68747470733a2f2f706f7365722e707567782e6f72672f73636865622f7961686f6f2d66696e616e63652d6170692f6c6963656e73652e737667)](https://packagist.org/packages/scheb/yahoo-finance-api)

This is a PHP client for Yahoo Finance API.

Since YQL APIs have been discontinued in November 2017, this client is using non-official API endpoints for quotes, search and historical data.

**WARNING:** These non-official APIs cannot be assumed stable and might break any time. Also, you might violate Yahoo's terms of service. So use them at your own risk.

Installation
------------

[](#installation)

Download via Composer:

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

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

```
{
    "require": {
        "scheb/yahoo-finance-api": "^3.0"
    }
}
```

and then tell Composer to install the bundle:

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

Usage
-----

[](#usage)

```
use Scheb\YahooFinanceApi\ApiClient;
use Scheb\YahooFinanceApi\ApiClientFactory;
use GuzzleHttp\Client;

// Create a new client from the factory
$client = ApiClientFactory::createApiClient();

// Or use your own Guzzle client and pass it in
$options = [/*...*/];
$guzzleClient = new Client($options);
$client = ApiClientFactory::createApiClient($guzzleClient);

// Returns an array of Scheb\YahooFinanceApi\Results\SearchResult
$searchResult = $client->search("Apple");

// Returns an array of Scheb\YahooFinanceApi\Results\HistoricalData
$historicalData = $client->getHistoricalData("AAPL", ApiClient::INTERVAL_1_DAY, new \DateTime("-14 days"), new \DateTime("today"));

// Returns Scheb\YahooFinanceApi\Results\Quote
$exchangeRate = $client->getExchangeRate("USD", "EUR");

// Returns an array of Scheb\YahooFinanceApi\Results\Quote
$exchangeRates = $client->getExchangeRates([
    ["USD", "EUR"],
    ["EUR", "USD"],
]);

// Returns Scheb\YahooFinanceApi\Results\Quote
$quote = $client->getQuote("AAPL");

// Returns an array of Scheb\YahooFinanceApi\Results\Quote
$quotes = $client->getQuotes(["AAPL", "GOOG"]);
```

Contribute
----------

[](#contribute)

You're welcome to [contribute](https://github.com/scheb/yahoo-finance-api/graphs/contributors) to this library by creating a pull requests or feature request in the issues section. For pull requests, please follow these guidelines:

- Symfony code style
- Please add/update test cases
- Test methods should be named `[method]_[scenario]_[expected result]`

To run the test suite install the dependencies with `composer install` and then execute `bin/phpunit`.

License
-------

[](#license)

This bundle is available under the [MIT license](LICENSE).

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance42

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 83.9% 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 ~267 days

Recently: every ~619 days

Total

16

Last Release

481d ago

Major Versions

1.x-dev → v2.0.02017-08-10

v2.1.0 → v3.0.02017-11-14

2.x-dev → v3.1.02018-04-05

v3.1.1 → v4.0.02024-07-07

PHP version history (4 changes)v1.0.0PHP &gt;=5.3.0

v2.0.0PHP &gt;=5.6.0

v4.0.0PHP &gt;=8.1.3

v4.11.3PHP &gt;=8.3.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/112701d9a7cfa7699ed81b91343e30e0e401d450196082f13179ea03170661fd?d=identicon)[krivov](/maintainers/krivov)

---

Top Contributors

[![scheb](https://avatars.githubusercontent.com/u/1259952?v=4)](https://github.com/scheb "scheb (52 commits)")[![krivov](https://avatars.githubusercontent.com/u/3669144?v=4)](https://github.com/krivov "krivov (6 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (3 commits)")[![clind922](https://avatars.githubusercontent.com/u/3989064?v=4)](https://github.com/clind922 "clind922 (1 commits)")

---

Tags

apifinanceyahoostock

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/krivov-yahoo-finance-api/health.svg)

```
[![Health](https://phpackages.com/badges/krivov-yahoo-finance-api/health.svg)](https://phpackages.com/packages/krivov-yahoo-finance-api)
```

###  Alternatives

[scheb/yahoo-finance-api

PHP library for accessing Yahoo Finance data

318204.8k5](/packages/scheb-yahoo-finance-api)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[bunq/sdk_php

bunq PHP SDK

89222.7k2](/packages/bunq-sdk-php)[jeffreyhyer/alpaca-trade-api-php

PHP SDK for the Alpaca trade API

285.0k](/packages/jeffreyhyer-alpaca-trade-api-php)

PHPackages © 2026

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