https://github.com/jd-apprentice/dolar-hoy-api
๐ฐ Dolar hoy APIRest made with fastapi
https://github.com/jd-apprentice/dolar-hoy-api
collaborate digitalocean docker github makefile python
Last synced: 7 months ago
JSON representation
๐ฐ Dolar hoy APIRest made with fastapi
- Host: GitHub
- URL: https://github.com/jd-apprentice/dolar-hoy-api
- Owner: jd-apprentice
- License: gpl-3.0
- Created: 2023-05-26T00:25:24.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-10T05:59:51.000Z (over 1 year ago)
- Last Synced: 2024-07-10T07:57:47.156Z (over 1 year ago)
- Topics: collaborate, digitalocean, docker, github, makefile, python
- Language: Python
- Homepage: https://dolar.jonathan.com.ar/
- Size: 61.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ฐ Dolar-hoy API

[](https://app.codacy.com/gh/jd-apprentice/dolar-hoy-api/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
## ๐ Description
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](https://www.dolarhoy.com/) and saved in PlanetScale.
## ๐ Run
To run the project you need to have Docker installed in your machine. Then, you can run the following command:
```bash
docker compose up
```
## ๐งช Endpoints
```bash
GET /dolar/:currency
POST /manual
```
Where `:currency` can be
- blue
- oficial
- crypto
- mep
## ๐ฅ Examples
```bash
curl -X GET "http://localhost:4500/dolar/blue" -H "accept: application/json"
```
Response
```json
{
"label": "Dolar Blue",
"prices": {
"buy_price": 488,
"sell_price": 493
},
"last_update": "2023-05-25 20:35:58" // UTC -3
}
```
## ๐ป Workflow

## ๐งฐ Stack
- Python
- FastAPI
- Docker
- PlanetScale
- GitHub Actions
- DigitalOcean
- Nginx
## ๐ Environment Variables
| 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 |