Skip to main content
Turn any web page into clean markdown or structured data. The Contents API extracts content from URLs, with optional AI summaries, JSON-schema extraction, and async batch processing. You only pay for URLs that succeed.

Extract a page

Returns clean markdown for each URL. Pass up to 10 URLs synchronously, or up to 50 with async mode.

Core options

OptionValuesDefault
response_lengthshort (25k), medium (50k), large (100k), max, or a char count (1k-1M)short
extract_effortnormal (fast), high (better, slower), autonormal
summaryfalse, true, an instruction string, or a JSON schemafalse
screenshottrue to capture a page screenshot (not for PDFs)false

Academic papers

When you pass an academic paper URL or DOI, Valyu serves it from our pre-processed academic index rather than crawling the live page. You get clean markdown with preserved figures, equations, tables, and section structure, plus inline pre-signed image URLs - the things lost when a JavaScript-heavy or PDF paper is scraped live. This happens automatically; just pass the URL.
SourceExample URL / idPlan for index access
arXivhttps://arxiv.org/pdf/2506.05440 (or /abs/, /html/)tier_0 (pay-as-you-go)
PubMed Centralhttps://pubmed.ncbi.nlm.nih.gov/PMC10584482tier_0
bioRxivhttps://www.biorxiv.org/content/10.1101/2020.07.28.225581tier_1
medRxivhttps://www.medrxiv.org/content/10.1101/...tier_1
ChemRxivhttps://chemrxiv.org/doi/full/10.26434/chemrxiv-...tier_2
If your plan covers the source, you get the processed markdown; if the specific paper isn’t indexed yet, it falls back to live extraction. If your plan doesn’t cover the source, the URL is live-crawled (you still get content, just without the processed-index quality).
Academic results set source to the dataset id (e.g. valyu/valyu-arxiv) and include doi, authors, and citation_count. Figures are returned in image_url as a filename→URL map and referenced inline in the markdown.

AI summaries and structured extraction

The summary field controls AI post-processing:
  • false - raw markdown, fastest and cheapest (no AI)
  • true - a basic AI summary
  • string - custom instructions, e.g. "Summarise the methodology and key findings in 2-3 paragraphs"
  • object - a JSON schema for structured extraction
Use any valid JSON Schema. Limits: 5,000 characters, 3 levels deep, 20 properties per object.Supported types: string, number/integer, boolean, array, object.Tips:
  • Use clear description fields to guide extraction.
  • Use enum for consistent categorisation.
  • Keep schemas shallow and mark essential fields required.
Python
Screenshots are captured during page rendering and returned as pre-signed URLs. PDF files do not support screenshots.

Async processing

For 11-50 URLs (required above 10) or non-blocking workflows, use async mode. Submit URLs, get a job_id immediately, then poll or receive results via webhook. Async also raises the per-URL timeout to 120s (vs 25s for sync).
Async mode is required above 10 URLs. For 1-10 URLs it’s optional, for non-blocking workflows.
The initial submit returns HTTP 202 with a job_id, poll_url, and a one-time webhook_secret (store it immediately - you cannot retrieve it later).Jobs move through these statuses:
StatusMeaning
pendingCreated, not yet started
processingURLs running in batches of 5
completedAll URLs succeeded
partialFinished with some failures
failedAll URLs failed
To poll manually:
Status response fields include: job_id, status, urls_total, urls_processed, urls_failed, created_at, updated_at, current_batch / total_batches (while processing), results and actual_cost_dollars (when completed/partial), and error (when partial/failed).
When you provide a webhook_url, Valyu POSTs to it when the job finishes (completed, partial, or failed). Headers: Content-Type: application/json, User-Agent: Valyu-Contents/1.0, X-Webhook-Signature: sha256={hex}, X-Webhook-Timestamp (Unix seconds).Retries: up to 5 attempts with exponential backoff (1s, 2s, 4s, 8s), no retry on 4xx, 5s connect / 15s read timeout.The payload is signed with HMAC-SHA256 over "{timestamp}.{json_payload}":
The TypeScript SDK exports verifyContentsWebhookSignature() which handles this for you.

Limits and pricing

DetailValue
Max URLs (sync / async)10 / 50
Batch size5 URLs
Timeout per URL (sync / async)25s / 120s
Base pricing$0.001 per URL
AI features (summary/schema)+$0.001 per URL
Job expiry (TTL)7 days

Response format

With summary set, content is the AI summary (string) or extracted JSON (object), and each result adds summary_success.
FieldDescription
status"success" or "failed" for this URL
errorHuman-readable failure reason (failed results only)
titleExtracted page title
urlOriginal URL
contentExtracted content (markdown or JSON)
descriptionPage meta description (paper abstract for academic sources)
source"web", or the dataset id for academic papers (e.g. valyu/valyu-arxiv)
priceCost for this URL in dollars
lengthCharacter count
data_type"unstructured" or "structured"
summary_successWhether AI processing succeeded (only when summary is used)
image_urlExtracted image URLs (figures, for academic papers)
screenshot_urlPage screenshot URL (only when screenshot=true)
doi, authors, citation_countAcademic sources only

Error handling

Each result carries a status of success or failed. Failed results include a descriptive error (page unavailable, required sign-in, blocked, timed out) that never exposes Valyu’s internal infrastructure - branch on status and surface the error string as-is.
HTTP statusMeaning
200All URLs extracted successfully
206Partial - some succeeded, some failed (check urls_failed and per-result status)
422Every URL failed - see the top-level error

Next steps

API reference

Complete parameter documentation

Python SDK

Python integration

TypeScript SDK

TypeScript integration

Integrations

LangChain, LlamaIndex, and more