Wire up Valyu Search with the Python SDK.
Basic usage
Common patterns
{"nih.gov": 2, "nih.gov/research": -3}).
Reference
Parameters
Parameters
query (str, required) - the search query. See the Prompting Guide.| Parameter | Type | Description | Default |
|---|---|---|---|
search_type | "web" | "proprietary" | "all" | "news" | Which sources to search | "all" |
max_num_results | int | Results to return (1-20, up to 100 with the increased_max_results permission) | 10 |
max_price | float | Max cost per thousand retrievals (CPM). When omitted, all sources are searched regardless of cost | None |
is_tool_call | bool | True for AI agents/tools, False for direct user queries | True |
relevance_threshold | float | Minimum relevance score (0.0-1.0) | 0.5 |
included_sources | List[str] | Sources to search within (dataset ids, domains, or presets) | None |
excluded_sources | List[str] | Sources to exclude | None |
source_biases | Dict[str, int] | Bias ranking per source (-5 to +5) without hard filtering | None |
instructions | str | Natural-language instructions to rank by intent. Ignored in fast mode | None |
category | str | Deprecated. Use instructions | None |
start_date / end_date | str | Date filter (YYYY-MM-DD) | None |
country_code | str | 2-letter ISO country code to bias results | None |
response_length | str | int | "short" (25k), "medium" (50k), "large" (100k), "max" (full), or a custom character count | "short" |
fast_mode | bool | Reduced latency, shorter results | False |
url_only | bool | Return URLs only (no content). Applies when search_type is "web" or "news" | False |
Response format
Response format
Async (AsyncValyu)
Async (AsyncValyu)
AsyncValyu.search takes the same arguments and returns the same SearchResponse - the only difference is you await it. The common reason to use it is running several queries in parallel:asyncio.Semaphore - see the Python SDK overview for constructor options and lifecycle patterns.Source types
- Web - general websites, news, blogs, forums, documentation.
- Proprietary -
valyu/valyu-arxiv(arXiv papers),valyu/valyu-pubmed(medical literature),valyu/valyu-stocks(market data), and many more.

