Skip to navigation

Answer API Quickstart

Get a cited, synthesized answer from a single query.
View as MarkdownOpen in Claude

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. The samples below read YDC_API_KEY. See the site Quickstart for the five-API tour and API key management for best practices.

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, MCP, or the Python SDK

TypeScript and JavaScript have three paths. Use fetch against the REST APIs when the application needs the JSON. Use @youdotcom-oss/mcp, or the hosted server at https://api.you.com/mcp, when an agent should call the tools. Use the Python SDK when you want a typed client that tracks new API fields. The @youdotcom-oss/sdk package is deprecated.

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.

Next Steps