Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 1 day 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 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T19:28:53.000Z (over 1 year ago)
- Last Synced: 2024-10-13T13:20:48.797Z (about 1 month 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
[![Build Status](https://img.shields.io/travis/mschindler83/alpha-vantage/master.svg)](https://travis-ci.org/mschindler83/array-access)
[![Latest Stable Version](https://img.shields.io/packagist/v/mschindler83/alpha-vantage.svg)](https://packagist.org/packages/mschindler83/array-access)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/mschindler83/alpha-vantage.svg)](https://scrutinizer-ci.com/g/mschindler83/array-access/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/mschindler83/alpha-vantage/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/mschindler83/array-access/?branch=master)
[![Code Intelligence Status](https://scrutinizer-ci.com/g/mschindler83/alpha-vantage/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence)
[![Monthly Downloads](https://img.shields.io/packagist/dm/mschindler83/alpha-vantage.svg)](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();
[...]
```