Get API Key

Welcome to the API key generation guide. This section will walk you through the process of generating an API key for our service. Please follow the instructions carefully to ensure a smooth experience.

How to Generate Your API Key:

After successfully registering, follow these steps to generate your API key:

  1. Sign up at OpenAPI Box by completing the registration process.
  2. Once registered, log in and go to the API Services section of your dashboard.
  3. Search for World's Currency Live Rates API in the available services.
  4. Select the API that corresponds to your service.
  5. Look for the Generate API Key option and click it.
  6. A confirmation modal will appear. Confirm your action to proceed.
  7. Once confirmed, you will see the API key generated for your account.
  8. Click the Show API Key button to reveal your API key.
  9. Click the Copy button next to the key to copy it to your clipboard.

World's Currency Live Rates API

Access real-time currency exchange rates for over 170 currencies worldwide. This API is ideal for financial applications, currency conversion, and real-time pricing updates.

Endpoints

POST /GET https://openapibox.com/api/currencyliveapi/YOUR-API-KEY/getCurrencyRates

Parameters
Field Name Description Required Example Values
currency the currency in which you want the currency rates Yes (Optional)
USD, AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, FOK, GBP, GEL, GGP, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IMP, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KID, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STN, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TVD, TWD, TZS, UAH, UGX, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XDR, XOF, XPF, YER, ZAR, ZMW, ZWL
Demo Code Examples
                                 
https://openapibox.com/api/currencyliveapi/YOUR-API-KEY/getCurrencyRates?currency=USD

                                 
<?php

$endpoint = 'https://openapibox.com/api/currencyliveapi/YOUR-API-KEY/getCurrencyRates'; // Endpoint for currency API

// Check if the 'currency' parameter is provided in the request
$currency = $_GET['currency'] ?? 'USD'; // Default to 'USD' if no currency is provided

// Optional parameters for the API request (only currency needed)
$params = [
    'currency' => $currency, // Only currency parameter (e.g., 'USD')
];

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => $endpoint,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => http_build_query($params), // Send the parameters as a POST request
]);

$response = curl_exec($curl);

if ($response === false) {
    echo 'cURL error: ' . curl_error($curl);
} else {
    // Assuming the API returns a JSON response with currency rates directly as a key-value pair
    $responseData = json_decode($response, true);

    // Check if the currency exists in the rates
    if (isset($responseData[$currency])) {
        echo 'Exchange rate for ' . $currency . ': ' . $responseData[$currency];
    } else {
        echo 'Error: Currency rate for ' . $currency . ' not found.';
    }
}

curl_close($curl);

?>

<?php


use GuzzleHttp\Client;

// Define the endpoint and the API key
$endpoint = 'https://openapibox.com/api/currencyliveapi/YOUR-API-KEY/getCurrencyRates'; // Endpoint for the currency API

// Initialize the Guzzle HTTP client
$client = new Client();

// Get the 'currency' parameter from the request or default to 'USD'
$currency = $_GET['currency'] ?? 'USD';

// Send the GET request with the currency parameter
try {
    $response = $client->post($endpoint, [
        'form_params' => [
            'currency' => $currency, // Only currency parameter (e.g., 'USD')
        ]
    ]);

    // Decode the JSON response to get the currency rates
    $responseData = json_decode($response->getBody(), true);

    // Check if the requested currency exists in the response
    if (isset($responseData[$currency])) {
        echo 'Exchange rate for ' . $currency . ': ' . $responseData[$currency];
    } else {
        echo 'Error: Currency rate for ' . $currency . ' not found.';
    }
} catch (\GuzzleHttp\Exception\RequestException $e) {
    // Handle any errors during the request
    echo 'Error: ' . $e->getMessage();
}

?>

// Function to get the currency rate using Fetch API
function getCurrencyRate(currency) {
    const endpoint = 'https://openapibox.com/api/currencyliveapi/YOUR-API-KEY/getCurrencyRates'; // Replace with your actual API endpoint

    // Make a GET request with the currency as a query parameter
    fetch(`${endpoint}?currency=${currency}`, {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json',
        },
    })
    .then(response => response.json()) // Parse the JSON response
    .then(data => {
        // Log the response data (currency rates)
        if (data && data.rates && data.rates[currency]) {
            console.log(`Exchange Rate for ${currency}: ${data.rates[currency]}`);
        } else {
            console.log(`Error: Currency rate for ${currency} not found.`);
        }
    })
    .catch(error => {
        // Log any errors (e.g., network issues)
        console.error('Error fetching the currency rate:', error);
    });
}

// Example usage: Get the exchange rate for USD
getCurrencyRate('USD');



import requests

# Function to get the currency rate using the Requests library
def get_currency_rate(currency):
    endpoint = 'https://openapibox.com/api/currencyliveapi/YOUR-API-KEY/getCurrencyRates'  # Replace with your actual API endpoint
    params = {'currency': currency}  # Pass currency as a parameter

    try:
        # Make a GET request to the API
        response = requests.get(endpoint, params=params)
        response.raise_for_status()  # Raise an exception for HTTP errors
        
        # Parse the JSON response
        data = response.json()

        # Check if the data contains the 'rates' and the requested currency
        if 'rates' in data and currency in data['rates']:
            print(f"Exchange Rate for {currency}: {data['rates'][currency]}")
        else:
            print(f"Error: Currency rate for {currency} not found.")
    
    except requests.exceptions.RequestException as e:
        # Catch any exceptions (e.g., network issues)
        print(f"Error fetching the currency rate: {e}")

# Example usage: Get the exchange rate for USD
get_currency_rate('USD')


package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"io/ioutil"
)

// Define a struct to hold the API response
type CurrencyResponse struct {
	Rates map[string]float64 `json:"rates"`
}

func getCurrencyRate(currency string) {
	// Replace with your actual API endpoint
	endpoint := "https://openapibox.com/api/currencyliveapi/YOUR-API-KEY/getCurrencyRates"  
	// Build the URL with query parameters
	url := fmt.Sprintf("%s?currency=%s", endpoint, currency)

	// Send GET request
	resp, err := http.Get(url)
	if err != nil {
		log.Fatalf("Error fetching the currency rate: %v", err)
	}
	defer resp.Body.Close()

	// Read the response body
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatalf("Error reading response body: %v", err)
	}

	// Unmarshal the JSON response into a struct
	var data CurrencyResponse
	err = json.Unmarshal(body, &data)
	if err != nil {
		log.Fatalf("Error unmarshaling JSON: %v", err)
	}

	// Check if the currency is present in the response rates
	if rate, exists := data.Rates[currency]; exists {
		fmt.Printf("Exchange Rate for %s: %f\n", currency, rate)
	} else {
		fmt.Printf("Error: Currency rate for %s not found.\n", currency)
	}
}

func main() {
	// Example usage: Get the exchange rate for USD
	getCurrencyRate("USD")
}



Example Responses


{
  "USD": 1,
  "AED": 3.67,
  "AFN": 70.31,
  "ALL": 94.2,
  "AMD": 396.44,
  "ANG": 1.79,
  "AOA": 920.8,
  "ARS": 1032.5,
  "AUD": 1.61,
  "AWG": 1.79,
  "AZN": 1.7,
  "BAM": 1.88,
  "BBD": 2,
  "BDT": 119.48,
  "BGN": 1.88,
  "BHD": 0.376,
  "BIF": 2938.6,
  "BMD": 1,
  "BND": 1.36,
  "BOB": 6.92,
  "BRL": 6.19,
  "BSD": 1,
  "BTN": 85.56,
  "BWP": 13.92,
  "BYN": 3.35,
  "BZD": 2,
  "CAD": 1.44,
  "CDF": 2844.69,
  "CHF": 0.904,
  "CLP": 993.12,
  "CNY": 7.31,
  "COP": 4400.57,
  "CRC": 506.9,
  "CUP": 24,
  "CVE": 105.9,
  "CZK": 24.2,
  "DJF": 177.72,
  "DKK": 7.17,
  "DOP": 60.83,
  "DZD": 135.39,
  "EGP": 50.85,
  "ERN": 15,
  "ETB": 125.7,
  "EUR": 0.96,
  "FJD": 2.31,
  "FKP": 0.796,
  "FOK": 7.17,
  "GBP": 0.796,
  "GEL": 2.81,
  "GGP": 0.796,
  "GHS": 15.01,
  "GIP": 0.796,
  "GMD": 72.5,
  "GNF": 8607.6,
  "GTQ": 7.7,
  "GYD": 209.16,
  "HKD": 7.76,
  "HNL": 25.39,
  "HRK": 7.24,
  "HTG": 130.76,
  "HUF": 394.83,
  "IDR": 16170.22,
  "ILS": 3.66,
  "IMP": 0.796,
  "INR": 85.56,
  "IQD": 1311.04,
  "IRR": 42091.89,
  "ISK": 138.11,
  "JEP": 0.796,
  "JMD": 155.66,
  "JOD": 0.709,
  "JPY": 157.18,
  "KES": 129.18,
  "KGS": 87,
  "KHR": 4053.37,
  "KID": 1.61,
  "KMF": 472.5,
  "KRW": 1471.74,
  "KWD": 0.308,
  "KYD": 0.833,
  "KZT": 523.53,
  "LAK": 21924.41,
  "LBP": 89500,
  "LKR": 292.49,
  "LRD": 182.36,
  "LSL": 18.79,
  "LYD": 4.92,
  "MAD": 10.11,
  "MDL": 18.4,
  "MGA": 4670.65,
  "MKD": 58.95,
  "MMK": 2096.18,
  "MNT": 3423.26,
  "MOP": 8,
  "MRU": 40.09,
  "MUR": 46.84,
  "MVR": 15.44,
  "MWK": 1742.19,
  "MXN": 20.56,
  "MYR": 4.47,
  "MZN": 63.98,
  "NAD": 18.79,
  "NGN": 1538.18,
  "NIO": 36.78,
  "NOK": 11.34,
  "NPR": 136.9,
  "NZD": 1.77,
  "OMR": 0.384,
  "PAB": 1,
  "PEN": 3.76,
  "PGK": 4.04,
  "PHP": 57.95,
  "PKR": 278.28,
  "PLN": 4.1,
  "PYG": 7737.79,
  "QAR": 3.64,
  "RON": 4.77,
  "RSD": 112.06,
  "RUB": 108.52,
  "RWF": 1411.81,
  "SAR": 3.75,
  "SBD": 8.52,
  "SCR": 14.12,
  "SDG": 449.56,
  "SEK": 11.02,
  "SGD": 1.36,
  "SHP": 0.796,
  "SLE": 22.88,
  "SLL": 22879.65,
  "SOS": 571.61,
  "SRD": 35.15,
  "SSP": 3901.33,
  "STN": 23.53,
  "SYP": 12909.27,
  "SZL": 18.79,
  "THB": 34.15,
  "TJS": 10.92,
  "TMT": 3.5,
  "TND": 3.18,
  "TOP": 2.38,
  "TRY": 35.33,
  "TTD": 6.75,
  "TVD": 1.61,
  "TWD": 32.79,
  "TZS": 2407.63,
  "UAH": 42.04,
  "UGX": 3671.49,
  "UYU": 43.96,
  "UZS": 12869.02,
  "VES": 52.03,
  "VND": 25462.24,
  "VUV": 118.54,
  "WST": 2.8,
  "XAF": 630,
  "XCD": 2.7,
  "XDR": 0.765,
  "XOF": 630,
  "XPF": 114.61,
  "YER": 249.53,
  "ZAR": 18.79,
  "ZMW": 27.84,
  "ZWL": 25.79
}



{
  "code": 1002,
  "message": "Invalid API Key"
}

Response Details

Field Name Values
Country Code BD
Postal Code 1000
Place Name Dhaka GPO
Admin Name 1 Dhaka Division
Admin Code 1 81
Admin Name 2 Dhaka
Admin Code 2 3026
Admin Name 3 Palton
Admin Code 3 None
Latitude 23.729
Longitude 90.4112
Accuracy None
Coordinates Latitude: 23.729
Longitude: 90.4112