Getting Started
The Finexly API offers real-time and historical exchange rates for over 170 currencies. Getting started is simple:
- Create a free account
- Retrieve your API access key from the dashboard
- Submit your initial API request
Base URL
https://api.finexly.com/v1/
Authentication
All API requests require authentication using a Bearer token. Include your API key in the Authorization header:
Option 1: Authorization Header (Recommended)
Authorization Header (Mandatory)
Authorization: Bearer YOUR_API_KEY
Option 2: Query Parameter
Pass your API key as a query parameter:
GET https://api.finexly.com/v1/rate?from=USD&to=EUR&api_key=YOUR_API_KEY
⚠ Security Note: API keys in URLs may be logged in server access logs and can leak via HTTP Referrer headers. For production use, we recommend the Authorization header method. The query parameter is provided as a convenience for quick testing and simple integrations.
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",
"EUR",
"GBP",
"USD"
]
/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
// Response
{
"USD_EUR": {
"rate": 0.9215
},
"USD_GBP": {
"rate": 0.7892
}
}
/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 Samples
# 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")
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. |