davidgrzyb / laravel-finnhubio
1.0
2020-05-15 23:27 UTC
Requires
- php: ^7.2.5
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- orchestra/testbench: ^4.0
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2025-04-24 08:24:35 UTC
README
This Laravel package simplifies the usage of Finnhub.io's API for getting stock, forex and crypto data. Currently only the Stock Price, Forex and Crypto endpoints are supported.
Installation
You can install the package via composer:
composer require davidgrzyb/laravel-finnhubio
You will need to add an API key for Finnhub in your .env
file with the key FINNHUB_API_KEY
. Get your API key here.
Usage
Stock Prices
// Quote endpoint: Finnhubio::stock()->getQuote('AAPL'); // Candles endpoint: Finnhubio::stock()->getCandles('AAPL', '1', now()->subDay(1), now()); // Dividends endpoint: Finnhubio::stock()->getDividends('AAPL', now()->subMonth(10), now()); // Splits endpoint: Finnhubio::stock()->getSplits('AAPL', now()->subYear(10), now());
Forex
// Exhanges endpoint: Finnhubio::forex()->getExchanges(); // Symbols endpoint: Finnhubio::forex()->getSymbols('oanda'); // Candles endpoint: Finnhubio::forex()->getCandles('OANDA:EUR_USD', 'D', now()->subDays(1), now()); // All rates endpoint: Finnhubio::forex()->getRates();
Crypto
// Exchanges endpoint: Finnhubio::crypto()->getExchanges(); // Symbols endpoint: Finnhubio::crypto()->getSymbols('binance'); // Candles endpoint: Finnhubio::crypto()->getCandles('BINANCE:BTCUSDT', 'D', now()->subDays(1), now());
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.