Search the live web

View as Markdown

Runs a live web search through SerpAPI, returns a stored result when a fresh version exists, and durably records fresh results in the source-document store.

Authentication

AuthorizationBearer

User bearer token: Supabase or Clerk session JWT, Clerk OAuth access token, or Clerk personal API key

OR
X-API-Keystring

Admin API key for system-to-system write operations

OR
X-Client-Secretstring

Client secret for read-only service-to-service access (no writes)

Request

This endpoint expects an object.
searchstringRequired
Search text sent to the upstream web search provider
bypassCachebooleanOptionalDefaults to false
Skip cache lookup and refresh from the search provider
cacheKeystring or nullOptional
Stable lookup text for cache keying when generated search text varies between runs
languagestring or nullOptional
Search language code
regionstring or nullOptional
Search region code
resultLimitinteger or nullOptional
Maximum number of normalized results to keep
sourcestring or nullOptional<=64 characters

Optional caller identity for source-document attribution and abuse triage. Any non-blank string up to 64 characters is accepted and persisted with the resolved request context.

Response

OK
documentobject

Source-document ledger row backing this result

resultlist of objects
Normalized result items in provider rank order
searchobject
Web search request represented by this result

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
406
Not Acceptable Error
409
Conflict Error
415
Unsupported Media Type Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error