cheesaw / alpha-vantage-bundle
This Bundle integrates the Alphavantage API into Symfony
Installs: 27
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.4|^8.0
- guzzlehttp/guzzle: ^7.0|^6.0
- phpspec/prophecy-phpunit: ^2.0
- symfony/config: ^3.4|^4.2|^5.0
- symfony/dependency-injection: ^3.4|^4.2|^5.0
- symfony/http-kernel: ^3.4|^4.2|^5.0
Requires (Dev)
- phpmd/phpmd: ^2.8
- phpstan/phpstan: ^0.12.9
- phpunit/phpunit: ^9.0
- roave/security-advisories: dev-master
- squizlabs/php_codesniffer: ^3.5
- symfony/yaml: ^5.0
This package is auto-updated.
Last update: 2023-02-11 09:01:07 UTC
README
This bundle integrates the http://alphavantage.co/ Stock and Crypto API into Symfony 3/4/5.
Requirements
- PHP 7.4+
- composer
- Alphavantage API-key, claim yours here
Installation
composer require cheesaw/alpha-vantage-bundle
Setup
Set your API-key into an env var
CHEESAW_ALPHA_VANTAGE_API_KEY=YOUR-API-KEY
Usage
Just use the client, it will be autowired by Symfony into your Services/Controllers
/** * @Route("test/av/get", name="cheesaw_alphavantage_test") * @throws Exception */ public function alphaVantageTestAction(AlphaVantage $alphaVantageClient): Response { $stockTimeSeries = new StockTimeSeries(StockTimeSeries::GLOBAL_QUOTE, 'BLDP'); $response = $alphaVantageClient->get($stockTimeSeries); return new Response($response); }
The code will output json:
{ "Global Quote": { "01. symbol": "BLDP", "02. open": "10.6200", "03. high": "10.9800", "04. low": "10.4500", "05. price": "10.9300", "06. volume": "1086884", "07. latest trading day": "2020-02-06", "08. previous close": "10.6300", "09. change": "0.3000", "10. change percent": "2.8222%" } }
Contributing
- Fork this repository
- Write your code
- Create a new pull request
FAQ
On any questions, send me a message!
License
- MIT license
- Copyright 2020 © Martin Tomala.