Answer API Overview

Get synthesized, citation-backed answers grounded in real-time web results.

View as MarkdownOpen in Claude

Add You.com to your agent or IDE via MCP — every API in these docs is available on https://api.you.com/mcp (new accounts get $100 in free credits), and Search is free to try via https://api.you.com/mcp?profile=free, no signup required. MCP Server guide →

Install our docs MCP server

This documentation ships with a Docs MCP Server that gives any MCP-enabled agent a searchDocs tool to search every page here and get back relevant passages with source URLs — no API key required. Point your client at https://you.com/docs/_mcp/server. See the Docs MCP Server guide for setup and examples.


What Is the Answer API?

The Answer API returns a synthesized natural-language answer with citations and the web results used to generate it. Send a query with optional freshness, locale, and domain controls. The API retrieves web results and synthesizes an answer with inline citations.

Unknown or extra request fields are rejected.


How It Works

The Answer API runs a managed pipeline over the same retrieval and extraction infrastructure as the Web Search API and Contents API. For each query, it retrieves web results, pulls the most relevant supporting content, and synthesizes a cited answer in a single request. You don’t configure search strategy, page reads, prompts, or model selection.

The API verifies that every citation exists in the source text and supports the answer before returning it. The excerpts in each citation are the verbatim passages the LLM used to construct the answer, so you can confirm accuracy without trusting the model alone.

On the SimpleQA benchmark, the Answer API reports 93.48% accuracy. Typical p50 latency is 2.67 seconds. There are no effort tiers to tune, so latency and cost stay predictable across queries.


When to Use the Answer API

Three options get you from a question to a cited, web-grounded answer: wire the Web Search API and Contents API into your own LLM, use the Answer API, or use the Research API. Which one fits depends on how much of the pipeline you want to own.

Build Your OwnAnswer APIResearch API
You assembleRetrieval, page reads, prompt, model, dedup, citation logicNothing (one call)Nothing (one call)
You getWhatever you buildAnswer + citations + web resultsAnswer or structured JSON + sources
ControlFullQuery, freshness, locale, domainsDepth (litefrontier), schema, background mode
SpeedDepends on your stackA few secondsVaries by effort
Best forCustom orchestration you want to ownFast grounded answers, simple integrationDepth control, structured output, multi-step research

Build your own when you want full control over retrieval, prompting, and model choice. The tradeoff is owning the orchestration: deduplicating sources, extracting the right passages, generating consistent inline citations, and keeping the answer grounded. Teams that build this in-house often hit hallucinations, rising LLM token costs, self-contradictory answers, and inefficient use of retrieved sources.

Answer when you want a citation-backed answer from real-time web results in a single call, without configuring research depth or defining an output schema. It’s the right choice for questions that can be answered from a single, high-quality search rather than multi-step reasoning.

Research when you need control over depth. The research_effort parameter (lite through frontier) lets you trade cost and latency against thoroughness, and output_schema returns structured JSON. Research lite and standard cover the middle ground: fast enough for production, deeper than a single retrieval pass.


What You Get

Every Answer API response includes:

  • answer: A Markdown-formatted answer with numbered inline citations, such as [[1, 2]], that reference items in the citations array.
  • citations: The sources cited in the answer, in citation order. Each item contains a source URL and the verbatim excerpts the LLM used to construct the answer.
  • results.web: All web results considered during answer synthesis, whether cited or not.

Each item in results.web includes a URL, title, and array of snippets. The page_age field is omitted when a result does not include a publication date or age.

1{
2 "answer": "The aurora borealis is caused by charged particles ejected from the Sun—carried by the solar wind and often intensified by solar flares or coronal mass ejections—that travel to Earth, are funneled by Earth's magnetic field toward the polar regions, and collide with oxygen and nitrogen atoms in the upper atmosphere. These collisions excite the atoms, which then release photons of light, creating the visible northern lights. [[1, 2]]",
3 "citations": [
4 {
5 "source": "https://www.jpl.nasa.gov/nmp/st5/SCIENCE/aurora.html",
6 "excerpts": [
7 "Auroras are brilliant ribbons of light weaving across Earth's northern or southern polar regions. These natural light shows are caused by magnetic storms that have been triggered by solar activity."
8 ]
9 },
10 {
11 "source": "https://www.valofinland.com/what-causes-the-colours-in-aurora-borealis/",
12 "excerpts": [
13 "When these particles reach Earth, they collide with gases in our atmosphere, such as oxygen and nitrogen. These collisions excite the gas particles, causing them to emit light."
14 ]
15 }
16 ],
17 "results": {
18 "web": [
19 {
20 "url": "https://www.jpl.nasa.gov/nmp/st5/SCIENCE/aurora.html",
21 "title": "How Auroras Form",
22 "snippets": [
23 "Auroras are brilliant ribbons of light weaving across Earth's northern or southern polar regions."
24 ]
25 }
26 ]
27 }
28}

Quickstart

1import os
2import requests
3
4API_KEY = os.environ["YDC_API_KEY"]
5
6response = requests.post(
7 "https://api.you.com/v1/answer",
8 headers={"X-API-Key": API_KEY, "Content-Type": "application/json"},
9 json={"query": "Top 5 EV-selling companies worldwide in 2025 so far"},
10)
11
12data = response.json()
13print(data["answer"])
14
15print(f"\n--- {len(data['citations'])} citations ---")
16for i, citation in enumerate(data["citations"], 1):
17 print(f"[{i}] {citation['source']}")

Parameters

query is required. All other fields are optional.

ParameterTypeRequiredDescription
querystringYesThe question or prompt to answer. Limited to 400 characters. Cannot be blank.
freshnessstringNoday, week, month, year, or a date range in YYYY-MM-DDtoYYYY-MM-DD format
countrystringNoCountry code from the supported set, such as US, GB, or FR, that determines the geographical focus of the web results
languagestringNoLanguage tag from the supported set, such as EN, EN-GB, or FR, that determines the language of the web results
include_domainsstring[]NoOnly return results from these domains. Max 500 domains. Cannot be used with exclude_domains or boost_domains
exclude_domainsstring[]NoExclude results from these domains. Max 500 domains. Cannot be used with include_domains. Can be used with boost_domains
boost_domainsstring[]NoPrefer results from these domains without excluding other domains. Max 500 domains. Can be used with exclude_domains, but not with include_domains

View full API reference


Using Search Controls

The Answer API accepts the same freshness, locale, and domain filters as the Web Search API. All filters are optional and can be combined, except include_domains with exclude_domains or boost_domains.

Freshness

Restrict results to the last week for questions about recent events:

1response = requests.post(
2 "https://api.you.com/v1/answer",
3 headers={"X-API-Key": API_KEY, "Content-Type": "application/json"},
4 json={
5 "query": "What changed in the latest Fed interest rate decision?",
6 "freshness": "week",
7 },
8)

Use a custom date range for questions bounded to a specific period:

1response = requests.post(
2 "https://api.you.com/v1/answer",
3 headers={"X-API-Key": API_KEY, "Content-Type": "application/json"},
4 json={
5 "query": "What were the major AI regulation developments in 2025?",
6 "freshness": "2025-01-01to2025-12-31",
7 },
8)

Domain Filters

Restrict results to trusted sources with include_domains:

1response = requests.post(
2 "https://api.you.com/v1/answer",
3 headers={"X-API-Key": API_KEY, "Content-Type": "application/json"},
4 json={
5 "query": "What are the FDA-approved GLP-1 receptor agonists?",
6 "include_domains": ["fda.gov", "nih.gov"],
7 },
8)

Exclude unreliable sources while boosting authoritative ones. exclude_domains and boost_domains can be used together:

1response = requests.post(
2 "https://api.you.com/v1/answer",
3 headers={"X-API-Key": API_KEY, "Content-Type": "application/json"},
4 json={
5 "query": "What is the current state of quantum computing?",
6 "exclude_domains": ["reddit.com", "quora.com"],
7 "boost_domains": ["nature.com", "science.org", "arxiv.org"],
8 },
9)

Country and Language

Focus results on a specific region and language:

1response = requests.post(
2 "https://api.you.com/v1/answer",
3 headers={"X-API-Key": API_KEY, "Content-Type": "application/json"},
4 json={
5 "query": "What are the top startup hubs in Germany?",
6 "country": "DE",
7 "language": "DE",
8 },
9)

Common Use Cases

Question Answering in AI Applications

Use the Answer API in applications that need grounded, cited responses, including chatbots, copilots, and research tools. Send a question and get a sourced answer without configuring research effort.

Content Pipelines

Use the Answer API as a research step before writing: ask a question, get a well-cited answer, and use that as source material for reports, articles, or briefings.

Internal Knowledge Tools

Let employees ask complex questions—product comparisons, regulatory summaries, technical deep dives—and get sourced answers without manually reading dozens of pages.


Best Practices

Write Specific Questions for Better Answers

For complex topics, include context, constraints, or the specific angle you want covered. “What are the tradeoffs between PostgreSQL and MongoDB for a write-heavy workload at 10M rows?” produces a more focused answer than “Compare databases.”

Target Results with Search Controls

Set freshness when you need recent information. Select country and language from the supported values to control the region and language of web results. Use include_domains for a strict allowlist, exclude_domains to remove unwanted sources, or boost_domains to prefer selected sources without filtering out other results.

Verify Citations for High-Stakes Use Cases

The inline citation numbers map to the citations array. For legal, financial, or medical contexts, build a step that follows each source URL and checks the supporting excerpts before surfacing claims to users.

Use Research When Depth Matters More Than Speed

If your use case requires choosing between a quick factual answer and an exhaustive or frontier analysis, the Research API’s research_effort parameter gives you that control.


Pricing

$5.00 per 1,000 calls. All new you.com accounts receive $100 in free credits to get started.

For volume discounts, annual pricing, or enterprise features, visit you.com/pricing or contact [email protected].


Data Retention

Organizations operating under strict privacy, compliance, or security mandates can add Zero Data Retention (ZDR) to an enterprise agreement. ZDR restricts retention of Answer API request and response content account-wide and requires no changes to your integration. See Zero Data Retention for what it covers and how to enable it.


Next Steps