Skip to main content
Start with one focused query and a small result set. Refine the search when the returned evidence reveals what is missing. For a first request, see For Humans; for the implementation contract, see For your coding agent.

Write a query with a clear purpose

Include the subject and the detail you need. Avoid combining unrelated questions into a single query. For multi-part research, search each question separately, compare the sources, and let the evidence guide follow-up queries. A query is retrieval input, not a reliable way to enforce an output format or a domain restriction.

Choose the result count deliberately

Begin with 5–10 results. Increase count when you need broader source coverage, up to 50. More results also mean more context for your application to process; the maximum count is not always the most useful choice. Preserve source order initially. Select relevant evidence before adding it to a model’s context window, and avoid repeatedly including the same URL across searches.

Use the right amount of context

Full webpage text is capped at 5000 characters per result by default. Use a positive max_characters to change the cap; the object itself enables text. Text mode replaces snippet with text. Source text can be shorter or missing, and it is evidence for your model rather than a generated answer. Select relevant sources before asking the model to synthesize them.

Match freshness to the question

Date filtering depends on source metadata. It does not establish the date an event occurred or guarantee a fresh crawl. Missing publication dates are not today’s date. Dates must be valid, and the start of a range must not be after its end.

Focus on the right domains

Use structured domain filters rather than relying on the query to enforce source selection:
Start with a small list of relevant domains. Check spelling when a filter gives unexpected results, and avoid placing the same domain in both lists. Empty arrays apply no domain restriction. Broaden the domain or date filters before concluding that no useful evidence exists.

Refine sparse or weak results

  1. Broaden an overly narrow freshness window.
  2. Replace ambiguous terms with the specific concept, product, or organization.
  3. Break a compound question into smaller searches.
  4. Increase the result count only when you need additional coverage.
An empty array is a valid search outcome, not proof that no relevant information exists. Do not turn a network error into an empty result and silently continue.

Build reliable agent loops

Set a request timeout and a limit on search attempts. Stop when you have enough evidence to answer, or tell the user when evidence remains insufficient. For transient server failures, retry with bounded backoff and jitter. Fix invalid requests and credentials before retrying. A 429 can indicate a burst limit or exhausted daily allowance; check the error and Dashboard. Daily allowance resets automatically at 00:00 UTC. See Errors & troubleshooting for response codes and Plan & usage for account rules.

Preserve the distinction between sources and instructions

Retrieved text is untrusted external content. Keep it separate from your agent’s instructions, preserve citation URLs, and distinguish what the sources state from what the model infers. If sources disagree or lack the needed detail, make that uncertainty explicit.