Skip to main content
The API returns JSON by default. The format=context option returns markdown with YAML frontmatter instead — see context format below.
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:

Fields added by metadata=full

These fields appear on results when you pass metadata=full. They are not included in the default metadata=basic response.

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 performance and billing data:

Context format

With format=context, the API returns results as markdown with YAML frontmatter instead of JSON. This format is sized for LLM context windows and can be passed directly to a language model without JSON parsing.

Document-level frontmatter

The response starts with a YAML frontmatter block describing the search:

Per-result structure

Each result renders as an <article> block with its own frontmatter:
A source line appears in the frontmatter only when the display source differs from the domain in the <article> tag. With metadata=full, each article’s frontmatter adds domain, publisher, type, content_type, lang, word_count, image, keywords, and summary when available.

Type-specific sections

The same type-specific groups the JSON response carries as additional arrays render as trailing sections after the main results, so a context-format caller sees everything a JSON caller would. Sections appear only when the group has results, in this order: Academic results, News results, Video results, Social results, Place results, Profile results. (images is JSON-only.) Each section is a markdown heading followed by a compact item list — title, url, and when available date, source, description, and duration for videos:
Items already present in the main <article> results are not repeated in these sections.

Extracts in context format

extracts defaults to on for format=context (the opposite of JSON, where it defaults to off). To disable extracts in context format, pass extracts=false.

Next steps

Query parameters

Full parameter reference.

Content retrieval

Fetch full page content from any URL.

RAG pipeline

Use search results as LLM context.

Build with AI agents

MCP server and agent integration.