시작하기
Finexly API는 170개 이상의 통화에 대한 실시간 및 과거 환율을 제공합니다. 시작하기는 간단합니다:
- 무료 계정 등록
- 대시보드에서 API 액세스 키 받기
- 첫 번째 API 요청 만들기
기본 URL
https://api.finexly.com/v1/
인증
모든 API 요청은 Bearer 토큰을 통한 인증이 필요합니다. Authorization 헤더에 API 키를 포함하세요:
옵션 1: 인증 헤더 (권장)
인증 헤더 (필수)
Authorization: Bearer YOUR_API_KEY
옵션 2: 쿼리 매개변수
API 키를 쿼리 매개변수로 전달하세요:
GET https://api.finexly.com/v1/rate?from=USD&to=EUR&api_key=YOUR_API_KEY
⚠ 보안 참고: URL에 포함된 API 키는 서버 접근 로그에 기록될 수 있으며 HTTP 참조자 헤더를 통해 유출될 수 있습니다. 프로덕션 환경에서는 Authorization 헤더 방식을 권장합니다. 쿼리 매개변수는 빠른 테스트와 간단한 통합을 위한 편의 기능으로 제공됩니다.
속도 제한: 현재 사용량을 확인하려면 응답 헤더를 확인하세요.
X-RateLimit-Limit,
X-RateLimit-Used,
X-RateLimit-Units
API 엔드포인트
/v1/currencies
지원되는 모든 통화 코드 목록을 가져옵니다.
매개변수
| 이름 | 유형 | 필수 | 설명 |
|---|
예시
GET https://api.finexly.com/v1/currencies
// 응답
[
"AED",
"ANG",
"AUD",
"EUR",
"GBP",
"USD"
]
/v1/rate
특정 통화 쌍의 환율을 가져옵니다.
매개변수
| 이름 | 유형 | 필수 | 설명 |
|---|---|---|---|
| from | string | 예 | 기준 통화 코드 (대문자) |
| to | string | 예 | 시세 통화 코드 (대문자) |
예시
GET https://api.finexly.com/v1/rate?from=USD&to=EUR
// 응답
{
"pair": "USD_EUR",
"rate": 0.9215
}
/v1/convert
단일 요청으로 여러 통화 쌍의 환율을 가져옵니다.
매개변수
| 이름 | 유형 | 필수 | 설명 |
|---|---|---|---|
| q | string | 예 | BASE_QUOTE 형식의 쉼표로 구분된 쌍 |
예시
GET https://api.finexly.com/v1/convert?q=USD_EUR,USD_GBP
// 응답
{
"USD_EUR": {
"rate": 0.9215
},
"USD_GBP": {
"rate": 0.7892
}
}
/v1/convert-amount
특정 금액을 한 통화에서 다른 통화로 변환합니다.
매개변수
| 이름 | 유형 | 필수 | 설명 |
|---|---|---|---|
| from | string | 예 | 원본 통화 코드 (대문자) |
| to | string | 예 | 대상 통화 코드 (대문자) |
| amount | number | 예 | 변환할 금액 |
예시
GET https://api.finexly.com/v1/convert-amount?from=USD&to=EUR&amount=100
// 응답
{
"pair": "USD_EUR",
"rate": 0.9215,
"amount": 100,
"result": 92.15
}
코드 예제
# Using Authorization header (recommended)
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.finexly.com/v1/rate?from=USD&to=EUR"
# Using query parameter
curl "https://api.finexly.com/v1/rate?from=USD&to=EUR&api_key=YOUR_API_KEY"
# Get multiple rates
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.finexly.com/v1/convert?q=USD_EUR,USD_GBP"
# Convert amount
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.finexly.com/v1/convert-amount?from=USD&to=EUR&amount=100"
<?php
$apiKey = 'YOUR_API_KEY';
// Using cURL
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.finexly.com/v1/rate?from=USD&to=EUR',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
],
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "USD/EUR Rate: " . $data['rate'];
const apiKey = 'YOUR_API_KEY';
// Get single rate
const response = await fetch('https://api.finexly.com/v1/rate?from=USD&to=EUR', {
headers: {
'Authorization': `Bearer ${apiKey}`
}
});
const data = await response.json();
console.log(`USD/EUR Rate: ${data.rate}`);
// Convert amount
const convertResponse = await fetch(
'https://api.finexly.com/v1/convert-amount?from=USD&to=EUR&amount=100',
{ headers: { 'Authorization': `Bearer ${apiKey}` } }
);
const result = await convertResponse.json();
console.log(`100 USD = ${result.result} EUR`);
import requests
api_key = 'YOUR_API_KEY'
headers = {'Authorization': f'Bearer {api_key}'}
# Get single rate
response = requests.get(
'https://api.finexly.com/v1/rate',
params={'from': 'USD', 'to': 'EUR'},
headers=headers
)
data = response.json()
print(f"USD/EUR Rate: {data['rate']}")
# Convert amount
response = requests.get(
'https://api.finexly.com/v1/convert-amount',
params={'from': 'USD', 'to': 'EUR', 'amount': 100},
headers=headers
)
result = response.json()
print(f"100 USD = {result['result']} EUR")
오류 코드
| 코드 | 유형 | 설명 |
|---|---|---|
| 400 | BAD_REQUEST | 잘못된 요청 매개변수 또는 필수 필드 누락. |
| 401 | UNAUTHORIZED | API 토큰이 없거나 유효하지 않습니다. |
| 403 | FORBIDDEN | 접근이 거부되었습니다. 계정이 비활성화되었을 수 있습니다. |
| 413 | PAYLOAD_TOO_LARGE | 요청 페이로드가 최대 허용 크기를 초과했습니다. |
| 429 | RATE_LIMIT_EXCEEDED | 속도 제한을 초과했습니다. X-RateLimit 헤더를 확인하세요. |
| 500 | INTERNAL_ERROR | 내부 서버 오류가 발생했습니다. 다시 시도해 주세요. |
Tutorials & Guides
Learn how to integrate Finexly with your favorite programming languages and frameworks.
JavaScript Integration Tutorial
Step-by-step guide to integrating Finexly API with JavaScript and Node.js.
Python Integration Tutorial
Complete guide to using Finexly API with Python and popular libraries.
Developer Guide
Comprehensive guide to free currency API features and best practices.
Historical Rates Guide
Learn how to retrieve and work with historical exchange rate data.