URL Parser avatar

URL Parser

Pricing

Pay per event

Go to Apify Store
URL Parser

URL Parser

This actor parses URLs into their components: protocol, hostname, port, pathname, query parameters, hash, file extension, TLD, subdomain, and path segments. Useful for bulk URL analysis, data cleaning, and URL categorization.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Stas Persiianenko

Stas Persiianenko

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Categories

Share

Parse URLs into protocol, domain, path, query parameters, and more.

What does URL Parser do?

This actor parses URLs into their components: protocol, hostname, port, pathname, query parameters, hash, file extension, TLD, subdomain, and path segments. Feed it a list of URLs and get back structured data about every part of each URL. It is useful for bulk URL analysis, data cleaning, URL categorization, and extracting specific components like domains or query parameters at scale.

Use cases

  • Data engineers -- extract and normalize domains from large URL lists during ETL pipelines and data migrations
  • Analytics teams -- categorize URLs by domain, TLD, subdomain, or path for traffic analysis and reporting
  • SEO specialists -- analyze URL structure, query parameters, and path depth across an entire site
  • Marketing analysts -- extract UTM parameters and campaign tags from URL lists in bulk for attribution analysis
  • QA teams -- validate URL formats and detect malformed links across a website before launch
  • Security analysts -- extract and inspect domains, subdomains, and query parameters from suspicious URL lists

Why use URL Parser?

  • Batch processing -- parse thousands of URLs in a single run instead of handling them one at a time
  • Complete decomposition -- extracts protocol, hostname, domain, subdomain, TLD, path, query params, hash, and more
  • Query parameter extraction -- turns query strings into structured key-value pairs for easy analysis
  • Validation included -- the isValid field flags malformed or unparseable URLs
  • Structured JSON output -- consistent schema ready for databases, spreadsheets, and downstream processing
  • Pay-per-event pricing -- you only pay for the URLs you parse, starting at $0.0005 per URL

Input parameters

ParameterTypeRequiredDefaultDescription
urlsarrayYes--List of URLs to parse into components

Input example

{
"urls": [
"https://www.google.com/search?q=apify&hl=en",
"https://github.com/apify/apify-sdk-js#readme",
"https://example.com:8080/path/to/page?foo=bar&baz=qux"
]
}

Output example

{
"originalUrl": "https://www.google.com/search?q=apify&hl=en",
"isValid": true,
"protocol": "https",
"hostname": "www.google.com",
"pathname": "/search",
"domain": "google.com",
"subdomain": "www",
"tld": "com",
"queryParams": { "q": "apify", "hl": "en" },
"queryParamCount": 2,
"pathSegments": ["search"],
"isHttps": true,
"isWww": true,
"error": null
}

How much does it cost?

URL Parser uses Apify's pay-per-event pricing model. You are only charged for what you use.

EventPriceDescription
Start$0.035One-time per run
URL parsed$0.0005Per URL parsed

Cost examples:

  • Parsing 100 URLs: $0.035 + (100 x $0.0005) = $0.085
  • Parsing 1,000 URLs: $0.035 + (1,000 x $0.0005) = $0.535
  • Parsing 10,000 URLs: $0.035 + (10,000 x $0.0005) = $5.035

Using the Apify API

You can call URL Parser programmatically from any language using the Apify API. The actor slug is automation-lab/url-parser.

Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('automation-lab/url-parser').call({
urls: [
'https://www.google.com/search?q=apify',
'https://example.com:8080/path?foo=bar',
],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Python

from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')
run = client.actor('automation-lab/url-parser').call(run_input={
'urls': [
'https://www.google.com/search?q=apify',
'https://example.com:8080/path?foo=bar',
],
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)

Integrations

URL Parser integrates with the major automation and data platforms through the Apify ecosystem:

  • Make (formerly Integromat) -- automatically parse URLs from incoming data feeds and route extracted components to other apps.
  • Zapier -- create Zaps that parse URLs from form submissions, spreadsheets, or databases and enrich records with domain data.
  • Google Sheets -- export parsed results for URL auditing, categorization, and domain analysis.
  • Slack -- alert your team when malformed URLs are detected in a batch or when unexpected domains appear.
  • Webhooks -- trigger downstream processing in your own ETL pipelines when parsing completes.
  • n8n -- orchestrate runs from n8n workflows or any platform that supports HTTP requests and the Apify REST API.

Tips and best practices

  • Use for data cleaning -- run messy URL lists through URL Parser to normalize and deduplicate by domain or hostname.
  • Extract UTM parameters -- the queryParams object makes it easy to pull out utm_source, utm_medium, and other campaign tags from marketing URLs.
  • Filter by TLD -- use the tld field to segment URLs by country (e.g., .de, .co.uk) or type (e.g., .edu, .gov).
  • Validate before processing -- check the isValid field to filter out malformed URLs before passing them to other actors or APIs.
  • Combine with other actors -- pair URL Parser with URL Shortener Expander to first expand short links, then parse the resulting full URLs.

FAQ

What happens with invalid or malformed URLs? The actor returns a result with isValid: false and the error field populated with a description of the parsing failure. All component fields will be null or empty. Other URLs in the batch are still processed normally.

Does the actor fetch the URL or make HTTP requests? No. URL Parser performs purely local string parsing. It does not make any HTTP requests to the URLs, which makes it extremely fast and means there are no network-related failures or timeouts.

Are international domain names (IDN) supported? Yes. The actor handles internationalized domain names and Unicode characters in URLs. The hostname and domain fields will contain the parsed values as provided in the input.

Can I parse URLs without a protocol? URLs should include a protocol (http:// or https://) for reliable parsing. If a protocol is missing, the parser may not be able to correctly identify the hostname and other components. Always include the full protocol prefix for best results.

How fast is URL Parser compared to other actors? URL Parser is one of the fastest actors available because it performs no network requests. It processes URLs through pure string parsing, so even batches of 10,000+ URLs complete in seconds.