For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Go to Platform
HomeExamplesSDKs & toolsAPI referencePricing
  • Use Cases
    • All
    • Private RAG
    • Simple Search
    • Research
LogoLogo
HomeExamplesSDKs & toolsAPI referencePricing
LogoLogo
Go to Platform
On this page
  • Prerequisites
  • Run It
  • How It Works
  • What’s Next
  • Resources
Use Cases

Web Search

|View as Markdown|Open in Claude|
Was this page helpful?
Built with

Demo preview
Click here to try it out.

If you’re new to the You.com API, this is the right place to begin. Before building RAG pipelines or research agents, you need to understand the foundation: the Search API. Send a query. Get back accurate web and news results.

The Search API gives you direct access to You.com’s search index — the same index that powers our Research API and our own search engine. You get titles, URLs, and descriptions for the most relevant pages on the web, fast. Then, you decide what to do with them: filter them, rank them, display them in a UI or feed them into a language model to synthesize an answer.

This example shows the simplest possible way to call it: a Python script and a small Next.js web app you can deploy to Vercel.


Prerequisites

Get a You.com API key

Sign up at you.com/platform to get your API key.


Run It

Python
Web App

The quickest way to see the API in action is the command line.

$pip install -r requirements.txt
$export YDC_API_KEY="your-api-key-here"
$python simple_search.py "what is retrieval augmented generation"

No query? No problem — the example falls back to a default one, so python simple_search.py works too.

What you get back:

Title: Retrieval-Augmented Generation (RAG) - IBM
URL: https://www.ibm.com/think/topics/retrieval-augmented-generation
Description: RAG is an AI framework that combines the strengths of traditional information
retrieval systems with the capabilities of generative large language models.

Each result has a title, URL, and a short description pulled from the page. Clean, structured, ready to use.


How It Works

Both the script and the web app do the same three things:

  1. Take a search query
  2. Call the You.com Search API via the Python or TypeScript SDK
  3. Display the title, URL, and description for each result

The web app just adds a layer of UI on top: a search input, result cards with favicons, and You.com branding. The API route (app/api/search/route.ts) keeps your key server-side.


What’s Next

Research API

Instead of raw results, get a synthesized, cited answer written by an agent that reads the web for you.

Private RAG

Use your own documents to ground an LLM response — no web search needed.

Search API Reference

Full docs for filtering by freshness, country, language, and more.


Resources

  • Search API Reference
  • Python SDK on PyPI (pip install youdotcom)
  • TypeScript SDK on npm (npm install @youdotcom-oss/sdk)
  • GitHub: ydc-simple-search-sample
  • Live Demo
  • Discord