This API returns the real-time exchange rate for any pair of digital currency (e.g., Bitcoin) or physical currency (e.g., USD) using https://alphavantage.co
- Clone this repository.
- Copy Sample of Environment Variables and Update the missing values
cp .env.example .env
- Get
ALPHAVANTAGE_API_KEY
from https://www.alphavantage.co/support/#api-key
- Install virtualenv https://virtualenv.pypa.io/en/stable/installation.html
- Setup virtualenv
virtualenv venv
- Activate virtualenv
source venv/bin/activate
- Install dependencies
make install
orpip install -r requirements.txt
- Run the project
make run
orpython manage.py runserver
- Build and Run with Docker
make docker-up
ordocker-compose up --build
- Create Default Admin Account and follow the prompts
make createsuperuser
orpython manage.py createsuperuser
- Visit http://127.0.0.1:8000/admin/rest_framework_api_key/apikey/ to create a new API KEY
/api/v1/quotes/` - POST
Headers:
Api-Key: {API_KEY_GENERATED_BY_ADMIN}
/api/v1/quotes/` - GET
Headers:
Api-Key: {API_KEY_GENERATED_BY_ADMIN}
(Success): Status Code: 200
{
"status": true,
"error": [],
"data": {
"from_currency_code": "BTC",
"from_currency_name": "Bitcoin",
"to_currency_code": "USD",
"to_currency_name": "United States Dollar",
"exchange_rate": "58073.74000000",
"last_refreshed": "2021-05-01 02:58:06",
"time_zone": "UTC",
"bid_price": "58073.74000000",
"ask_price": "58073.75000000"
},
"message": "Operation was successful"
}
(Error): Status Code: 401
{
"status": false,
"data": [],
"message": "Something went wrong",
"error": {
"detail": "Authentication credentials were not provided."
}
}
- Python (Django)
- PosgreSQL
- Redis
- Celery
- Docker