Project to learn how to deploy and mantain a REST API using FastAPI and Docker. The API is a simple GET endpoint that returns the current value of the dolar in Argentina. Values are being scrapped from DolarHoy and saved in PlanetScale.
To run the project you need to have Docker installed in your machine. Then, you can run the following command:
docker compose up
GET /dolar/:currency
POST /manual
Where :currency
can be
- blue
- oficial
- crypto
- mep
curl -X GET "http://localhost:4500/dolar/blue" -H "accept: application/json"
Response
{
"label": "Dolar Blue",
"prices": {
"buy_price": 488,
"sell_price": 493
},
"last_update": "2023-05-25 20:35:58" // UTC -3
}
- Python
- FastAPI
- Docker
- PlanetScale
- GitHub Actions
- DigitalOcean
- Nginx
Name | Description | Default |
---|---|---|
HOST | Host to run the API | xxx |
USERNAME | Username to connect to PlanetScale | xxx |
PASSWORD | Password to connect to PlanetScale | xxx |
DATABASE | Database to connect to PlanetScale | xxx |
MANUAL_USERNAME | Username to use the scrapper | xxx |
MANUAL_PASSWORD | Password to use the scrapper | xxx |