Extract a page
Core options
Point-in-time content
To read a page as it was at a past date, setstart_date / end_date with historical_cache: true (Python start_date, end_date, historical_cache; TypeScript startDate, endDate, historicalCache). Dates accept YYYY, YYYY-MM-DD or an ISO-8601 datetime. Contents then serves only a snapshot captured inside the window: with historical_cache on, Contents always behaves as historical_cache_strict: "only", whatever value you pass, and never falls back to a live crawl. A URL with no snapshot in the window fails rather than returning newer content.
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.
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 when the page is publicly accessible; extraction can still fail.
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
Thesummary 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
Summary examples (all four modes)
Summary examples (all four modes)
JSON schema reference and tips
JSON schema reference and tips
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
descriptionfields to guide extraction. - Use
enumfor consistent categorisation. - Keep schemas shallow and mark essential fields
required.
Screenshot capture
Screenshot capture
Python
Async processing
For 11-50 URLs (required above 10) or non-blocking workflows, use async mode. Submit URLs, get ajob_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.
Polling, job lifecycle, and status fields
Polling, job lifecycle, and status fields
The initial submit returns HTTP 202 with a Status response fields include:
job_id, poll_url, and a one-time webhook_secret (store it immediately - you cannot retrieve it later).Jobs move through these statuses:To poll manually:
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).Webhooks and signature verification
Webhooks and signature verification
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}". Verify the original request body before parsing or reserializing JSON. This example checks the signature; also check the timestamp against your accepted replay window and deduplicate processing by job ID:Limits and pricing
Failed and blocked URLs are free. For example, 8 successful URLs use 1.6 credits, or 3.2 with
summary set. total_cost_dollars (sync) and actual_cost_dollars (async) are the amounts charged. Each result’s price is the base extraction price only and excludes the AI add-on.
max_price_dollars caps the charge for a request. If the worst case exceeds it, the request is rejected with 400 before any work starts; if the actual cost exceeds it, you get 402.
Response format
Illustrative response:summary set, content is the AI summary (string) or extracted JSON (object), and each result adds summary_success.
Result fields
Result fields
Error handling
Each result carries astatus of success or failed. Failed results include a descriptive error (page unavailable, required sign-in, blocked, timed out) - inspect status before reading the content.
The following uses a raw HTTP response, rather than the SDK response model.
Next steps
API reference
Complete parameter documentation
Python SDK
Python integration
TypeScript SDK
TypeScript integration
Integrations
LangChain, LlamaIndex, and more