Code node

Domain Extractor

Published 3 months ago

Created by

Lucas Perret


Building Blocks

Template description

This node is designed to cleanse URLs and extract their domain names efficiently.

It effectively handles a wide range of URL formats, including those with unconventional or complex top-level domains (TLDs), such as ''.

You can also use it to extract the domain from an email. The node will also check if the domain is from a free email provider ( / or not.

How It Works

The node analyzes the provided URL, removing any unnecessary elements.

It then identifies and extracts the domain name, ensuring compatibility with a diverse array of TLDs.

The node utilizes an extensive list of TLDs to guarantee accurate domain extraction for virtually any URL.

To view the complete list of supported top-level domains, please visit: TLD List on GitHub

How to use it

Call this workflow using the "execute workflow" node

You can pass either an email variable or a url variable.

For email, the node also detect free mail provider such as Yahoo / Google...etc

Share Template

Implement complex processes faster with n8n

red icon yellow icon red icon yellow icon