Simple django REST API to retreive stock market information using Alpha Vantage API.
This service has been deployed in Heroku go see it: https://stocks-info-service.herokuapp.com/
After installing python create your virtual environment
python -m venv env
And install all the requirements
pip install -r requirements.txt
Add an .env file that contains your:
- SECRET_KEY: your django api secret key
- DEBUG: True or False. False when in production
- AV_API_KEY: Your Alpha Vantage API Key
In order to run your project, you will need to specify the environment mode (local/prod) with the evinronment variable:
export DJANGO_SETTINGS_MODULE=stock_service.settings.local
and go to the project's root directory, and run the server as needed:
python manage.py runserver
Or, send the flag that will specify the settings environment:
python manage.py runserver --settings=stock_service.settings.local
METHOD | ROUTE | FUNCTIONALITY | ACCESS |
---|---|---|---|
POST | /auth/signup/ |
Register new user | All users |
POST | /login |
Login user - get access token | All users |
GET | /stocksinfo/ |
Get a Stock Information | All authenticated users |
- Use the signup endpoint to create your user:
- Proceed to login enpoint to obtain you access token:
- Call the stocksinfo enpoint to get the given symbol information. Don't forget to send the access token in the Authorization header as a Bearer: