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.
import requests import json def fetch_data(): # API configuration base_url = 'https://exchangegrid.api.mapwale.com/v1' params = { 'region': 'YOUR_REGION' # Replace with actual region value } headers = { 'Content-Type': 'application/json', 'Authorization': f'Bearer <privateId>' } query_params = {"show":"all","list":"USD,INR,JPY,BTC,DOGE"} try: # Build URL url = f"{base_url}/{''.join(f'/{params[param]}' for param in ["region"])}" # Make request response = requests.get( url, headers=headers, params=query_params, json={} ) # Check for errors response.raise_for_status() return response.json() except requests.exceptions.RequestException as e: print(f"Error making request: {e}") return None # Example usage if __name__ == "__main__": result = fetch_data() print(json.dumps(result, indent=2))