URL Parser
Decompose URLs into scheme, host, port, path, query parameters, and fragment
GET
/v1/url-parse
curl "https://dns.toolkitapi.io/v1/url-parse?url=https%3A%2F%2Fapi.toolkitapi.io%3A8080%2Fv1%2Fusers%3Fpage%3D2%26limit%3D50%23section"
import httpx
resp = httpx.get(
"https://dns.toolkitapi.io/v1/url-parse?url=https%3A%2F%2Fapi.toolkitapi.io%3A8080%2Fv1%2Fusers%3Fpage%3D2%26limit%3D50%23section",
)
print(resp.json())
const resp = await fetch("https://dns.toolkitapi.io/v1/url-parse?url=https%3A%2F%2Fapi.toolkitapi.io%3A8080%2Fv1%2Fusers%3Fpage%3D2%26limit%3D50%23section", {
});
const data = await resp.json();
console.log(data);
# See curl example
Response
200 OK
{
"scheme": "https",
"host": "api.toolkitapi.io",
"port": 8080,
"path": "/v1/users",
"query_string": "page=2&limit=50",
"query_params": {"page": "2", "limit": "50"},
"fragment": "section",
"username": null,
"password": null,
"netloc": "api.toolkitapi.io:8080"
}
Try It Live
Live Demo
Response
Description
Decompose URLs into scheme, host, port, path, query parameters, and fragment
How to Use
1
1. URL-encode the target URL and pass it in the `url` query parameter.
2
2. Inspect the response for individual URL components. Multi-value query parameters (e.g. `?tag=a&tag=b`) are returned as arrays.
About This Tool
URL Parser decomposes a URL into its constituent parts — scheme, host, port, path, query string, individual query parameters, fragment, and authentication credentials. Single-value query parameters are returned as strings; multi-value parameters are returned as arrays.
Why Use This Tool
- Debugging redirects — Break down complex URLs to inspect each component
- Query parameter extraction — Pull structured params from URLs in logs or analytics data
- URL validation — Verify a URL's structure before making requests
- Migration auditing — Compare URL structures across old and new systems
Frequently Asked Questions
How are multi-value query parameters handled?
Parameters appearing once are returned as a string. Parameters appearing multiple times (e.g. `?id=1&id=2`) are returned as an array of strings.
Does it support non-HTTP URLs?
Yes. Any URL with a scheme is parsed — `ftp://`, `ssh://`, `mailto:`, custom schemes, etc.
Is the URL validated?
The URL is decomposed using Python's `urllib.parse`. Malformed URLs won't raise an error but may have empty or unexpected field values.
Start using URL Parser now
Get your free API key and make your first request in under a minute.