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 TypeScript SDK.

Open in Cursor

Basic usage

Common patterns

Set extractEffort: "high" for JS-heavy pages or complex layouts, and responseLength ("short" 25k, "medium" 50k, "large" 100k, "max", or a number) 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 (string[], 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.
For full control, poll valyu.getContentsJob(job.job_id) yourself until status is completed, partial, or failed.The SDK exports verifyContentsWebhookSignature():
See the Content Extraction guide for details.
waitForJob() options: pollInterval (ms, default 5000), maxWaitTime (ms, default 7200000), onProgress (callback).