September 2, 2026

What Is the You.com Contents API? Clean Page Content From Any URL

TLDR: The You.com Contents API extracts clean, ready-to-use page content from URLs you choose. Pass up to 10 URLs in one request and get Markdown or HTML back for each. No headless browser, no HTML parsing, no boilerplate cleanup. This guide covers the parameters that matter, the failure modes to handle, and when to reach for it instead of full page extraction inside a search call.

What Does the You.com Contents API Do?

The You.com Contents API takes a list of URLs you already know and returns the full content of each page as clean Markdown or HTML, structured for LLM consumption. You provide the URLs and the API crawls them in parallel and hands back page content with no navigation menus, ads, or footers attached.

Each URL in your request returns a structured object with the source URL, a page title, the content in each format you requested, and optional site metadata. You control the output through the formats parameter and can request markdown, html, and metadata in any combination. Markdown is the default and the right choice for feeding a model. The metadata format adds the site name and favicon URL, which is useful when you are building a UI that shows source attribution.

You pass up to 10 URLs in a single request. One request with 10 URLs is faster than 10 separate requests because the API processes the batch in parallel, so batching is the default habit to build.

Contents API or Web Search API With Full Page Extraction: Which Fits Your Workflow?

It's easy to choose if you start by asking one question: do you start with URLs or with a query?

The Contents API and full page extraction in the Web Search API both return full page content, but they serve different workflows. The Contents API starts from URLs you already have, such as a competitor pricing page list or a documentation index you maintain. The Web Search API with extraction_mode set to full_page starts from a query and returns up to 100 search results with content attached in a single call.

The tradeoff is control versus discovery. With the Contents API you choose exactly which pages get read, which matters for monitoring jobs where the target list is stable and known. With search-first extraction you get discovery for free, but the page set is whatever the search returns. Many pipelines use both: search to discover candidate pages once, then the Contents API to re-read the winners on a schedule.

There is a cost shape difference as well. Search-plus-extraction is billed as a search call plus pages crawled, while the Contents API is billed per page fetched. The exact rates are on the You.com pricing page.

How Do You Call the Contents API From Python?

The official youdotcom SDK wraps the request in one method call. Here is a working monitoring example that fetches three known pages and handles partial failure, which is the failure mode you will hit first in production.

from youdotcom import You
from youdotcom.models import ContentsFormats

COMPETITOR_PAGES = [
    "https://competitor-a.com/pricing",
    "https://competitor-b.com/pricing",
    "https://competitor-c.com/features",
]

with You() as you:
    pages = you.contents(
        urls=COMPETITOR_PAGES,
        formats=[ContentsFormats.MARKDOWN],
        crawl_timeout=15,
    )

for page in pages:
    if page.markdown:
        print(f"OK: {page.title} ({len(page.markdown)} chars)")
    else:
        print(f"FAILED: {page.url}")

The null check is not decorative. If one URL in a batch fails to crawl, for example a page behind a login wall or a 404, the API returns null for that page's markdown and html fields while the rest of the batch succeeds. Skipping the check means feeding None into your downstream pipeline and finding out from a stack trace instead of a log line.

Which Parameters Change the Outcome?

Three parameters do most of the work in real deployments.

formats: Request only what you need. Every extra format adds processing time. If a model is the consumer, request markdown alone and skip html. If a UI needs source attribution, add metadata for the site name and favicon.

crawl_timeout: The per-URL timeout in seconds, from 1 to 60, with a default of 10. Static pages are usually done in 5 to 10 seconds. JavaScript-heavy pages, such as single-page app dashboards, often need 20 to 30 seconds for the renderer to finish. If you see nulls on pages you know exist, a short timeout is the first suspect.

max_age: Cache freshness control in seconds. By default the API may return cached page content to improve latency. Set max_age to a threshold in seconds and any cached copy older than that is ignored, forcing a fresh fetch. For a daily monitoring job, max_age=86400 guarantees content no older than 24 hours. max_age=0 always bypasses the cache. Leave it unset when freshness does not matter and you want the fastest response.

What Failure Modes Should You Handle?

Four failure modes cover most production incidents with any extraction API, including this one.

The null crawl. Login walls, 404s, and pages that block crawlers return null content fields. Detection is a one-line check on page.markdown before processing. Batch jobs should log the failed URL and continue, not abort the batch.

The stale cache hit. A monitoring job that reads cached content can miss a page change entirely. If your job's purpose is detecting change, set max_age to your real freshness requirement instead of accepting the default cache behavior.

The slow render. A JavaScript-rendered page that exceeds crawl_timeout comes back incomplete or null. Detection is repeated nulls or suspiciously short content on known-long pages. The fix is a higher crawl_timeout for those targets, up to the 60 second maximum.

The boilerplate survivor. Markdown extraction strips most chrome, but unusual layouts can leak navigation or cookie-banner text into the output. Detection is spot-checking extracted content on new domains before you index them at scale.

What Should You Build With It?

Three patterns from the Contents API documentation cover most use cases.

Competitive intelligence: Fetch competitor pricing, feature, and blog pages on a schedule, feed the Markdown to an LLM, and surface meaningful changes without anyone checking pages by hand.

Knowledge base ingestion: You have a list of authoritative sources, such as documentation pages, whitepapers, and internal wikis. Fetch them all as clean Markdown and index them into your vector store. The Markdown output follows the CommonMark specification, so any Markdown-aware chunker works without custom parsing.

Research assistant: Let users ask questions about specific URLs. Fetch the page content on the fly and pass it as context to your LLM, which turns any URL into a searchable document.

Where Does It Fit in the Rest of the Stack?

The Contents API is one layer in a retrieval pipeline, not the whole pipeline. Use the Web Search API to discover pages from a query. Use the Contents API to read known URLs deeply and on a schedule. Use the Research API when you want the synthesis step done for you and a cited answer back. The CommonMark specification defines the Markdown flavor to expect in the output, and the W3C HTML standard pages are the reference when you request raw html instead.

Sibling articles in this hub cover the adjacent workflows: news monitoring pipelines, B2B data workflows, MAP violation monitoring, and lead enrichment.

What Should You Check Before You Scale?

Two checks before you point a batch job at thousands of URLs.

First, run a 10-URL sample from each domain you plan to ingest and read the Markdown by hand. Boilerplate leaks and truncated renders are obvious in a sample and invisible in an aggregate. Second, decide your max_age policy per job rather than per pipeline. A daily competitor price check and a weekly documentation re-index have different freshness requirements, and setting the strictest max_age everywhere trades latency you paid for without needing it.

Next action: get an API key from the You.com platform, run the Python example above against three URLs you care about, and check what comes back. The quickest way to feel the value is to point it at a page you have tried to scrape by hand.

Frequently Asked Questions

The Contents API extracts clean page content from URLs you pass it. You provide up to 10 URLs in a single request, choose markdown, html, or metadata output formats, and the API crawls the pages in parallel and returns the content with no navigation menus, ads, or footers attached. It is one of the retrieval primitives in the You.com API family, alongside the Web Search API and the Research API.

The two APIs start from different inputs. The Contents API starts from URLs you already know and reads them deeply, which fits monitoring and ingestion jobs over a stable page list. The Web Search API starts from a query and returns results with snippets and source URLs, and it can also return full page content through its extraction option. Many pipelines use both: search discovers candidate pages once, then the Contents API re-reads the winners on a schedule.

The formats parameter accepts markdown, html, and metadata, in any combination. Markdown is the default and the right choice for feeding language models. The html format returns the raw page markup. The metadata format returns site-level details such as the site name and favicon URL, which is useful for building UIs that show source attribution. Request only the formats you need, since each extra format adds processing time.

Failed crawls return null for that page's markdown and html fields while the rest of the batch succeeds. Pages behind login walls, 404s, and hosts that block crawlers are the common causes. Check for null content before processing each page, log the failed URL, and continue the batch rather than aborting it.

Yes. By default the API may return cached page content to improve latency. The max_age parameter controls cache freshness in seconds: a cached copy older than your threshold is ignored and the page is fetched fresh. Set max_age to 0 to always bypass the cache. Monitoring jobs that detect page changes should set max_age to their real freshness requirement, because a stale cache hit looks identical to an unchanged page.

    Share Article:

  1. LI Test

  2. LI Test

Related resources.

Graphic with the text 'What Is Retrieval Augmented Generation (RAG)?' beside line art of a computer monitor and circuit-like tech illustrations on a purple background.

What Is Retrieval Augmented Generation (RAG)?

April 1, 2026

Blog

Why AI with Real-Time Data Matters

March 5, 2026

Blog

Surreal collage featuring fragmented facial features layered with abstract shapes on a black‑to‑blue gradient background.

AI Hallucination Prevention and How RAG Helps

February 27, 2026

Blog

Blue graphic background with geometric lines and small squares, featuring centered white text that reads ‘Semantic Chunking: A Developer’s Guide to Smarter Data.’

Semantic Chunking: A Developer's Guide to Smarter RAG Data

February 19, 2026

Blog

Abstract illustration of floating 3D cubes on a gradient blue background, with dotted wave patterns flowing around them, symbolizing motion and connection.

What Is AI Grounding and How Does It Work?

December 3, 2025

Blog