> For clean Markdown of any page, append `.md` to the page URL.
> Documentation index: https://you.com/docs/llms.txt (section indexes: append `/llms.txt` to any section URL).
> Search these docs: Docs MCP at https://you.com/docs/_mcp/server (`searchDocs`, no API key).
> Call live You.com APIs: Product MCP at https://api.you.com/mcp (free Search only: `?profile=free`). To pick an API or integration path, call `you-discover` on that server instead of guessing.
> OpenAPI: https://you.com/docs/openapi.json—auth header `X-API-Key`, env `YDC_API_KEY`.

# Answer API Quickstart

The Answer API returns a synthesized natural-language answer with citations and the web results used to generate it. Send a `query`. The API retrieves web results and synthesizes an answer with inline citations.

Get an API key at [you.com/platform](https://you.com/platform). New accounts start with \$100 in complimentary credits. The samples below read `YDC_API_KEY`. See the [site Quickstart](/docs/quickstart) for the five-API tour and [API key management](/docs/administration/api-keys) for best practices.

```python maxLines=0
from youdotcom import You

with You() as you:
    response = you.answer(query="Top 5 EV-selling companies worldwide in 2025 so far")

    print(response.answer)

    print(f"\n--- {len(response.citations or [])} citations ---")
    for i, citation in enumerate(response.citations or [], 1):
        print(f"[{i}] {citation.source}")
```

```typescript
const response = await fetch("https://api.you.com/v1/answer", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.YDC_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "Top 5 EV-selling companies worldwide in 2025 so far",
  }),
});

const data = await response.json();
console.log(data.answer);

console.log(`\n--- ${data.citations.length} citations ---`);
data.citations.forEach((citation, i) => {
  console.log(`[${i + 1}] ${citation.source}`);
});
```

```curl
curl -X POST https://api.you.com/v1/answer \
  -H "X-API-Key: $YDC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "Top 5 EV-selling companies worldwide in 2025 so far"
  }'
```

Every citation is verified against the source text before the answer is returned. The `excerpts` are the verbatim passages the model used.

Steer results with `freshness`, `country`, `language`, and domain filters. See [Search Controls](/docs/guides/answer/search-controls).

## Next Steps

#### [Answer API Overview](/docs/guides/answer)

When to use Answer vs. Research, what you get, and pricing

#### [Search Controls](/docs/guides/answer/search-controls)

Freshness, locale, domain filters, and safesearch

#### [API reference](/docs/api-reference/answer/v1-answer)

Full parameter reference, request/response schemas, and playground

#### [Research API](/docs/guides/research)

Control research depth when thoroughness matters more than speed