dejwcake/yahoo-finance
dejwcake/yahoo-finance is a Laravel/PHP package for integrating Yahoo Finance market data into your applications. Use it to retrieve stock quotes and financial information through a simple API, making it easier to add market data features to your projects.
yfapi.net commercial API. Its value is a head start on plumbing and Laravel conventions, not data, compute, or algorithms. Treat adoption as "buy a sprint of boilerplate," not an architecture commitment.yfapi.net versus Alpha Vantage, Finnhub, Polygon, Twelve Data, or IEX. Because the client is small and framework-agnostic, switching cost is low — so keep the vendor choice reversible by wrapping the client behind your own interface rather than calling it from controllers and jobs.yfapi.net key with tiered pricing becomes a recurring cost; its quota and terms-of-service review belong to product and legal. The library exposes apiKey via config/env, which makes the cost visible but does not answer the commercial questions.ApiClient / EndPoints / Models split and a documented, mechanical recipe for a new endpoint (request model + endpoint + response model + factory + client method + tests). If you need one or two calls the package lacks, extending or forking is a contained task — which materially reduces the risk of adopting a low-adoption dependency.Adopt when:
final readonly, and declare(strict_types=1) throughout, so it clears most lint and static-analysis gates without a fight.yfapi.net key or are willing to buy one and accept its terms.main is protected with required checks, and there is a stated versioning policy (widening supported ranges is minor; changing public methods, models, or enums is major). That is above-average discipline for a package this size.Look elsewhere — or write ~200 lines yourself — when:
composer.json runtime constraints before betting a rollout on it.Executives — "It buys us a sprint, not a platform." Integrating a market-data surface normally means auth, endpoint handling, response parsing, and typed models. This package already does that, so a feature team ships quotes and history in days instead of a sprint. Costs are a small tiered data subscription, roughly half a day of integration, and a legal review. Log three risks: license — GPL-3.0 must be cleared before build and it constrains any future distribution model; supply — low adoption and unclear maintainer depth, mitigated by the library being thin, with a replacement cost measured in days; upstream — hard dependence on a third-party vendor's terms, quotas, and uptime, which no client library can absorb. Recommendation: approve for internal tools and discovery; do not let it underpin a customer-facing, revenue-bearing market-data product without a second data source and a caching/rate-limit layer. Keep the exit cheap by wrapping the client behind our own interface.
Engineering — "It's boring in the right ways." Composer-installable; the service provider merges and publishes a small config (apiUrl, timeout, apiKey from env) and binds a singleton client on a Guzzle/PSR-18 stack with the X-API-KEY header pre-attached. No facades; contracts are injected. Enums for Interval, Range, Region, and Lang (with select-trait helpers) and typed request/response models with factories mean autocomplete instead of array soup. YahooFinanceClient::create() accepts an injected HTTP client and logger, so tests run offline against recorded JSON over a mocked PSR-18 client — mirror that pattern rather than mocking the network. Adding a call is mechanical and documented. All gates are enforced: phpcs, phpstan, phpmd, PHPUnit 11.5/12. Respect the constraints: PHP ^8.2 floor, Laravel 10–12, no helpers, no facades, sprintf over interpolation, name properties after their types. Budget explicitly for what is not included — caching, retry/backoff, quota handling, and a fake client for local development — and assign an owner before the first integration ticket.
How can I help you explore Laravel packages today?