2018-04-16 17:19:15 +02:00
# Frankfurter
2016-04-07 21:00:59 +02:00
2020-04-02 13:40:06 +02:00
[![Build ](https://github.com/hakanensari/frankfurter/workflows/build/badge.svg )](https://github.com/hakanensari/frankfurter/actions)
2015-07-28 17:27:10 +02:00
2024-10-03 22:24:56 +02:00
[Frankfurter ](https://frankfurter.dev ) is a free and open-source currency data API that tracks reference exchange rates published by the European Central Bank.
2018-09-11 18:59:18 +02:00
2021-04-24 22:41:08 +02:00
`api.frankfurter.app` hosts a public instance of the API.
2016-04-07 21:00:59 +02:00
2019-05-15 14:22:06 +02:00
## Getting Started
2016-04-07 21:00:59 +02:00
2019-05-15 14:22:06 +02:00
Get the latest exchange rates.
2016-04-11 15:38:28 +02:00
2021-04-24 22:41:08 +02:00
```
https://api.frankfurter.app/latest
2016-04-11 15:38:28 +02:00
```
2019-05-15 14:22:06 +02:00
Get rates for a past date.
2016-04-11 15:38:28 +02:00
2021-04-24 22:41:08 +02:00
```
https://api.frankfurter.app/2000-01-03
2018-09-11 18:59:18 +02:00
```
2019-05-15 14:22:06 +02:00
Get rates for a period.
2018-09-11 18:59:18 +02:00
```http
2021-04-24 22:41:08 +02:00
https://api.frankfurter.app/2010-01-01..2010-01-31
2016-04-11 15:38:28 +02:00
```
2019-05-15 14:22:06 +02:00
## Deployment
2018-03-17 15:28:52 +01:00
2021-04-24 22:41:08 +02:00
You can self-host Frankfurter with Docker.
2016-04-11 15:38:28 +02:00
2019-05-15 14:22:06 +02:00
```bash
docker run -d -p 8080:8080 \
-e "DATABASE_URL=< postgres_url > " \
--name frankfurter hakanensari/frankfurter
2016-04-07 21:00:59 +02:00
```
2024-11-17 10:56:50 +01:00
Alternatively, copy the [docker-compose.yml ](./docker-compose.yml ) file to your system, and in the same directory run:
```bash
docker compose up --wait
```
This will also setup and host the PostgreSQL for Frankfurter.