Ask AI
Skip to main content

Get base domain

Function: Get base domain

This function helps you extract just the main part of a web address, known as the base domain, from a full URL. For example, if you have https://www.example.com/products/item123, this function will give you example.com. It's useful when you need to identify the primary website without all the extra path or query details.

Input,

  • Url (Type: URL) The complete web address from which you want to get the base domain. This input is required.

Output,

  • Result (Type: URL) The extracted base domain name (e.g., example.com). This output will be stored in a variable named RESULT by default, but you can change this name if needed.

Execution Flow,

Real-Life Examples,

  1. Extracting a simple domain from a full URL

    • Inputs:
      • Url: https://www.mycompany.com/about-us/team
    • Result: The function successfully extracts mycompany.com and stores it in the Result variable.
  2. Handling a URL without a protocol

    • Inputs:
      • Url: blog.example.org/latest-news
    • Result: The function automatically adds https:// to the URL, then extracts blog.example.org and stores it in the Result variable.
  3. Extracting domain from a URL with port and query parameters

    • Inputs:
      • Url: http://dev.api.service.net:8080/data?user=admin
    • Result: The function extracts dev.api.service.net as the base domain, ignoring the protocol, port, and query parameters, and stores it in the Result variable.