Forex.APISED

Available Currencies

This HTTP GET request retrieves a list of available currencies. Use the 'search' query parameter to filter the results or leave it blank to return all supported currencies

Query Parameter

Description
search
Search avaliable currencies that are supported using codes or names

Example Request

  • javaScript
  • Node.js
  • PHP
  • Axios
  • fetch
import axios from 'axios';

const options = {
    method: 'GET',
    url: 'https://forex-apised1.p.rapidapi.com/available',
    params: {
        search: 'united'
    },
    headers: {
        'X-RapidAPI-Key': '<YourApiKey>',
        'X-RapidAPI-Host': 'forex-apised1.p.rapidapi.com'
    }
};

try {
    const response = await axios.request(options);
    console.log(response.data);
} catch (error) {
    console.error(error);
}

Example Response

{
    "success": true,
    "errors": [],
    "search": "united",
    "currencies": [
        {
            "currency_code": "USD",
            "currency_name": "United States Dollar"
        },
        {
            "currency_code": "AED",
            "currency_name": "United Arab Emirates Dirham"
        },
        {
            "currency_code": "GBP",
            "currency_name": "United Kingdom Pound"
        }
    ]
}
This endpoint makes an HTTP GET request to convert an amount from one currency to another using the forex API. The request URL includes parameters for the source currency (from), target currency (to), and the amount to be converted.

Query Parameter

Description
from
From currency input [currencies][required]
to
To currency input [currencies][required]
amount
Amount to convert input[required]

Example Request

  • javaScript
  • Node.js
  • PHP
  • Axios
  • fetch
import axios from 'axios';

const options = {
    method: 'GET',
    url: 'https://forex-apised1.p.rapidapi.com/convert',
    params: {
        from: 'USD',
        to: 'GBP',
        amount: '1337'
    },
    headers: {
        'X-RapidAPI-Key': '<YourApiKey>',
        'X-RapidAPI-Host': 'forex-apised1.p.rapidapi.com'
    }
};

try {
    const response = await axios.request(options);
    console.log(response.data);
} catch (error) {
    console.error(error);
}

Example Response

{
    "success": true,
    "errors": [],
    "base_currency_code": "USD",
    "base_currency_name": "United States Dollar",
    "to": "GBP",
    "amount": 1337,
    "rates": {
        "GBP": {
            "currency_name": "United Kingdom Pound",
            "currency_code": "GBP",
            "rate": 0.7880842,
            "converted_amount": 1053.6685754
        }
    }
}

Multi Convert

This endpoint performs an HTTP GET request to retrieve the converted amounts for the specified currencies based on a given amount in a base currency. The request should include the base currency code ("from"), target currency codes ("to"), and the amount to be converted.

Query Parameter

Description
from
From currency input [currencies][required]
to
To currency input [multi-choice-currencies][required]
amount
Amount to convert input[required]

Example Request

  • javaScript
  • Node.js
  • PHP
  • Axios
  • fetch
import axios from 'axios';

const options = {
    method: 'GET',
    url: 'https://forex-apised1.p.rapidapi.com/multi-convert',
    params: {
        from: 'EUR',
        to: 'GBP,USD,EUR',
        amount: '1337'
    },
    headers: {
        'X-RapidAPI-Key': '<YourApiKey>',
        'X-RapidAPI-Host': 'forex-apised1.p.rapidapi.com'
    }
};

try {
    const response = await axios.request(options);
    console.log(response.data);
} catch (error) {
    console.error(error);
}

Example Response

{
    "success": true,
    "errors": [],
    "base_currency_code": "EUR",
    "base_currency_name": "Euro Member Countries",
    "to": "GBP,USD,EUR",
    "amount": 1337,
    "rates": {
        "GBP": {
            "currency_name": "United Kingdom Pound",
            "currency_code": "GBP",
            "rate": 0.859603184991274,
            "converted_amount": 1149.2894583333334
        },
        "USD": {
            "currency_name": "United States Dollar",
            "currency_code": "USD",
            "rate": 1.0907504363001745,
            "converted_amount": 1458.3333333333335
        },

Live Rates

This endpoint retrieves the live forex rates for the specified base currency and target currency codes. Amounts in base_currency can be multiplied by the rates in the response to achieve the converted amounts values

Query Parameter

Description
base_currency_code
From currency input [currencies][required]
currency_codes
To currency input [multi-choice-currencies][required]

Example Request

  • javaScript
  • Node.js
  • PHP
  • Axios
  • fetch
import axios from 'axios';

const options = {
    method: 'GET',
    url: 'https://forex-apised1.p.rapidapi.com/live-rates',
    params: {
        base_currency_code: 'USD',
        currency_codes: 'GBP,USD,EUR,KWD'
    },
    headers: {
        'X-RapidAPI-Key': '<YourApiKey>',
        'X-RapidAPI-Host': 'forex-apised1.p.rapidapi.com'
    }
};

try {
    const response = await axios.request(options);
    console.log(response.data);
} catch (error) {
    console.error(error);
}

Example Response

{
    "success": true,
    "errors": [],
    "base_currency_code": "USD",
    "base_currency_name": "United States Dollar",
    "currency_codes": "GBP,USD,EUR,KWD",
    "rates": {
        "GBP": {
            "currency_name": "United Kingdom Pound",
            "currency_code": "GBP",
            "rate": 0.7880842
        },
        "USD": {
            "currency_name": "United States Dollar",
            "currency_code": "USD",
            "rate": 1
        },
        "EUR": {
            "currency_name": "Euro Member Countries",
            "currency_code": "EUR",
            "rate": 0.9168