Skip to main content
POST
Answer a question from live web search results, with the sources the answer was grounded in.

Authorizations

Authorization
string
header
required

AgentKey API key (ak_…).

Body

application/json
query
string
required

The question, in natural language.

country
string

ISO 3166-1 alpha-2 country code to bias the search, e.g. US, CN.

exclude_domains
string[]

Exclude sources from these domains (routes to an engine that supports it).

fields
string[]

Projection: keep only these dotted paths of data, e.g. ["items.id", "items.text"].

include_domains
string[]

Restrict sources to these domains (routes to an engine that supports it).

include_raw
boolean
default:false

Attach the raw upstream payload as raw (not a stable contract; truncated above 256 KB).

lang
string

BCP 47 language tag for the answer and the sources, e.g. en, zh-Hans.

provider
string

Shorthand for routing.only = [provider].

routing
object

Provider routing override. order: try these providers first; only: restrict to these (equivalent to pinning); allow_fallbacks: false tries only the first eligible provider.

time_range
enum<string>
default:all

Only ground the answer in pages published within this window.

Available options:
day,
week,
month,
year,
all

Response

Success envelope

Success envelope whose data is a Answer.

attempts
object[]
required
credits_charged
number
required

Credits charged for this call (the method's fixed price).

data
object
required

A natural-language answer to a question, grounded in web sources.

op
string
required

Method name.

op_version
integer
required

Method version that served the call.

provider
string
required

Provider that actually served the call.

request_id
string
required

Correlation id; quote it in support requests.

took_ms
integer
required
unsupported_fields
string[]
required

Output paths this provider structurally does not supply; such fields are null for a different reason than 'missing on this record'.

raw
any

Upstream payload, only with include_raw=true. Not a stable contract.

raw_truncated
boolean