Skip to Content
searchSDK

Responses reference

Every field of searchSDK search and contents responses: results, pages, cost, attempts, warnings and cost bounds.

Every response field, read from the SDK's types. Both responses share the common fields.

Common fields

NameTypeMeaning
providerProviderIdThe provider that answered (a fallback, when fallback_used is in warnings).
costCostWhat the successful attempt cost (see Cost).
requestIdstring | nullThe provider's request id, or null.
latencyMsnumberMilliseconds from the start of the call to the answer.
warningsWarning<ProviderId>[]Non-fatal notes (see Warnings).
attemptsAttempt<ProviderId>[]Every attempt, skipped ones included, in order.
rawunknownThe provider's parsed JSON body.

SearchResponse

NameTypeMeaning
resultsSearchResult[]Normalized results; [] is a success.

SearchResult

NameTypeMeaning
urlstringThe result's address.
titlestring | nullTitle, or null.
excerptsstring[]Text the provider matched; the kind (description, content chunks, highlights) is on each provider's page.
publishedAtstring | nullPublication time as an ISO 8601 string, or null.
authorstring | nullAuthor, or null.
ranknumberPosition, from 1.
providerFieldsRecord<string, unknown>Provider-scoped values such as scores and ids. Not comparable across providers.

ContentsResponse

NameTypeMeaning
pagesPage[]One page per requested URL, in order.

Page

NameTypeMeaning
urlstringThe URL as requested.
status"ok" | "failed"ok or failed. One failed page never fails the call.
finalUrlstring | nullAddress after redirects, or null.
titlestring | nullTitle, or null.
contentstring | nullPage text, Markdown or plain per provider, or null.
publishedAtstring | nullPublication time, or null.
authorstring | nullAuthor, or null.
error{ code: string | null; message: string | null } | nullFor a failed page: the provider's code and message (missing when the provider returned nothing for the URL).

Cost

NameTypeMeaning
usdnumber | nullUSD, or null when the price is not known. Never 0 for unknown.
estimatedbooleanFalse only for an exact provider-reported figure, or when nothing was sent.
sourceCostSourcereported, reported-credits, computed, unknown or none.
credits?numberCredits the provider reported, for credit pricing.

Attempt

NameTypeMeaning
providerProviderIdProvider tried.
outcome"ok" | "error" | "skipped"ok, error or skipped (no key, or an option the provider cannot honour).
code?ErrorCodeError code of a failed or skipped attempt.
status?numberHTTP status, when one arrived.
startMsnumberMilliseconds from the start of the call.
durationMsnumberHow long the attempt took.
retryAfterMs?numberThe provider's Retry-After, in milliseconds.
billedBilledyes (a 2xx), possible (sent, no answer) or no (not sent, or an error status).
costCostThis attempt's own cost; for possible, what it costs if it was billed.

Warning

NameTypeMeaning
codestringWarning code (see Warnings).
providerProviderIdProvider it concerns.
message?stringThe provider's message, when it sent one.
count?numberHow many rows or pages it concerns.

CostBound

Returned by costBound(spec, kind, input). listPrice(spec, kind, { count }) returns a Cost.

NameTypeMeaning
usdnumber | nullThe most one request can cost at the highest documented rate, or null when it cannot be bounded.
unknownBecause?"option" | "count" | "price"Why usd is null: option (a cost option has no price), count (the billed count is unbounded) or price (not public).
requiresOverageOff?truePresent when the bound holds only while paid use past a free allowance stays off on the account.

On this page