mschindler83 / alpha-vantage
Wrapper for Alpha Vantage API
v1.0.0
2020-03-09 13:44 UTC
Requires
- php: >=7.4
- ext-json: *
- beberlei/assert: ^3.2
- guzzlehttp/guzzle: ~6.0
- mschindler83/array-access: ^1.5
- opis/json-schema: ^1.0
Requires (Dev)
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2024-10-19 23:10:42 UTC
README
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();
[...]