Website Email Scraping API Builder - n8n Workflow

Create a robust email scraping API using this powerful n8n workflow. Fetch website content, extract emails via regex, deduplicate results, and respond instantly. Ideal n8n templates for data extraction.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers needing a quick, custom scraping API without writing backend code.
Marketing professionals building lead lists from publicly available websites.
Users looking for advanced examples of data manipulation and regex within an n8n workflow.
Anyone interested in leveraging the n8n platform to build custom data extraction tools.

Overview

Building custom APIs for web scraping is often complex, requiring careful handling of HTTP requests, error management, and data cleaning. This specialized n8n workflow simplifies the entire process. It transforms a standard n8n trigger into a powerful email extraction service. By simply calling the webhook URL with a target Website query parameter, this solution fetches the site's content, extracts emails using reliable regex, removes duplicates, and immediately returns the cleaned list. This specific n8n workflow is one of the most useful n8n templates for developers seeking instant data endpoints. Leveraging the core functions of various n8n node components ensures high reliability and speed.

How it Works

This powerful n8n workflow functions as an on-demand API endpoint:


  1. Trigger: The process starts with a Webhook n8n trigger. It listens for incoming HTTP requests and expects the URL of the target website to be passed in a query parameter (e.g., ?Website=http://example.com).

  2. Fetching Data: The Get the website data n8n node immediately executes an HTTP request to the URL provided by the n8n trigger, retrieving the raw HTML content of the target website.

  3. Extraction: The Extract the emails found n8n node uses a robust Regular Expression to scan the entire HTML body and pull out all valid email addresses, storing them in a new Email field.

  4. Itemization: The Split Out n8n node takes the array of found emails and breaks them down, ensuring each email address becomes a separate item flowing through the n8n workflow.

  5. Filtering: The If contains email n8n node checks if an email address was actually extracted for the current item. Only items containing an email proceed.

  6. Cleanup: The Remove Duplicates n8n node processes the resulting list, ensuring that if the same email appeared multiple times on the source page, it is only reported once.

  7. Response: Finally, the Respond to Webhook n8n node sends the compiled, unique list of email addresses back to the requester, completing the execution of the n8n workflow.

Installation Guide

To deploy this n8n template, follow these steps:


  1. Import: Copy the provided JSON data and navigate to your n8n instance.

  2. Create New Workflow: Click 'New' or 'Import from JSON' and paste the code.

  3. Activate Webhook: Once imported, locate the Webhook n8n trigger node. The specific URL path (/webhook/ea568868-5770-4b2a-8893-700b344c995e in this template) will be part of the final access URL. Ensure your n8n instance is accessible publicly (or running in production mode).

  4. Testing: To test this n8n workflow, call the URL using a query parameter, such as: {{N8N_HOST}}/webhook/ea568868-5770-4b2a-8893-700b344c995e?Website=https://targetsite.com.

  5. Credentials: This specific n8n workflow does not require external credentials, relying only on standard HTTP Request functionality.

Node Details

Webhook (n8n trigger): Sets up the API endpoint. This crucial n8n trigger is configured to respond using a subsequent Response node, ensuring the output of the scraping process is delivered instantly.
Get the website data (HTTP Request n8n node): Fetches the HTML content. The URL is dynamically pulled from the incoming webhook query: {{ $json.query['Website'] }}. Configured to handle potential errors but still proceed.
Extract the emails found (Set n8n node): Performs the heavy lifting of data extraction. It uses a RegEx pattern to match standard email format within the HTML body ($json.data) and creates a new item field named Email.
Split Out (n8n node): Converts the array of emails into separate flow items, preparing them for individual validation and processing in the subsequent n8n node components.
If contains email (If n8n node): A core flow control n8n node that ensures only items containing valid, non-empty email strings continue down the true branch of the n8n workflow.
Remove Duplicates (n8n node): Cleans the final list, guaranteeing the output from this n8n workflow provides only unique email addresses.


  • Respond to Webhook (n8n node): Generates the final API response, sending the extracted and deduplicated data back to the original requestor.

Related n8n Workflows

Free

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

Automation expert with years of experience helping businesses improve their efficiency and productivity with smart automations that are affordable, scalable, and flexible.

Featured*