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

Convert

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

Request Parameters

Name
Type
Description

access_key

string

Your access key

date

string

Date format: YYYY-MM-DD (optional)

from

string

Source currency code

to

string

Target currency codes

amount

float

Amount

Sample Requests

curl --location 'https://api.curexapi.com/convert?access_key=YOUR_ACCESS_KEY&date=2023-01-01&from=USD&to=EUR%2CGBP&amount=100'
cconst axios = require('axios');

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://api.curexapi.com/convert?access_key=YOUR_ACCESS_KEY&date=2023-01-01&from=USD&to=EUR%2CGBP&amount=100',
  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/convert?access_key=YOUR_ACCESS_KEY&date=2023-01-01&from=USD&to=EUR%2CGBP&amount=100',
  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/convert?access_key=YOUR_ACCESS_KEY&date=2023-01-01&from=USD&to=EUR%2CGBP&amount=100"

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

print(response.text)

Sample Response

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

PreviousHistorical RatesNextTimeframe

Last updated 12 months ago