davidgrzyb / finnhubio-laravel

A Finnhub.io API wrapper for Laravel.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Simple Finnhub.io Package for Laravel

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.

About

A Finnhub.io API wrapper for Laravel.

License:MIT License


Languages

Language:PHP 100.0%