Research

View as Markdown
Demo preview
Click here to try it out.

When a Simple Search Isn’t Enough

You’ve used the Search API. You send a query, you get back a list of web results. Titles, URLs, snippets. It works great for quick lookups, building search UIs, and feeding results into RAG pipelines.

But some questions need more than a list of links. Questions like “what are the latest breakthroughs in quantum computing” or “how do mRNA vaccines work” need someone (or something) to actually read through dozens of sources, cross-reference them, and write up a coherent answer with citations.

That’s what the Research API does. It’s like having a research assistant that reads the web and writes you a report with footnotes.


What You’ll Build

By the end of this guide you’ll be able to call the Research API in Python or TypeScript and get back comprehensive, cited answers to questions of varying complexity.

Here’s the difference between Search and Research for the same query:

Search API returns raw results:

1[
2 { "title": "Google Quantum AI: Willow Chip",
3 "url": "https://blog.google/...",
4 "snippet": "Google's Willow chip demonstrated..."
5 },
6 { "title": "IBM Quantum: Heron Processor",
7 "url": "https://www.ibm.com/...",
8 "snippet": "IBM announced..."
9 }
10]

Research API returns a synthesized, grounded answer with inline citations:

1## Recent Breakthroughs in Quantum Computing
2
3Quantum computing has seen several major advances in recent years...
4
5**Error correction milestones.** Google's Willow chip demonstrated that
6increasing the number of qubits can actually reduce errors [1], a key
7threshold for practical quantum computing...
8
9**Hardware scaling.** IBM's Heron processor achieved... [2]
10
11Sources:
12[1] Google Quantum AI: Willow Chip
13 https://blog.google/technology/research/google-willow-quantum-chip/
14[2] IBM Quantum: Heron Processor
15 https://www.ibm.com/quantum/blog/ibm-quantum-heron

Same question, fundamentally different output. Search gives you building blocks. Research gives you the finished product.


Why This Approach

What the Research API Does Under the Hood

The Research API doesn’t just run one search. It’s powered by the You.com search index, purpose-built for speed, accuracy, and relevance. Instead of relying on third-party search providers, the Research API searches and reads pages directly from this index. That means lower latency, fresher results, and better extraction quality than you’d get stitching together external services yourself.

On top of that index sits an agentic system that does the actual research. It doesn’t follow a fixed pipeline. Instead it works in an iterative loop:

  1. Reads your question and decides what to search for
  2. Searches the web and reviews the results
  3. Visits promising pages and extracts the relevant content
  4. Decides whether to search again, visit more pages, or start writing based on what it’s found so far
  5. Repeats until it has enough information (controlled by the effort level you choose)
  6. Synthesizes everything into a cited markdown answer

The agent adapts its research strategy as it goes. A question about quantum computing might lead it down a different path than one about financial regulations. Higher effort levels give the agent more time to iterate, which means more searches, more pages read, and a more thorough answer.

Because the search index, page extraction, and synthesis are all built and optimized together, the Research API can deliver results that would be difficult to replicate by chaining separate tools.

Search APIResearch API
SpeedFast (~1s)Slower (5–60s depending on effort)
OutputList of web results (title, URL, snippet)Comprehensive markdown answer with citations
Best forQuick lookups, search UIs, and RAG pipelinesComplex questions, report generation, and deep analysis
Example”nextjs docs""how does next.js compare to remix for production apps”

Use Research when:

  • The question requires reading and synthesizing multiple sources
  • You need a cited, comprehensive answer (not just links)
  • You’re building report generation, fact-checking, or deep analysis features
  • Your users expect a written answer, not a list of results

Use Search when:

  • You need raw results fast
  • You’re building a search UI or autocomplete
  • You’re feeding results into your own RAG pipeline
  • You need fine-grained control over result filtering (freshness, country, language, livecrawl etc.)

Prerequisites

You need two things:

  1. A You.com API key. Get one at you.com/platform
  2. The SDK for your language:
$# Python
$pip install youdotcom
$
$# TypeScript
$npm install @youdotcom-oss/sdk

That’s it. No other dependencies needed.


Step-by-Step Walkthrough

Python

1

Set your API key

$export YDC_API_KEY="your-api-key-here"
2

Make a research call

1import os
2from youdotcom import You
3
4you = You(api_key_auth=os.environ["YDC_API_KEY"])
5response = you.research(input="What are the latest breakthroughs in quantum computing?")
6print(response.output.content)

response.output.content is a markdown string with inline citations like [1], [2]. response.output.sources is the list of sources used.

4

Try different effort levels

1import os
2from youdotcom import You, models
3
4you = You(api_key_auth=os.environ["YDC_API_KEY"])
5
6# Quick answer (~5s)
7response = you.research(input="what is RAG", research_effort=models.ResearchEffort.LITE)
8
9# Thorough research (~20-30s)
10response = you.research(input="compare RAG architectures", research_effort=models.ResearchEffort.DEEP)
11
12# Most comprehensive (~30-60s)
13response = you.research(input="full analysis of RAG vs fine-tuning", research_effort=models.ResearchEffort.EXHAUSTIVE)

TypeScript

1

Install and initialize

1import { You } from "@youdotcom-oss/sdk";
2
3const you = new You({ apiKeyAuth: process.env.YDC_API_KEY });
2

Make a research call

1const result = await you.research({
2 input: "What are the latest breakthroughs in quantum computing?",
3 researchEffort: "standard",
4});
5
6console.log(result.output.content); // markdown answer
7console.log(result.output.sources); // source list
3

Use in a Next.js API route

This is the pattern used in the live demo. The API route calls Research server-side so the API key stays safe:

1import { NextResponse } from "next/server";
2import { You } from "@youdotcom-oss/sdk";
3
4export const maxDuration = 60; // Research can take up to 60s
5
6export async function POST(request: Request) {
7 const { input, research_effort } = await request.json();
8 const you = new You({ apiKeyAuth: process.env.YDC_API_KEY });
9 const result = await you.research({ input, researchEffort: research_effort });
10 return NextResponse.json(result);
11}

Full Working Example

We’ve built a complete sample app you can fork and deploy:

The repo includes:

  • research.py is a standalone Python CLI script
  • app/api/research/route.ts is the Next.js API route using the TypeScript SDK
  • app/page.tsx is the React frontend with effort level picker and markdown rendering

To run it yourself:

$git clone https://github.com/youdotcom-oss/ydc-research-sample.git
$cd ydc-research-sample
$
$# Python
$pip install youdotcom
$export YDC_API_KEY="your-key"
$python research.py "your question here"
$
$# Web app
$cp .env.example .env.local # add your API key
$npm install
$npm run dev # open localhost:3000

Customization Guide

Effort Levels

The research_effort parameter controls how deep the Research API digs. Higher effort means more searches, more sources read, and more thorough analysis.

LevelSpeedWhen to Use
lite~5sQuick factual questions, simple lookups that still benefit from synthesis
standard~10–15sDefault. Balanced speed and depth. Good for most questions
deep~20–30sComplex topics that need cross-referencing. Competitive analysis, technical comparisons
exhaustive~30–60sMaximum depth. Due diligence, comprehensive reports, academic-style research

Choosing the Right Effort Level

  • lite for anything you’d normally just google but want a synthesized answer instead of clicking through links
  • standard when you’re not sure. It’s the sweet spot for most use cases
  • deep when accuracy and thoroughness matter more than speed
  • exhaustive when you need to be really sure. Compliance checks, investment research, technical deep dives

Response Format

The API returns a structured response:

1{
2 "output": {
3 "content": "## Quantum Computing Breakthroughs\n\nQuantum computing has seen several major advances... [1]\n\n...",
4 "content_type": "text",
5 "sources": [
6 {
7 "url": "https://blog.google/technology/research/google-willow-quantum-chip/",
8 "title": "Google Quantum AI: Willow Chip",
9 "snippets": ["Google's Willow chip demonstrated..."]
10 }
11 ]
12 }
13}
  • output.content is a markdown string with numbered inline citations ([1], [2], etc.)
  • output.sources is an array of sources, each with URL, title, and relevant snippets
  • Citations in the content map to the sources array by index

What’s Next

Now that you can call the Research API, here are some directions to explore:


Resources