Skip to main content
All responses are JSON objects. The format=context option returns markdown text instead — see query parameters for details.
The results_type field tells you the shape of the response. Use it to determine which arrays and objects are present — for example, results_type: "weather" means a weather object is included.

Top-level fields

Type-specific arrays

Depending on the query intent, the response may include additional arrays alongside results:

Search results

Each result in the results array has this structure:

Accessing key fields

Result types

The type field indicates the kind of result:

Instant answers

Some queries trigger instant answers alongside regular results.

Weather

Queries about weather return a weather object:
Use the units parameter to get results in metric or imperial. The default is auto-detected from the country parameter.

Calculation

Mathematical queries return a calculation object:
Image queries return an images array with thumbnail and dimension data:
Image results include thumbnail (thumbnail URL), width, and height as string values.

Parsing tips

  • Check results_type first to know the response shape before accessing type-specific fields
  • results is always an array but may be empty for instant answers (weather, calculations)
  • desc vs snippet: desc is the page’s general description; snippet is a query-relevant excerpt (when available)
  • answer at top level is a generated answer string (may be empty); answer on individual results is an inline answer for instant answer result types
  • Optional fields (date, image, snippet, extracts) may not be present on every result — always check before accessing

Search intents

The results_type and type fields reflect what kind of search was performed. You can force an intent with the intent parameter, or let the API auto-detect it. Common intent aliases: See query parameters for the full list of intent aliases.

Metrics

The response always includes a metrics object with search performance data:

Next steps

Query parameters

Full parameter reference.

RAG pipeline

Use search results as LLM context.