An app with selectable API's for checking exchange rates and optional automatic notifications using different backends, built with Go.
- Multiple exchange rate API support (ExchangeRate-API, Open Exchange Rates)
- Rate limiting and request tracking
- Simple HTTP API
- Containerized with Docker
- State persistence between restarts
- Go 1.16+
- Docker and Docker Compose (optional)
- API keys for the desired exchange rate providers
Create a .env file in the project root with the following variables:
# ExchangeRate-API (er-a) - Get your key from https://www.exchangerate-api.com/
EXCHANGERATE_API_KEY=your_api_key_here
# Open Exchange Rates (oer) - Get your key from https://openexchangerates.org/
OPENEXCHANGERATES_APP_ID=your_app_id_here-
Copy the example state file:
cp api_state.example.json api_state.json
-
Set up environment variables (see above)
-
Run the application:
# Using Go go run . # Or using Docker Compose docker compose up
The server will start on http://localhost:8080
GET /exchange-rates?api={provider}&base={currency}provider(required): The API provider to use (er-aoroer)
# Using curl
curl "http://localhost:8080/exchange-rates?api=er-a&base=USD"
# Using httpie
http ":8080/exchange-rates" api==er-a base==USD{
"rates": {
"EUR": 0.92,
"GBP": 0.79,
"JPY": 156.42,
"USD": 1.0
}
}| Provider | ID | Request Limit | Documentation |
|---|---|---|---|
| ExchangeRate-API | er-a |
1,500/month | docs |
| Open Exchange Rates | oer |
1,000/month | docs |
go test -vdocker build -t exchange-go-notifier .
docker run -p 8080:8080 --env-file .env exchange-go-notifierThis project is licensed under the Apache 2.0 License - see the LICENSE file for details.