Getting Started
The Finexly API provides real-time and historical exchange rates for 168+ currencies. Getting started is easy:
- Sign up for a free account
- Get your API access key from the dashboard
- Make your first API request
Base URL
https://api.finexly.com/v1/
Authentication
All API requests require authentication via Bearer token. Include your API key in the Authorization header:
Authorization Header (Required)
Authorization: Bearer YOUR_API_KEY
Rate Limiting: Check response headers for your current usage:
X-RateLimit-Limit,
X-RateLimit-Used,
X-RateLimit-Units
API Endpoints
/v1/currencies
Get a list of all supported currency codes.
Parameters
| Name | Type | Required | Description |
|---|
Example
GET https://api.finexly.com/v1/currencies
// Response
[
"AED",
"ANG",
"AUD",
"BTC",
"EUR",
"GBP",
"USD",
"USDT"
]
/v1/rate
Get the exchange rate for a specific currency pair.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| from | string | Yes | Base currency code (uppercase) |
| to | string | Yes | Quote currency code (uppercase) |
Example
GET https://api.finexly.com/v1/rate?from=USD&to=EUR
// Response
{
"pair": "USD_EUR",
"rate": 0.9215
}
/v1/convert
Get exchange rates for multiple currency pairs in a single request.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Comma-separated pairs in BASE_QUOTE format |
Example
GET https://api.finexly.com/v1/convert?q=USD_EUR,USD_GBP,BTC_USD
// Response
{
"USD_EUR": {
"rate": 0.9215
},
"USD_GBP": {
"rate": 0.7892
},
"BTC_USD": {
"rate": 42500
}
}
/v1/convert-amount
Convert a specific amount from one currency to another.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| from | string | Yes | Source currency code (uppercase) |
| to | string | Yes | Target currency code (uppercase) |
| amount | number | Yes | Amount to convert |
Example
GET https://api.finexly.com/v1/convert-amount?from=USD&to=EUR&amount=100
// Response
{
"pair": "USD_EUR",
"rate": 0.9215,
"amount": 100,
"result": 92.15
}
Code Examples
# Get single rate
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.finexly.com/v1/rate?from=USD&to=EUR"
# Get multiple rates
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.finexly.com/v1/convert?q=USD_EUR,USD_GBP,BTC_USD"
# 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")
Error Codes
| Code | Type | Description |
|---|---|---|
| 400 | BAD_REQUEST | Invalid request parameters or missing required fields. |
| 401 | UNAUTHORIZED | Missing or invalid API token. |
| 403 | FORBIDDEN | Access denied. Your account may be inactive. |
| 413 | PAYLOAD_TOO_LARGE | Request payload exceeds maximum allowed size. |
| 429 | RATE_LIMIT_EXCEEDED | You have exceeded your rate limit. Check X-RateLimit headers. |
| 500 | INTERNAL_ERROR | An internal server error occurred. Please try again. |