INVALID_URL
The request body wasn't valid JSON, or the url field was missing or unparseable as a URL.
| Code | HTTP status | Retryable? |
|---|---|---|
| INVALID_URL | 400 | No |
What this means
The Read API returns INVALID_URL when the request body fails the first validation pass. That usually means one of three things: the body wasn't valid JSON at all (a parse error), the JSON was valid but didn't include a top-level `url` field, or the value of `url` couldn't be coerced into an absolute URL (missing scheme, malformed host, etc.). The API does no fetching before this check, so the call costs zero against your quota.
When you'll see it
HTTP 400. Body always includes code: "INVALID_URL". Branch on code, never on the human-readable message — wording can change without notice; the code is the stable contract.
Example response
{
"status": "error",
"code": "INVALID_URL",
"message": "Field 'url' is required and must be a valid absolute URL"
}How to handle
Validate the URL client-side before the call. The minimum bar: it must start with `http://` or `https://`, include a host, and be parseable by `new URL(...)` in modern runtimes. If you're accepting URLs from end users, normalize and sanitize them before forwarding to the Read API — most of the time the bug is a missing scheme.
Suggested handling in a Node client:
if (data.code === 'INVALID_URL') {
// Surface as a 400 to your own client — never retry.
return res.status(400).json({ error: 'Provide a valid http(s) URL' });
}Related errors
| Code | Status | What it means |
|---|---|---|
| URL_NOT_FOUND | HTTP 404 | The target URL returned 404 — the page doesn't exist on the origin. |
| UNAUTHORIZED | HTTP 401 | The Bearer token is missing, malformed, or has been revoked. |
See the full error index for the complete catalog with the handling switch statement covering every code at once.