Real-Time Currency Conversion API Builder via Web Scraping - n8n Workflow

Build a lightning-fast, real-time currency conversion API using this n8n workflow. It uses a custom n8n node to scrape and parse Google Search results triggered by a public webhook.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers needing a quick, free, and real-time currency API without external paid services.
Businesses or individuals automating financial calculations within other applications.
Users looking for advanced examples of web scraping implemented purely within a custom n8n code node.
n8n users seeking robust n8n templates for external API creation.

Overview

Acquiring reliable, real-time currency exchange rates often requires subscribing to expensive or rate-limited API services. This innovative n8n workflow provides a solution by creating a custom API endpoint that leverages the highly reliable and constantly updated data provided by Google Search’s built-in currency converter.

This robust n8n automation takes an input query (e.g., 5usd to mxn), performs a targeted Google search via an HTTP request n8n node, and then uses a custom n8n code node to meticulously parse the raw HTML response. This method ensures you get up-to-the-minute conversion data seamlessly delivered through your custom webhook. It is a prime example of leveraging the flexibility of the n8n platform for advanced data extraction tasks.

How it Works

This powerful n8n workflow executes a multi-stage process to deliver accurate conversion data:


  1. Trigger and Validation: The n8n trigger is a Webhook node listening on a specific path (/currency-converter). Upon receiving a GET request, the subsequent Check Query Parameter n8n node validates that the essential q parameter (containing the conversion request, e.g., ?q=10eur to usd) is present. If missing, the workflow branches to Error Response, returning a 400 status.

  2. Data Fetching: If the query is valid, the Fetch Exchange Rate n8n node makes an HTTP Request to Google, dynamically constructing the search URL using the user’s query. This fetches the raw HTML page containing the conversion result.

  3. Advanced Parsing: The core logic resides in the Extract Conversion Data custom n8n code node. This script first parses the original query to identify the amount, from currency, and to currency. It then applies several sophisticated regular expressions to scan the raw HTML content, accurately extracting the exchange rate and the final converted amount, adapting to various potential display formats Google might use.

  4. Formatting and Response: The extracted numerical data is passed to the Format Currency Response n8n node. This node ensures the output is clean, calculates final values if needed, handles any internal extraction errors, and wraps the conversion result in a standardized JSON payload.

  5. Final Output: Finally, the Send Conversion Response n8n node responds to the original API caller with the formatted JSON data, completing the entire n8n workflow in real-time.

Installation Guide

To deploy this n8n templates workflow and start your custom currency API, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON code and paste it into your n8n instance using the 'New' button -> 'Import from JSON'.

  2. Webhook Configuration: The Webhook n8n trigger is already configured with the path currency-converter and set to respond immediately. Note down the full Test or Production URL provided by the n8n node settings.

  3. Dependencies: This n8n workflow does not require credentials for external services but relies heavily on the Code n8n node. Ensure your n8n execution environment allows the execution of custom JavaScript.

  4. Testing: Test the n8n workflow by sending a GET request to the Webhook URL with a query parameter, for example:

YOURN8NURL/webhook/currency-converter?q=10usd+to+eur

Node Details

The crucial components making up this high-utility n8n workflow include:

Webhook (n8n trigger): The entry point of the automation. It is configured to listen for GET requests on the /currency-converter path, receiving the conversion query.
Check Query Parameter (If n8n node): Essential for flow control, this node verifies if the q query parameter exists. If not, it reroutes the request to an error response, ensuring robustness in the n8n workflow.
Fetch Exchange Rate (HTTP Request n8n node): Responsible for executing the targeted search query against Google. It dynamically constructs the URL using an expression to ensure the correct conversion pair is sought.
Extract Conversion Data (Code n8n node): This is the functional heart of the n8n workflow. It uses extensive custom JavaScript to parse the incoming HTML, identify the relevant numbers and text patterns, calculate the rate, and structure the data for the next step. This advanced n8n node demonstrates complex data manipulation.


  • Format Currency Response (Code n8n node): Prepares the final output. It cleans up the numerical values, ensures proper decimal formatting, and packages the result into a standardized JSON response format, ready for the final webhook response.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.

Featured*