Small service to get data from alpha vantage API.
Invoke this API at: https://9mj1a85khj.execute-api.sa-east-1.amazonaws.com/v1/
Try a front-end example here.
Example input:
{
"AtivoNome": "GOOGL",
"DataPreco": "2018-07-04"
}
Example output:
{
"AtivoNome": "GOOGL",
"DataPreco": "2018-07-04",
"Preco": "1116.28000000"
}
The stock price returned as "Preco" is obtained as follows:
- A call to the Alpha Vantage API with the function TIME_SERIES_DAILY_ADJUSTED is made;
- The stock value for that desired date is obtained from the "4.close" key. If the desired date is not present on the retrieved data, the day before is considered;
- The stock value is formatted with 8 decimal places.
- lamba.py : source code for the lambda
- StockAPI-v1-swagger-postman.json : exported stage for use with Postman
- test_lambda.py : test cases with python
- test_lambda.html: simple front-end test (TRY IT HERE)
How to use: make a POST request to 'https://9mj1a85khj.execute-api.sa-east-1.amazonaws.com/v1/'
- server.py : flask server code
- test.py : test cases with python
- templates/index.html: simple front-end test
How to use: make a POST request to 'http://localhost:5000/stock'