URL parser

Split a URL into scheme, login, host, port, path, query parameters and fragment.

Input

The URL to take apart.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/url-parse \
  -H 'Content-Type: application/json' \
  -d '{"input":{"url":"https://user:[email protected]:8443/a/b%20c?x=1&x=2&y=#top"}}'
import json, urllib.request

body = {'input': {'url': 'https://user:[email protected]:8443/a/b%20c?x=1&x=2&y=#top'}}
request = urllib.request.Request("https://setget.net/v1/tools/url-parse", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/url-parse", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"url":"https://user:[email protected]:8443/a/b%20c?x=1&x=2&y=#top"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "url-parse",
  "input": {
    "url": "https://user:[email protected]:8443/a/b%20c?x=1&x=2&y=#top"
  }
}
{
  "input": {
    "url": "https://user:[email protected]:8443/a/b%20c?x=1&x=2&y=#top"
  }
}

Endpoint: POST /v1/tools/url-parse. Over MCP: run_tool with slug: "url-parse". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
url string yes The URL to take apart.

Examples

Input
{
  "url": "https://user:[email protected]:8443/a/b%20c?x=1&x=2&y=#top"
}
Result
{
  "scheme": "https",
  "username": "user",
  "password": "pw",
  "host": "example.com",
  "host_type": "domain",
  "is_idn": false,
  "ascii_host": "example.com",
  "unicode_host": "example.com",
  "port": 8443,
  "default_port": 443,
  "path": "/a/b%20c",
  "segments": [
    "a",
    "b c"
  ],
  "query": "x=1&x=2&y=",
  "params": {
    "x": [
      "1",
      "2"
    ],
    "y": ""
  },
  "fragment": "top",
  "origin": "https://example.com:8443"
}

An internationalised domain name

Input
{
  "url": "http://bücher.example/"
}
Result
{
  "scheme": "http",
  "username": null,
  "password": null,
  "host": "bücher.example",
  "host_type": "domain",
  "is_idn": true,
  "ascii_host": "xn--bcher-kva.example",
  "unicode_host": "bücher.example",
  "port": null,
  "default_port": 80,
  "path": "/",
  "segments": [],
  "query": null,
  "params": {},
  "fragment": null,
  "origin": "http://xn--bcher-kva.example"
}

Questions

Is the URL fetched?
No. The text is only split into its parts. Nothing is requested or looked up.
Why is a parameter sometimes a list?
A name that appears more than once in the query becomes a list of its values, in order.
What is the origin?
Scheme, host and port together. Browsers use it to decide which pages may share data.