This Project is purely based on Pyhon and their webframework Django with Alphavantage API.
The purpose of this project is to fetch the price of BTC/USD from the Alphavantage API everyhour, stores the data in Postgre Database. The API must be secured mean you need to pass an API key to use it. We provided here two Endpoints : GET/api/v1/quotes which returns exchnage rate and POST/api/v1/quotes which triggers force requesting of the price from Alphavantage API. An API Key is required to run this project.
We used here Docker to containerize API and DB. You have to use your Alphavantage APIKEY to run this program.
Please go through the Requirements.txt file:https://github.com/ankurpython/crypto/blob/master/requirements.txt and install all the requirements.
- Install the Docker: https://docs.docker.com/docker-for-windows/install/ (for Windows) and for other environment https://docs.docker.com/engine/install/
- Docker-compose: https://docs.docker.com/compose/install/
- Download or Clone the Repository: git clone https://github.com/ankurpython/crypto.git
- Go to the Dockerfile change the APIKEY to your APIKEY: APIKEY == Your-API-KEY.
- Run the container: sudo docker-compose up
- Create the superuser using this command Run the: docker exec -it container_id python manage.py createsuperuser
- Login with username and password.http://localhost:8000/admin_login. This will return the access token.
- Request with Bearer token using this endpoint: http://localhost:8000/api/v1/quotes
- For the GET and POST request
Build the Docker container by using: docker-compose build