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

Historical Rates

The curexapi API provides accurate historical exchange rate data for every past day all the way back to the year of 1999.

Historical rates may be accessed by simply attaching the date parameter with a valid date (Format: YYYY-MM-DD) to the API's historical endpoint.

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

Request Parameters

Name
Type
Description

access_key

string

Your access key

date

string

Date format: YYYY-MM-DD

source

string

Source currency code (optional) (default:USD)

currencies

string

Target currency codes (optional)

Sample Requests

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

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://api.curexapi.com/historical?access_key=YOUR_ACCESS_KEY&date=2023-01-01&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/historical?access_key=YOUR_ACCESS_KEY&date=2023-01-01&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/historical?access_key=YOUR_ACCESS_KEY&date=2023-01-01&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
    }
}
PreviousReal-time RatesNextConvert

Last updated 12 months ago