Currency Converter via Webhook Using ExchangeRate.host
This n8n template allows you to perform real-time currency conversions by simply sending a webhook request. By integrating with the ExchangeRate.host API, you can get up-to-date exchange rates for over 170 world currencies, making it an incredibly useful tool for financial tracking, e-commerce, international business, and personal budgeting.
---
## How it works
- Receive Conversion Request Webhook: This node acts as the entry point for the workflow, listening for incoming POST requests. It's configured to expect a JSON body containing:
- from: The 3-letter ISO 4217 currency code for the source currency (e.g., USD, PHP).
- to: The 3-letter ISO 4217 currency code for the target currency (e.g., EUR, JPY).
- amount: The numeric value you want to convert.
**Important:** The ExchangeRate.host API access_key is handled securely by n8n's credential system and should not be included in the webhook body or headers.
- Convert Currency: This node makes an HTTP GET request to the ExchangeRate.host API (api.exchangerate.host). It dynamically constructs the URL using the from, to, and amount from the webhook body. Your API access key is securely retrieved from n8n's pre-configured credentials (HTTP Query Auth type) and automatically added as a query parameter (access_key). The API then performs the conversion and returns a JSON object with the conversion details.
- Respond with Converted Amount: This node sends the full currency conversion result received from ExchangeRate.host back to the service that initiated the webhook.
---
## Who is it for?
### This workflow is ideal for:
- E-commerce Platforms:
- Display prices in local currencies on the fly for international customers.
- Convert incoming international payments to your local currency for accounting.
- Calculate shipping costs in different currencies.
- Financial Tracking & Budgeting Apps:
- Update personal or business budgets with converted values.
- Track expenses incurred in foreign currencies.
- Automate portfolio value conversion for multi-currency investments.
- International Business & Freelancers:
- Generate invoices in a client's local currency based on your preferred currency.
- Quickly estimate project costs or earnings in different currencies.
- Automate reconciliation of international transactions.
- Travel Planning:
- Convert travel expenses from one currency to another while abroad.
- Build simple tools to estimate costs for trips in different countries.
- Data Analysis & Reporting:
- Standardize financial data from various sources into a single currency for unified reporting.
- Build dashboards that display converted financial metrics.
- Custom Integrations:
- Connect to CRMs, accounting software, or internal tools to automate currency-related tasks.
- Build chatbots that can answer currency conversion queries.
---
## Data Structure
When you trigger the webhook, send a POST request with a JSON body structured as follows:
```
{ "from": "USD", "to": "PHP", "amount": 100 }
```
The workflow will return a JSON response similar to this (results will vary based on currencies and amount):
```
{ "date": "2025-06-03", "historical": false, "info": { "rate": 58.749501, "timestamp": 1717398188 }, "query": { "amount": 100, "from": "USD", "to": "PHP" }, "result": 5874.9501, "success": true }
```
---
## Setup Instructions
- Get an ExchangeRate.host Access Key:
- Go to https://exchangerate.host/ and sign up for a free API key.
- Create an n8n Credential for ExchangeRate.host:
- In your n8n instance, go to Credentials.
- Click New Credential and search for HTTP Query Auth.
- Set the Name (e.g., ExchangeRate.host API Key).
- Set API Key to your ExchangeRate.host access key.
- Set Parameter Name to access_key.
- Set Parameter Position to Query.
- Save the credential.
- Import Workflow:
- In your n8n editor, click Import from JSON and paste the provided workflow JSON.
- Configure ExchangeRate.host API Node:
- Double-click the Convert Currency node.
- Under Authentication, select Generic Credential Type.
- Choose HTTP Query Auth as the Generic Auth Type.
- Select the credential you created (e.g., ExchangeRate.host API Key) from the dropdown.
- Configure Webhook Path:
- Double-click the Receive Conversion Request Webhook node.
- In the Path field, set a unique and descriptive path (e.g., /convert-currency).
- Activate Workflow:
- Save and activate the workflow.
---
## Tips
This workflow is a powerful starting point. Here's how you can make it even more robust and integrated:
- Robust Error Handling:
- Add an IF node after Convert Currency to check {{ $json.success }}. If false, branch to an Error Trigger node or send an alert (e.g., Slack, Email) with {{ $json.error.info }} to notify you of API issues or invalid inputs.
- Include a Try/Catch block to gracefully handle network issues or malformed responses.