Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kokspflanze/alpha-vantage-api
Alpha Vantage PHP Client
https://github.com/kokspflanze/alpha-vantage-api
alpha-vantage api-client php php7 stock stock-market
Last synced: 3 days ago
JSON representation
Alpha Vantage PHP Client
- Host: GitHub
- URL: https://github.com/kokspflanze/alpha-vantage-api
- Owner: kokspflanze
- License: mit
- Created: 2017-06-18T20:15:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-20T12:21:41.000Z (over 1 year ago)
- Last Synced: 2024-12-26T06:06:38.428Z (10 days ago)
- Topics: alpha-vantage, api-client, php, php7, stock, stock-market
- Language: PHP
- Homepage:
- Size: 132 KB
- Stars: 61
- Watchers: 11
- Forks: 25
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Alpha Vantage PHP Client
[![Build Status](https://travis-ci.org/kokspflanze/alpha-vantage-api.svg?branch=master)](https://travis-ci.org/kokspflanze/alpha-vantage-api)
The PHP-Client is a lightweight wrapper for the [Alpha Vantage](https://www.alphavantage.co).
## Requirements:
- PHP 7.1+
- composer (https://getcomposer.org/download/)
- AlphaVantage Key, that you get @ [AlphaVantage-Api-Key](https://www.alphavantage.co/support/#api-key)## Install
```
php composer.phar require kokspflanze/alpha-vantage-api
```## How to use it?
```php
setApiKey('YOUR_KEY');// Client
$client = new AlphaVantage\Client($option);
var_dump($client->foreignExchange()->currencyExchangeRate('BTC', 'CNY'));
```### Factory for PSR-11 Container
You can also use it with containers, using the PSR-11 standard for easy integration in a project.
You need require the suggest `psr/container` package:
```
php composer.phar require psr/container
```Register the Alpha Vantage Factory:
```php
return [
'dependencies' => [
'factories' => [
'alphavantage' => \AlphaVantage\Factory\AlphaVantageFactory::class,
],
],
];
```with the following configuration:
```php
return [
'alpha_vantage' => [
'api_key' => 'APIKEY',
]
];
```