elminson/yahoo-finance-api
Composer 安装命令:
composer require elminson/yahoo-finance-api
包简介
PHP library for accessing Yahoo Finance data
README 文档
README
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
Download via Composer:
composer require elminson/yahoo-finance-api
Alternatively you can also add the package directly to composer.json:
{
"require": {
"elminson/yahoo-finance-api": "^4.0"
}
}
and then tell Composer to install the package:
composer update elminson/yahoo-finance-api
Usage
use Elminson\YahooFinanceApi\ApiClient; use Elminson\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 Elminson\YahooFinanceApi\Results\SearchResult $searchResult = $client->search("Apple"); // Returns an array of Elminson\YahooFinanceApi\Results\HistoricalData $historicalData = $client->getHistoricalQuoteData( "AAPL", ApiClient::INTERVAL_1_DAY, new \DateTime("-14 days"), new \DateTime("today") ); // Retrieve dividends history, returns an array of Elminson\YahooFinanceApi\Results\DividendData $dividendData = $client->getHistoricalDividendData( "AAPL", new \DateTime("-5 years"), new \DateTime("today") ); // Retrieve stock split history, returns an array of Elminson\YahooFinanceApi\Results\SplitData $splitData = $client->getHistoricalSplitData( "AAPL", new \DateTime("-5 years"), new \DateTime("today") ); // Returns Elminson\YahooFinanceApi\Results\Quote $exchangeRate = $client->getExchangeRate("USD", "EUR"); // Returns an array of Elminson\YahooFinanceApi\Results\Quote $exchangeRates = $client->getExchangeRates([ ["USD", "EUR"], ["EUR", "USD"], ]); // Returns Elminson\YahooFinanceApi\Results\Quote $quote = $client->getQuote("AAPL"); // Returns an array of Elminson\YahooFinanceApi\Results\Quote $quotes = $client->getQuotes(["AAPL", "GOOG"]);
Version Guidance
| Version | Status | PHP Version |
|---|---|---|
| 1.x | EOL | >= 5.3.0 |
| 2.x | EOL | >= 5.6.0 |
| 3.x | EOL | >= 5.6.0 |
| 4.x | Maintained | >= 7.1.3 |
License
This library is available under the MIT license.
Contributing
Want to contribute to this project? See CONTRIBUTING.md.
Support Me
I'm developing this library since 2014. I love to hear from people using it, giving me the motivation to keep working on my open source projects.
If you want to let me know you're finding it useful, please consider giving it a star ⭐ on GitHub.
If you love my work and want to say thank you, you can help me out for a beer 🍻️ via PayPal.
elminson/yahoo-finance-api 适用场景与选型建议
elminson/yahoo-finance-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 48 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 02 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「stock」 「yahoo」 「finance」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 elminson/yahoo-finance-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elminson/yahoo-finance-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 elminson/yahoo-finance-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Flexible inventory management for Symfony applications.
Magento 2.x Extension to prevent Out of Stock Children being removed from Used Product Collections.
Pretty line graphs in your console, html or images
A PSR-7 compatible library for making CRUD API endpoints
Simple stock management for Isotope eCommerce
Magento 2.x Extension to prevent Out of Stock Children being removed from Used Product Collections.
统计信息
- 总下载量: 48
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-24