urls

Validate a URL's syntax (RFC 3986) with optional scheme allowlist

Parses a URL and validates 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 domain names are accepted). Returns structured components (scheme, userinfo, host, port, path, query, fragment). Does NOT fetch the URL. An optional allowed_schemes list enforces a whitelist (e.g. ['https']). Set require_authority=False to accept relative URLs.

post/v1/urls/validate

Request

  • Base URL: https://api.snipget.ai (the document declares no server; this is the origin it was published from)
  • URL: https://api.snipget.ai/v1/urls/validate
  • Auth: none declared

Query parameters

include_receiptboolean

Set true to attach an execution receipt at meta.receipt — caller-verifiable sha256 hashes over the RFC 8785 (JCS) canonicalization of this call's as-received JSON body and its result (free, like include_trace). Reproduce with any JCS library: input_hash = sha256(jcs({"tool": <request path>, "args": <your body minus include_trace/include_receipt>})); result_hash = sha256(jcs(result)). For deterministic tools, same input on the same build reproduces result_hash.

Headers

authorizationstring nullable
X-API-Keystring nullable

Request body

urlstring required

URL to validate.

allowed_schemesstring[] nullable

Optional scheme allowlist. Example: ['https'] to accept https-only.

require_authorityboolean

When True, reject schemeless or relative URLs.

include_traceboolean

Response

Successful Response

statusstring
confidencenumber required

Changes

No recorded changes to this operation across all 1 revision of this API.