Normalize URL
web.normalize_url
Overview
You send a URL and we rewrite it the same way every time: resolve it against a base URL when it is relative, lowercase the scheme and host, drop the default port, collapse ".." and "." path segments, sort the query, and strip common tracking parameters such as utm_source, fbclid, gclid, and ref. You get the rewritten URL plus its parts and the list of parameters we dropped. There is no universal canonical form, so compare with the result rather than assuming a server will treat it identically.
Comparing URLs by hand goes wrong quietly, so you get one documented rewrite instead of ad-hoc string surgery scattered across your code.
Reliability
The same URL and the same options always give you the same answer, and nothing leaves the platform. Watch two rewrites in particular: "ref" counts as a tracking parameter, so a link that uses it for routing loses it unless you set removeTrackingParams to false; and the default port disappears only for http on 80 and https on 443, so other ports stay. Bad input comes back as a validation error and retrying will not help — a URL we cannot parse, a relative URL with no usable baseUrl, one with no host, or one longer than 8192 characters.
Context footprint
You get one rewritten URL, its six parts, and a short list of dropped parameter names, so the response stays tiny. A successful call costs 1 execution credit.
When to use it
Before you compare, deduplicate, or store URLs that arrived from different places.
When you need to know the URL actually resolves, or when dropping a tracking parameter would change what the server sends back.
Scope
Non-goals
- Does not fetch the URL or check that it exists
- Does not shorten or expand a URL
- Does not decode or re-encode percent-escapes in the path or query
- Does not promise the rewritten URL behaves identically at the server
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response may contain submitted or transformed content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Absolute or base-resolvable URL to normalize. |
| baseUrl | string | No | Optional absolute base URL; omit it when url is already absolute. |
| policy | string | No | Normalization policy; omit it for comparison. |
| removeTrackingParams | boolean | No | Whether known tracking parameters are removed; omit it for true. |
| sortQueryParams | boolean | No | Whether query parameters sort deterministically; omit it for true. |
| stripFragment | boolean | No | Whether the fragment is removed; omit it for true. |
| lowercaseHost | boolean | No | Whether the host is lower-cased; omit it for true. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | Yes | Whether URL parsing and normalization succeeded. |
| normalizedUrl | string | Yes | Normalized absolute or relative URL. |
| components | object | Yes | Closed parsed-component receipt with scheme, host, port, path, query, and fragment properties. Its documented web receipt properties are bounded to 128 entries — unconstrained RFC 8259 JSON items. |
| removedQueryParams | array | Yes | Bounded array of removed tracking-parameter names in source order. The item shape is defined by the nested schema and the array contains from 0 through 10000 items. |
| warnings | array | No | Bounded array of non-fatal safe warning strings. The item shape is defined by the nested schema and the array contains from 0 through 20000 items. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"web.normalize_url","input":{"url":"https://EXAMPLE.com/a/../b"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("web.normalize_url", {"url":"https://Example.com:443/blog/../pricing?utm_source=newsletter&plan=team#faq"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not fetch the URL or check that it exists
- Does not shorten or expand a URL
- Does not decode or re-encode percent-escapes in the path or query
- Does not promise the rewritten URL behaves identically at the server
- Checking whether a URL is reachable — reach for web.check_url_status
- Building a request URL where dropping a parameter would change the response
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "web.normalize_url",
"input": {
"url": "https://Example.com:443/blog/../pricing?utm_source=newsletter&plan=team#faq"
}
}Examples
Clean a shared marketing link for comparison
{
"url": "https://Example.com:443/blog/../pricing?utm_source=newsletter&plan=team#faq"
}{
"ok": true,
"removedQueryParams": [
"utm_source"
],
"components": {
"scheme": "https",
"host": "example.com",
"port": null,
"path": "/pricing",
"query": "plan=team",
"fragment": "faq"
},
"normalizedUrl": "https://example.com/pricing?plan=team#faq"
}Privacy policy also drops the fragment
{
"policy": "privacy",
"url": "https://example.com/pricing?utm_source=newsletter#faq"
}{
"ok": true,
"removedQueryParams": [
"utm_source"
],
"components": {
"scheme": "https",
"host": "example.com",
"port": null,
"path": "/pricing",
"query": "",
"fragment": ""
},
"normalizedUrl": "https://example.com/pricing"
}Recommended use cases
- Deduplicate URLs before you store them or count them in analytics
- Strip tracking parameters so two shared links compare equal
- Turn the relative links on a page into absolute ones against a base URL
Avoid for
- Checking whether a URL is reachable — reach for web.check_url_status
- Building a request URL where dropping a parameter would change the response
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.