Validation

Validate a URL

Checks whether a URL is well-formed and breaks it into protocol, hostname, port, pathname and query. Never connects to the URL (no SSRF risk).

Costs 1 credit per call.

post/validate-url

Request

  • Base URL: https://api.cofferdock.com
  • URL: https://api.cofferdock.com/validate-url
  • Auth: API key in header x-api-key

Request body

urlstring required

The URL to check (up to 4096 characters). It must include the protocol, e.g. "https://example.com/path?x=1". It is only parsed, never opened.

allowed_protocolsstring[]

Protocols that count as valid, as a non-empty array such as ["http","https","ftp"]. Default ["http","https"]. Case is ignored and the trailing ":" is optional.

Response

Result.

successboolean
validboolean
reasonstring nullable
protocolstring nullable
hostnamestring nullable
portstring nullable
pathnamestring nullable
queryobject nullable

Changes

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