URL
GET/v0/url
Validates and parses a URL, breaking it down into its individual components: protocol, domain, path, and query parameters. Uses the WHATWG URL Standard for parsing. Returns valid: false for any string that cannot be parsed as a URL.
Try it
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| value | string | Yes | The URL to validate and parse |
Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.isvalid.dev/v0/url?value=https://example.com/path?foo=bar"
Response Fields
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the value is a valid, parseable URL |
| protocol | string | The URL scheme without the trailing colon, e.g. https. Only present when valid is true. |
| domain | string | The hostname, e.g. example.com. Only present when valid is true. |
| path | string | The path component, e.g. /path/to/page. Defaults to / when no path is present. Only present when valid is true. |
| query | object | Key-value pairs from the query string. Values are strings, or arrays of strings for repeated keys. Empty object when no query string is present. Only present when valid is true. |
| port | string | null | The port number as a string, or null if no explicit port is specified. Only present when valid is true. |
| hash | string | null | The fragment identifier without the leading #, or null if absent. Only present when valid is true. |
Example Response
{
"valid": true,
"protocol": "https",
"domain": "example.com",
"path": "/path",
"query": { "foo": "bar" },
"port": null,
"hash": null
}