mschindler83/alpha-vantage

Wrapper for Alpha Vantage API

v1.0.0 2020-03-09 13:44 UTC

This package is auto-updated.

Last update: 2024-12-19 23:39:51 UTC


README

Build Status Latest Stable Version Scrutinizer Code Quality Code Coverage Code Intelligence Status Monthly Downloads

Wrapper library for the Alpha Vantage API Requires PHP >= 7.4

Install

composer require mschindler83/alpha-vantage

Features

  • Get forex exchange rates
  • Search for symbol
  • Get global quote
  • [...] More to come soon

Usage Examples

Get a client instance

$alphaVantage = \Mschindler83\AlphaVantage\Client::instance($apiKey)

Get forex exchange rate

$request = ForexExchangeRateRequest::convert('EUR', 'USD');
$exchangeRate = $alphaVantage->forexExchangeRate($request);

echo $exchangeRate->exchangeRate();

Search for symbol

$request = SearchRequest::queryString('MSCI World');
$searchResults = $alphaVantage->search($request);

$allResultsArray = $searchResults->items();
echo $allResultsArray[0]->symbol();

Get global quote

$request = GlobalQuoteRequest::symbol('IWDA.LON');
$globalQuote = $alphaVantage->globalQuote($request);

echo $globalQuote->open();
echo $globalQuote->high();
echo $globalQuote->low();
[...]