v1.0

CoreNexis Currency Converter API

Fast, reliable currency conversion API with support for 51+ currencies and up-to-date exchange rates.

51+ Currencies
Daily Rate Updates
Fast Response
Reliable Data
Simple Integration
Public API

This API is available for public use without authentication. For better response times and enterprise applications, please contact our team for premium API access.

CoreNexis Currency Converter API

The CoreNexis Currency Converter API provides an easy way to convert between 51+ currencies with up-to-date exchange rates. This RESTful API is designed to be simple to use and integrate into any application.

Features

  • Support for 51+ currencies including major and minor world currencies
  • Daily updated exchange rates from reliable financial data sources
  • Fast response times for quick integration into your applications
  • Simple GET requests with clear parameters and JSON responses
  • Free public access without any authentication required
  • Historical rate data included in every response

Base URL

https://api.corenexis.com/convert-currency/

Endpoint

The API consists of a single endpoint for currency conversion:

GET https://api.corenexis.com/convert-currency/

This endpoint accepts query parameters to specify the currencies and amount to convert. The response contains the converted amount, exchange rates used, and the date of the rates.

Example Request

Example URL
https://api.corenexis.com/convert-currency/?from=EUR&to=USD&amount=999

Request Parameters

The API accepts the following query parameters:

Parameter Type Description
from Required String The source currency code (3-letter ISO code, e.g., USD, EUR, GBP)
to Required String The target currency code (3-letter ISO code, e.g., USD, EUR, GBP)
amount Required Number The amount to convert (must be a positive number)

Response Format

The API returns data in JSON format. A successful response will include the following properties:

Success Response
{
    "from": "EUR",
    "to": "USD",
    "amount": 999,
    "converted_amount": 1074.19,
    "rate_used": {
        "EUR": 0.93,
        "USD": 1
    },
    "ratetime": "2025-05-03 15:04:04"
}

Response Parameters

Parameter Type Description
from String The source currency code used for conversion
to String The target currency code used for conversion
amount Number The original amount that was converted
converted_amount Number The converted amount in the target currency
rate_used Object The exchange rates used for the conversion, relative to USD (USD is always 1)
ratetime String The date when the exchange rates were last updated (YYYY-MM-DD format)

Supported Currencies

The API supports the following 51 currencies. You can use any of these currency codes in your requests:

USD
EUR
JPY
GBP
AUD
CAD
CHF
CNY
HKD
NZD
INR
RUB
BRL
ZAR
SGD
KRW
MXN
SEK
NOK
DKK
TWD
TRY
THB
PLN
IDR
HUF
CZK
ILS
AED
SAR
MYR
PHP
CLP
PKR
COP
QAR
BGN
VND
EGP
KWD
ARS
NGN
RON
MAD
LKR
BDT
UAH
PEN
IQD
DZD
KES

Examples

Here are examples of how to use the API with various programming languages:

cURL

cURL Example
curl -X GET "https://api.corenexis.com/convert-currency/?from=EUR&to=USD&amount=999"

JavaScript

JavaScript Example
// Using fetch API
async function convertCurrency(fromCurrency, toCurrency, amount) {
  try {
    const response = await fetch(`https://api.corenexis.com/convert-currency/?from=${fromCurrency}&to=${toCurrency}&amount=${amount}`);
    
    if (!response.ok) {
      throw new Error(`HTTP error! Status: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error converting currency:', error);
    throw error;
  }
}

// Example usage
convertCurrency('EUR', 'USD', 999)
  .then(data => {
    console.log(`${data.amount} ${data.from} = ${data.converted_amount} ${data.to}`);
    console.log(`Exchange rate: 1 USD = ${data.rate_used[data.from]} ${data.from}`);
    console.log(`Rate date: ${data.ratetime}`);
  })
  .catch(error => {
    console.error('Conversion failed:', error);
  });

Python

Python Example
import requests

def convert_currency(from_currency, to_currency, amount):
    """
    Convert currency using CoreNexis Currency Converter API
    
    Args:
        from_currency (str): Source currency code (e.g., 'USD', 'EUR')
        to_currency (str): Target currency code (e.g., 'USD', 'EUR')
        amount (float): Amount to convert
        
    Returns:
        dict: API response with conversion details
    """
    url = "https://api.corenexis.com/convert-currency/"
    
    # Set up the query parameters
    params = {
        "from": from_currency,
        "to": to_currency,
        "amount": amount
    }
    
    # Make the API request
    response = requests.get(url, params=params)
    
    # Check if the request was successful
    if response.status_code == 200:
        return response.json()
    else:
        raise Exception(f"API request failed with status code: {response.status_code}")

# Example usage
try:
    result = convert_currency("EUR", "USD", 999)
    print(f"{result['amount']} {result['from']} = {result['converted_amount']} {result['to']}")
    print(f"Exchange rate: 1 USD = {result['rate_used'][result['from']]} {result['from']}")
    print(f"Rate date: {result['ratetime']}")
except Exception as e:
    print(f"Error: {e}")

PHP

PHP Example
<?php
/**
 * Convert currency using CoreNexis Currency Converter API
 *
 * @param string $fromCurrency Source currency code (e.g., 'USD', 'EUR')
 * @param string $toCurrency Target currency code (e.g., 'USD', 'EUR')
 * @param float $amount Amount to convert
 * @return array|null API response with conversion details or null on error
 */
function convertCurrency($fromCurrency, $toCurrency, $amount) {
    $url = "https://api.corenexis.com/convert-currency/";
    
    // Build the query string
    $queryString = http_build_query([
        'from' => $fromCurrency,
        'to' => $toCurrency,
        'amount' => $amount
    ]);
    
    // Set up cURL
    $ch = curl_init($url . '?' . $queryString);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    // Execute the request
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    
    // Check for errors
    if (curl_errno($ch)) {
        echo 'cURL Error: ' . curl_error($ch);
        return null;
    }
    
    // Close cURL connection
    curl_close($ch);
    
    // Process the response
    if ($httpCode == 200) {
        return json_decode($response, true);
    } else {
        echo "API request failed with status code: $httpCode";
        return null;
    }
}

// Example usage
$result = convertCurrency('EUR', 'USD', 999);

if ($result) {
    echo "{$result['amount']} {$result['from']} = {$result['converted_amount']} {$result['to']}\n";
    echo "Exchange rate: 1 USD = {$result['rate_used'][$result['from']]} {$result['from']}\n";
    echo "Rate date: {$result['ratetime']}\n";
} else {
    echo "Conversion failed.\n";
}

Error Handling

The API uses standard HTTP status codes to indicate the success or failure of a request. Here are the common error responses you might encounter:

Status Code Description Example Response
400 Bad Request - Missing required parameters {"error": "Missing required parameter: amount"}
400 Bad Request - Invalid currency code {"error": "Invalid currency code: XYZ"}
400 Bad Request - Invalid amount {"error": "Amount must be a positive number"}
500 Internal Server Error - Something went wrong on our end {"error": "Internal server error"}

Error Handling Best Practices

Here are some recommendations for handling errors in your application:

Always check the status code of the API response
Implement proper error handling and display meaningful error messages to users
Validate input parameters before sending the request
Consider implementing caching for frequent currency conversions

Contact & Support

If you need help with our API or want to upgrade to a premium plan, we're here to help.

Getting Help

Email Support: [email protected]
General Inquiries: Contact Page

Premium API Access

For better response times and enterprise applications requiring SLA guarantees, please contact our team to discuss your needs and get premium API access.