Skip to content

Simple REST API to retreive stock market information using Alpha Vantage API

License

Notifications You must be signed in to change notification settings

AndrewB4y/StockService

Repository files navigation

StockService

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/

Prepare your environment

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

ROUTES IMPLEMENTED

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

How to use the app

  1. Use the signup endpoint to create your user:

signup

  1. Proceed to login enpoint to obtain you access token:

login

  1. 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:

stockinf

About

Simple REST API to retreive stock market information using Alpha Vantage API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published