1. 두 환율 요청하기
경로의 USD는 기준 통화이고 symbols의 EUR, GBP는 대상 통화입니다. 필요한 코드로 바꾸면 됩니다.
curl -fsS --max-time 10 "https://api.exchangerate.dev/v1/latest/USD?symbols=EUR,GBP"from urllib.request import Request, urlopenimport json# Identify your application explicitly when calling the API.request = Request("https://api.exchangerate.dev/v1/latest/USD?symbols=EUR,GBP", headers={"User-Agent": "exchangerate-docs/1.0"})with urlopen(request, timeout=10) as response: data = json.load(response)print(data["rates"]["EUR"])const response = await fetch("https://api.exchangerate.dev/v1/latest/USD?symbols=EUR,GBP", { signal: AbortSignal.timeout(10_000),});if (!response.ok) throw new Error(`HTTP ${response.status}`);const data = await response.json();console.log(data.rates.EUR);통합 가이드: Python · JavaScript / Node.js · Google Sheets · Excel · Go · Swift · Zapier
2. 응답 읽기
값은 변하지만 구조는 같습니다. rates.EUR를 읽고 source, market_session, data_updated_at도 환율과 함께 저장하세요.
json
{ "result": "success", "base": "USD", "source": "live", "sources": { "EUR": "live", "GBP": "live" }, "market_session": "open", "timestamp": "2026-06-15T12:00:00Z", "data_updated_at": "2026-06-15T12:00:00Z", "effective_at": { "EUR": "2026-06-15T12:00:00Z", "GBP": "2026-06-15T12:00:00Z" }, "rates": { "EUR": 0.86207, "GBP": 0.74627 }, "stale": { "EUR": false, "GBP": false }, "derived_symbols": [], "notice": "Indicative rates, not for settlement."}3. 계정 할당량이 필요할 때 키 추가하기
무료 키를 만든 뒤 Authorization: Bearer YOUR_KEY로 보냅니다. 키는 서버에 저장하고 공개 브라우저 코드에 넣지 마세요.
bash
curl "https://api.exchangerate.dev/v1/latest/USD?symbols=EUR,GBP" \ -H "Authorization: Bearer YOUR_KEY"