Complete guide to integrate real-time currency exchange rates into your applications
The RSK World Currency Exchange API provides real-time and historical exchange rate data for over 160 currencies worldwide.
https://your-domain.com/currency-exchange-api/
Start using the API in just a few simple steps:
fetch('https://your-domain.com/currency-exchange-api/api.php?endpoint=latest&base=USD')
.then(response => response.json())
.then(data => console.log(data));
Get the latest exchange rates for a specific base currency.
| Parameter | Type | Required | Description |
|---|---|---|---|
base |
String | No | Base currency code (default: USD) |
pretty |
Boolean | No | Return pretty-printed JSON (default: false) |
{
"status": "success",
"message": "Latest rates retrieved successfully",
"timestamp": 1234567890,
"api_version": "1.0.0",
"provider": "RSK World Currency Exchange API",
"website": "https://rskworld.in",
"data": {
"base": "USD",
"timestamp": 1234567890,
"rates": {
"EUR": 0.85,
"GBP": 0.73,
"JPY": 110.25,
"AUD": 1.35
}
}
}
Convert a specific amount from one currency to another.
| Parameter | Type | Required | Description |
|---|---|---|---|
from |
String | Yes | Source currency code |
to |
String | Yes | Target currency code |
amount |
Number | Yes | Amount to convert |
{
"status": "success",
"message": "Currency converted successfully",
"timestamp": 1234567890,
"api_version": "1.0.0",
"provider": "RSK World Currency Exchange API",
"website": "https://rskworld.in",
"data": {
"from": "USD",
"to": "EUR",
"amount": 100,
"converted_amount": 85.50,
"rate": 0.855
}
}
Get exchange rates for a specific historical date.
| Parameter | Type | Required | Description |
|---|---|---|---|
date |
String | Yes | Date in YYYY-MM-DD format |
base |
String | No | Base currency code (default: USD) |
Get a list of all supported currencies with their names and symbols.
{
"status": "success",
"message": "Supported currencies retrieved",
"timestamp": 1234567890,
"api_version": "1.0.0",
"provider": "RSK World Currency Exchange API",
"website": "https://rskworld.in",
"data": {
"USD": {
"name": "United States Dollar",
"symbol": "$"
},
"EUR": {
"name": "Euro",
"symbol": "€"
}
}
}
All API responses follow a consistent JSON format:
{
"status": "success|error",
"message": "Human-readable message",
"timestamp": 1234567890,
"api_version": "1.0.0",
"provider": "RSK World Currency Exchange API",
"website": "https://rskworld.in",
"data": { ... }
}
| Field | Type | Description |
|---|---|---|
status |
String | Response status: "success" or "error" |
message |
String | Human-readable status message |
timestamp |
Number | Unix timestamp of the response |
data |
Object | The actual response data |
The API returns appropriate HTTP status codes and error messages for different scenarios:
| Status Code | Description |
|---|---|
200 |
Request successful |
400 |
Bad request - invalid parameters |
404 |
Endpoint not found |
405 |
Method not allowed |
500 |
Internal server error |
{
"status": "error",
"message": "Invalid date format. Use YYYY-MM-DD",
"timestamp": 1234567890,
"api_version": "1.0.0",
"provider": "RSK World Currency Exchange API",
"website": "https://rskworld.in"
}
// Get latest rates
async function getLatestRates(base = 'USD') {
try {
const response = await fetch(
`./api.php?endpoint=latest&base=${base}&pretty=1`
);
const data = await response.json();
if (data.status === 'success') {
console.log('Rates:', data.data.rates);
return data.data.rates;
} else {
throw new Error(data.message);
}
} catch (error) {
console.error('Error:', error);
}
}
// Convert currency
async function convertCurrency(from, to, amount) {
try {
const response = await fetch(
`./api.php?endpoint=convert&from=${from}&to=${to}&amount=${amount}&pretty=1`
);
const data = await response.json();
if (data.status === 'success') {
console.log(`${amount} ${from} = ${data.data.converted_amount} ${to}`);
return data.data;
} else {
throw new Error(data.message);
}
} catch (error) {
console.error('Error:', error);
}
}
getMessage();
}
?>
import requests
import json
# Get latest rates
def get_latest_rates(base='USD'):
url = f"./api.php?endpoint=latest&base={base}&pretty=1"
response = requests.get(url)
data = response.json()
if data['status'] == 'success':
return data['data']['rates']
else:
raise Exception(data['message'])
# Convert currency
def convert_currency(from_currency, to_currency, amount):
url = f"./api.php?endpoint=convert&from={from_currency}&to={to_currency}&amount={amount}&pretty=1"
response = requests.get(url)
data = response.json()
if data['status'] == 'success':
return data['data']
else:
raise Exception(data['message'])
# Usage
try:
rates = get_latest_rates('USD')
print(f"EUR rate: {rates['EUR']}")
conversion = convert_currency('USD', 'EUR', 100)
print(f"100 USD = {conversion['converted_amount']} EUR")
except Exception as e:
print(f"Error: {e}")