/v1/canonicalize
Canonicalize a URL
Essayez-le en direct
10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.
Ça marche. Récupérez une clé API et utilisez-la dans votre projet.
Obtenez une clé APIExtraits de code
curl "https://api.oanor.com/urlcanon-api/v1/canonicalize" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/urlcanon-api/v1/canonicalize", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/urlcanon-api/v1/canonicalize");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
"https://api.oanor.com/urlcanon-api/v1/canonicalize",
headers={"x-oanor-key": "oanor_test_..."}
)
Exemple de réponse
Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.
{
"data": {
"input": "HTTPS://Example.COM:443/a/./b/../c?utm_source=x&b=2&a=1",
"changed": true,
"changes": [
"normalized scheme/host/port/path encoding",
"removed tracking parameters",
"sorted query parameters"
],
"canonical": "https://example.com/a/c?a=1&b=2",
"components": {
"host": "example.com",
"path": "/a/c",
"port": null,
"query": {
"a": "1",
"b": "2"
},
"scheme": "https",
"fragment": null
}
},
"meta": {
"timestamp": "2026-06-03T09:24:58.352Z",
"request_id": "a9b44bee-b3c4-40fc-a762-abe2e7b6abdd"
},
"status": "ok",
"message": "Canonicalize a URL",
"success": true
}