Exchange rate

The Currency Exchange Rates API returns real-time exchange rates for selected currency pairs, providing accurate values in a concise JSON response
2ms

About

The Currency Exchange Rates API provides real-time access to accurate currency exchange rates from major global financial sources. This API supports multiple currency pairs, offering up-to-date rates refreshed every minute. Users receive a structured JSON response containing the requested currency values, timestamps, and additional details necessary for precise financial calculations and analysis.
by GLOBUS.studio

Endpoint

				
					/**
 * Currency Exchange Rates API
 * GET https://api.globus.studio/v2/currencies?base=USD&format=json
 * Response: [{ currencyCodeA, currencyCodeB, rateBuy, rateSell }, ...]
 */

async function fetchRates(base = 'UAH') {
    const url = new URL('https://api.globus.studio/v2/currencies');
    url.searchParams.set('base', base);
    url.searchParams.set('format', 'json');

    const res = await fetch(url);
    return res.json();
}

// USD-based rates
fetchRates('USD').then(rates => rates.forEach(r =>
    console.log(`${r.currencyCodeA}/${r.currencyCodeB}: buy ${r.rateBuy}, sell ${r.rateSell}`)
));

// EUR-based rates
fetchRates('EUR').then(rates => console.log(rates));