CurexAPI Documentation
  • CurexAPI Overview
  • Supported Currencies
  • API Endpoints
  • API Error Codes
  • API Reference
    • Real-time Rates
    • Historical Rates
    • Convert
    • Timeframe
    • Change
Powered by GitBook
On this page
  1. API Reference

Real-time Rates

Both free and paid users may access real-time exchange rates using the currencylayer API's live endpoint.

Optionally, it is possible to define an additional source currency and specific output currencies using the currencies parameter. Both of these options will be discussed in detail throughout this documentation.

GET https://api.curexapi.com/live

Request Parameters

Name
Type
Description

access_key

string

Your access key

source

string

Source currency code (optional) (default:USD)

currencies

string

Target currency codes (optional)

Sample Requests

curl --location 'https://api.curexapi.com/live?access_key=YOUR_ACCESS_KEY&source=USD&currencies=EUR%2CGBP'
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://api.curexapi.com/live?access_key=YOUR_ACCESS_KEY&source=USD&currencies=EUR,GBP',
  headers: { }
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.curexapi.com/live?access_key=YOUR_ACCESS_KEY&source=USD&currencies=EUR%2CGBP',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.curexapi.com/live?access_key=YOUR_ACCESS_KEY&source=USD&currencies=EUR,GBP"

response = requests.request("GET", url)

print(response.text)

Sample Response

{
    "success": true,
    "timestamp": 1672531200,
    "source": "USD",
    "date": "2023-01-01",
    "rates": {
        "EUR": 0.932,
        "GBP": 0.827
    }
}

PreviousAPI Error CodesNextHistorical Rates

Last updated 12 months ago