URL Parser
Pricing
Pay per event
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
Actor stats
0
Bookmarked
3
Total users
2
Monthly active users
2 days 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
isValidfield 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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
urls | array | Yes | -- | 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 to parse URLs in bulk
- Open URL Parser in Apify Console.
- Enter a list of URLs you want to parse.
- Click Start to run the actor.
- View results in the Dataset tab -- each URL is broken down into protocol, domain, path, query parameters, and more.
- Download results as JSON, CSV, or Excel.
How much does it cost to parse URLs?
URL Parser uses Apify's pay-per-event pricing model. You are only charged for what you use.
| Event | Price | Description |
|---|---|---|
| Start | $0.035 | One-time per run |
| URL parsed | $0.0005 | Per 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 ApifyClientclient = 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().itemsprint(items)
cURL
curl -X POST "https://api.apify.com/v2/acts/automation-lab~url-parser/runs?token=YOUR_TOKEN" \-H "Content-Type: application/json" \-d '{"urls": ["https://www.google.com/search?q=apify", "https://example.com:8080/path?foo=bar"]}'
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
queryParamsobject makes it easy to pull oututm_source,utm_medium, and other campaign tags from marketing URLs. - Filter by TLD -- use the
tldfield to segment URLs by country (e.g.,.de,.co.uk) or type (e.g.,.edu,.gov). - Validate before processing -- check the
isValidfield 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.
Use with Claude AI (MCP)
You can connect URL Parser to Claude AI as an MCP tool, enabling Claude to parse and analyze URLs during conversations.
Setup
Add the Apify MCP server using the Claude CLI:
$claude mcp add apify-url-parser -- npx -y @anthropic-ai/apify-mcp-server@latest automation-lab/url-parser
Or add it to your Claude Desktop config (claude_desktop_config.json):
{"mcpServers": {"apify-url-parser": {"command": "npx","args": ["-y", "@anthropic-ai/apify-mcp-server@latest", "automation-lab/url-parser"],"env": { "APIFY_TOKEN": "YOUR_TOKEN" }}}}
Example prompts for Claude
- "Parse this URL and extract domain, path, and query params: https://example.com/page?id=123"
- "Break down these URLs into components"
- "Extract all UTM parameters from these marketing 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.
URLs without a protocol return isValid: false.
Always include http:// or https:// in your URLs. The parser needs a protocol to reliably identify the hostname and other components. If your list contains bare domains, prepend https:// before submitting.
Query parameters with special characters are not decoded correctly.
The parser returns query parameter values as-is from the URL. Percent-encoded characters (e.g., %20 for spaces) are preserved in the output. Decode them in your downstream code if needed.
Other developer tools
- URL Shortener Expander -- expand shortened URLs to reveal final destinations
- User Agent Parser -- parse user agent strings into browser, OS, and device details
- Base64 Converter -- encode and decode Base64 strings
- Hash Generator -- generate MD5, SHA-1, SHA-256 hashes
- JSON Validator -- validate and format JSON data
- Regex Tester -- test regular expressions against input strings
- Text Case Converter -- convert text between cases
- Timestamp Converter -- convert between timestamp formats
- IP Address Validator -- validate and analyze IP addresses