Frankfurter (v1)
v1 API는 v2로 대체되어 deprecated 상태이지만, 계속 동작합니다.
API 엔드포인트
최신 환율, 과거 환율, 시계열을 조회합니다.
- 최신 환율
- 가장 최근 영업일의 환율을 조회합니다. 매일 중앙유럽시간(CET) 16시경에 갱신됩니다.
curl https://api.frankfurter.dev/v1/latest-
base파라미터로 기준 통화를 변경합니다. 기본값은 EUR입니다. curl https://api.frankfurter.dev/v1/latest?base=USD- 응답을 특정 대상 통화로 제한합니다.
curl https://api.frankfurter.dev/v1/latest?symbols=CHF,GBP- 과거 환율
- 특정 날짜의 환율을 조회합니다.
curl https://api.frankfurter.dev/v1/1999-01-04- 기준 통화를 변경하고 대상 통화를 필터링합니다.
curl https://api.frankfurter.dev/v1/1999-01-04?base=USD&symbols=EUR- 참고: Frankfurter는 날짜를 UTC로 저장하므로, 다른 시간대에서는 예상과 다른 날짜가 조회될 수 있습니다. 오늘의 환율은 새 환율이 공표되면 바뀔 수 있습니다.
- 시계열 데이터
- 기간을 지정해 환율을 조회합니다.
curl https://api.frankfurter.dev/v1/2000-01-01..2000-12-31- 현재까지의 환율을 조회합니다.
curl https://api.frankfurter.dev/v1/2024-01-01..- 팁: 통화를 필터링하면 응답 크기가 줄고 성능이 좋아집니다.
curl https://api.frankfurter.dev/v1/2024-01-01..?symbols=USD- 이용 가능한 통화
- 지원하는 통화 기호와 전체 이름을 조회합니다.
curl https://api.frankfurter.dev/v1/currencies- 환전 계산
- 환율을 조회한 뒤 코드에서 환전 금액을 계산합니다.
function convert(from, to, amount) { fetch(`https://api.frankfurter.dev/v1/latest?base=${from}&symbols=${to}`) .then((resp) => resp.json()) .then((data) => { const convertedAmount = (amount * data.rates[to]).toFixed(2); alert(`${amount} ${from} = ${convertedAmount} ${to}`); }); } convert("EUR", "USD", 10);