URL Parser API
Parse any URL into protocol, auth, host, port, path, query params and fragment. Edit query parameters in a decoded table. Free and client-side.
The URL Parser is also available as a free REST API. Send a POST request with a JSON body to https://dot.tools/api/tools/url-parser — no authentication, no API key, CORS enabled. Successful calls return { "ok": true, "result": { … } }; failures return HTTP 400 or 422 with an error body.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
url | string | required | The absolute URL to parse, including protocol. |
params | object[] | optional | Optional replacement query parameters — when given, the URL is rebuilt with these and the result reflects the new URL. |
Response
| Field | Type | Required | Description |
|---|---|---|---|
href | string | required | The full normalized URL. |
origin | string | required | Protocol + host + port. |
protocol | string | required | URL scheme without the trailing colon. |
username | string | required | Username from the authority, decoded. |
password | string | required | Password from the authority, decoded. |
hostname | string | required | Host without port. |
port | string | required | Explicit port, or empty when using the default. |
pathname | string | required | Path component. |
search | string | required | Raw query string including the leading ?. |
hash | string | required | Fragment without the leading #, decoded. |
params | object[] | required | Decoded query parameters in order, duplicates preserved. |
Example request
curl -X POST https://dot.tools/api/tools/url-parser \
-H 'Content-Type: application/json' \
-d '{
"url": "https://demo:s3cret@api.example.com:8443/v1/search?q=caf%C3%A9%20%26%20tea&lang=nl&tag=dev&tag=tools#results"
}'Sample response
{
"ok": true,
"result": {
"href": "https://demo:s3cret@api.example.com:8443/v1/search?q=caf%C3%A9%20%26%20tea&lang=nl&tag=dev&tag=tools#results",
"origin": "https://api.example.com:8443",
"protocol": "https",
"username": "demo",
"password": "s3cret",
"hostname": "api.example.com",
"port": "8443",
"pathname": "/v1/search",
"search": "?q=caf%C3%A9%20%26%20tea&lang=nl&tag=dev&tag=tools",
"hash": "results",
"params": [
{
"key": "q",
"value": "café & tea"
},
{
"key": "lang",
"value": "nl"
},
{
"key": "tag",
"value": "dev"
},
{
"key": "tag",
"value": "tools"
}
]
}
}Use the free URL Parser in your browser, read the URL Parser guide, or import the full OpenAPI specification.