https://github.com/mschindler83/alpha-vantage
API wrapper for Alpha Vantage
https://github.com/mschindler83/alpha-vantage
exchange-rates forex forex-market php74 stock-api stock-market stocks
Last synced: 5 months ago
JSON representation
API wrapper for Alpha Vantage
- Host: GitHub
- URL: https://github.com/mschindler83/alpha-vantage
- Owner: mschindler83
- License: mit
- Created: 2020-03-09T13:28:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T19:28:53.000Z (over 3 years ago)
- Last Synced: 2025-01-19T22:50:50.724Z (over 1 year ago)
- Topics: exchange-rates, forex, forex-market, php74, stock-api, stock-market, stocks
- Language: PHP
- Size: 40 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Alpha Vantage
[](https://travis-ci.org/mschindler83/array-access)
[](https://packagist.org/packages/mschindler83/array-access)
[](https://scrutinizer-ci.com/g/mschindler83/array-access/?branch=master)
[](https://scrutinizer-ci.com/g/mschindler83/array-access/?branch=master)
[](https://scrutinizer-ci.com/code-intelligence)
[](https://packagist.org/packages/mschindler83/array-access)
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();
[...]
```