Skip to main content
Extract clean, structured content from web pages, with optional AI summarization and structured data extraction.

Wire up Valyu Contents extraction with the Python SDK.

Open in Cursor

Basic usage

Common patterns

Set extract_effort="high" for JS-heavy pages or complex layouts, and response_length ("short" 25k, "medium" 50k, "large" 100k, "max", or an int) to control content per URL.
For arXiv, PubMed Central, bioRxiv, medRxiv, and ChemRxiv papers, Valyu serves clean processed markdown (with figures and equations) from its academic index when your plan covers the source - otherwise it uses the live crawler. Pass the paper URL (a /pdf/ arXiv link or a DOI works best) or bare id. See Academic Papers.

Reference

urls (List[str], required) - URLs to process (max 10 sync, max 50 async).

Async jobs (11-50 URLs)

Async mode is required above 10 URLs. Max 50 URLs per request, processed in batches of 5 with a 120s timeout per URL (vs 25s sync). Jobs expire after 7 days.
Webhooks are signed with HMAC-SHA256 over "{timestamp}.{json_body}". See the Content Extraction guide for verification.For full control, poll valyu.get_contents_job(job_id) yourself until status is completed, partial, or failed.
The AsyncValyu client calls Contents with async/await inside your event loop - distinct from the server-side async jobs above (async_mode=True). It’s the natural fit for many single-URL extractions in parallel:
You can combine both: submit a server-side async job through AsyncValyu and await valyu.wait_for_contents_job(job.job_id) without parking a thread. See the Python SDK overview for constructor options and lifecycle.