Skip to main content
The Valyu Python SDK gives you search, content extraction and DeepResearch through one API.

Install

Authenticate

Get your API key from the Valyu Platform. Accounts get 2,000 free credits a month with a work email (1,000 with a personal email; add a card after your first month to keep them coming). The SDK reads VALYU_API_KEY from the environment automatically:

First call

Check success before reading Search results. Other methods have endpoint-specific response types; streaming methods return chunks, and wait helpers may raise errors.

APIs

Search

Search web and specialist sources

Contents

Extract and process web content

DeepResearch

Autonomous async research reports
For source discovery, see Datasources. For research workflows, see batch tasks and review checkpoints.
For multi-step synthesis or cited reports, reach for DeepResearch. Use Search when your application should own query planning and synthesis.

Async client

AsyncValyu is the async/await counterpart to Valyu: same arguments, same response objects, same validation. Every method is a coroutine you await. Reach for it when a single request fans out several Valyu calls (research agents, multi-source lookups) or runs inside an async web service. For one-off scripts and notebooks, the synchronous client is simpler.
Cap how many requests are in flight with a semaphore (keep it aligned with max_connections):
Use asyncio.as_completed to process each result the moment it’s ready instead of waiting for the whole batch.
Instantiate the client once at startup and share it - don’t create a fresh AsyncValyu per request, or you throw away the connection pool every time.
Prefer async with for scripts so the pool is released deterministically. For long-lived services, call aclose() on shutdown (it’s idempotent).
AsyncValyu currently exposes search, contents, get_contents_job, and wait_for_contents_job. Use the synchronous Valyu client for deepresearch and datasources.

Support