Snipget.ai

Urls normalize

Exact
urls_normalize

Deterministic and authoritative — the canonical answer for this input.

Canonicalize a URL: lowercase scheme + host, drop the default port, resolve ./.. path segments, and optionally sort query params and strip the fragment. Returns the normalized URL and whether it changed. A missing scheme or a malformed authority is rejected as is_valid:false; raw internationalized domains are accepted. Processing multiple inputs? Use `urls_normalize_batch` to do up to 1000 in one call.

Parameters

valuestringrequired

The URL to canonicalize.

sort_querybooleanoptional

Sort query parameters alphabetically.

strip_fragmentbooleanoptional

Drop the #fragment.

Call it

curl -X POST https://api.snipget.ai/v1/urls/normalize \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"value":"HTTPS://Example.com:443/a/./b/../c?b=2&a=1#top","sort_query":true,"strip_fragment":true}'

The Batch tab sends up to 1000 inputs in one call via /v1/urls/normalize/batch.

Example response

{
  "input": "HTTPS://Example.com:443/a/./b/../c?b=2&a=1#top",
  "is_valid": true,
  "normalized": "https://example.com/a/c?a=1&b=2",
  "changed": true
}

FAQ

What does canonicalize mean here?

It rewrites a URL into one tidy standard form: it lowercases the scheme and host, drops a redundant default port (like :443 on https), and resolves ./ and ../ steps in the path. That makes two links that point to the same place comparable, which is great for de-duplicating.

Can it tidy the query and drop the #fragment?

Yes. Set sort_query to put the query parameters in alphabetical order so links compare cleanly, and set strip_fragment to remove the part after the # (like #section). Both are off by default.

How do I know if it actually changed anything?

The result includes a changed flag that is true when the normalized form differs from what you sent, and false when your URL was already canonical. That lets you skip needless updates.

What does it not do?

It does not remove tracking parameters, follow redirects, or confirm the link works; for removing a specific parameter use the query-edit tool. It also will not invent a missing scheme, so a schemeless link comes back is_valid false with confidence 0 and a reason.

Will the same link always normalize the same way?

Yes. This tool is exact and deterministic, so the canonical form is stable and repeatable, not a best guess.

Related tools