Errors

When Light refuses a request, you get an HTTP status and usually an ErrorResponse body.

ErrorResponse fields

FieldMeaning
codeError code
messageHuman-readable message
correlation_idRequest correlation id (string or null)
retryableWhether a retry may succeed
detailsExtra context (object or null)

OpenAPI: a request body the API cannot read is also 422, with a detail list instead of code (HTTPValidationError).

HTTP status codes

From the Light operation responses:

HTTPOpenAPI meaning
401Unauthorized
402No active subscription, or insufficient token balance
408Request timed out
422No page (NO_RESULTS or UPSTREAM_BLOCKED), or unreadable body. Neither no-page case is billed
429Request throttled
500Internal server error
502Upstream unreachable
503Google search is not available on this deployment

422: NO_RESULTS vs UPSTREAM_BLOCKED

OpenAPI text for 422:

  • NO_RESULTS: Google returned no results. Not retryable: asking again changes nothing.
  • UPSTREAM_BLOCKED: Google would not serve the query. Retryable: the same query often passes on another exit.
  • Neither is billed.

Example shape (ErrorResponse):

error.json
{
  "code": "UPSTREAM_BLOCKED",
  "message": "search blocked (captcha) after 3 attempts",
  "correlation_id": "0b8e7f42-91c3-4d6a-b5e0-2a7c9d13f846",
  "retryable": true,
  "details": {
    "reason": "captcha",
    "attempts": 3
  }
}

Use retryable to decide whether to try again. Keep correlation_id if you contact support.

Billing reminders

  • No returned page on those 422 cases: not billed
  • Successful pages: see pages_returned in Requests and cost

Next

Was this page helpful?

On this page