Exchange Rates API Documentation
Access real-time exchange rates for currencies & crypto. This API provides accurate, up-to-date rates for integrating into your financial applications.
Below are the endpoints for accessing exchange rates. Learn how to integrate the API into your application.
Authorization:
- privateId *Specify privateId for site
(e.g., "Bearer example^com-SomeIdString").
Query Parameters:
- show Specify which rates to show
(e.g., "all"|"rates"|"crypto"). - list Comma-separated list of currency codes
(e.g., "USD,INR,BTC").
Route Parameters:
- :region *Please check location table here
(e.g., "WEST_3|ARAB_1|EAST_3|NORD_6").
Response based on params:
{ "success": true, "data": { "rates": { "USD": 1, "INR": 83.540592, "JPY": 143.662125, "BTC": 0.000015737383 }, "crypto": { "BTC": 63478.467340116214, "DOGE": 0.012578131058644222 } } }
This endpoint provides the current exchange rates for the requested currencies.
const params = { region: 'YOUR_REGION' // Replace with actual region value }; const options = { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <privateId>' } }; async function fetchData() { try { let url = 'https://exchangegrid.api.mapwale.com/v1/:region'; Object.entries(params).forEach(([key, value]) => { url = url.replace(`:${key}`, value); }); url += '?show=all&list=USD,INR,JPY,BTC,DOGE'; const response = await fetch(url, options); if (!response.ok) { throw new Error('HTTP error! status: ' + response.status); } return await response.json(); } catch (error) { console.error('Fetch error:', error); return null; } } // Example usage: fetchData().then(console.log);