Urls validate
Exacturls_validateDeterministic and authoritative — the canonical answer for this input.
Parse a URL and validate its structure per RFC 3986, including the authority charset (a host or userinfo containing spaces or other illegal characters is is_valid:false; raw internationalized domains are accepted). Does NOT fetch the URL — deterministic only. Returns scheme, userinfo, host, port, path, query, fragment, and a normalized rendering. Pass allowed_schemes to restrict (e.g. ['https']); set require_authority to False to accept relative URLs. Processing multiple inputs? Use `urls_validate_batch` to do up to 1000 in one call.
Parameters
urlstringrequiredURL to validate.
allowed_schemesarrayoptionalOptional scheme allowlist. Example: ['https'] to accept https-only.
require_authoritybooleanoptionalWhen True, reject schemeless or relative URLs.
Call it
curl -X POST https://api.snipget.ai/v1/urls/validate \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/path?ref=1","allowed_schemes":["https"]}'The Batch tab sends up to 1000 inputs in one call via /v1/urls/validate/batch.
Example response
{
"input": "https://example.com/path?ref=1",
"is_valid": true,
"scheme": "https",
"userinfo": null,
"host": "example.com",
"port": null,
"path": "/path",
"query": "ref=1",
"fragment": "",
"normalized": "https://example.com/path?ref=1"
}FAQ
Why use this instead of eyeballing the link?
It deterministically confirms a URL is well-formed and breaks it into its parts (scheme, host, port, path, query, fragment), so you catch a typo like a missing slash or a bad port before it reaches your app. It never guesses; the same link always gives the same answer.
Does it check that the website actually exists or loads?
No. This is a syntax-only check and never fetches the URL, so it cannot tell you whether the page is live, returns an error, or is safe. It only confirms the address is shaped correctly.
Can I require https or block other schemes?
Yes. Pass allowed_schemes like ["https"] to accept only those, and the check fails for anything else. By default require_authority is on, which rejects schemeless or relative links; set it to false if you want to accept relative URLs.
What happens if I send something that isn't a real URL?
You get a normal response with is_valid false, confidence 0, and a why_invalid reason (for example, no scheme or a non-numeric port). It does not throw an error, so you can read the reason and move on.
Is this the authoritative answer?
Yes. This tool is exact: it follows the URL standard (RFC 3986) and the result is deterministic and repeatable, not a best guess.