Make your first call
query (no site:, AND, OR, or quotes - Valyu is semantic, not keyword). Read total_deduction_dollars from the response to track spend.
Search types
| Type | Searches | Use for |
|---|---|---|
all | Web + proprietary (default) | Comprehensive coverage |
web | Web only | Current events, general topics |
proprietary | Research, financial, premium sources | Research, technical analysis |
news | News articles only | Current news and journalism |
Drop Search into your agent
Hand this prompt to your coding agent (Cursor, Claude Code, Copilot) to wire up Search end to end.Integrate Valyu Search into your AI agent, with guidance on when to escalate to DeepResearch and which sources need a plan.
Common parameters
The essentials you’ll reach for most. See the full parameter reference below for everything else.| Parameter | Default | What it does |
|---|---|---|
query | - | Natural-language query (required) |
search_type | all | all, web, proprietary, or news |
max_num_results | 5 | Results to return (1-20; up to 100 with the increased_max_results permission) |
response_length | short | Content per result: short, medium, large, max, or a char count |
relevance_threshold | 0.5 | Drop matches below this score (0-1) |
included_sources | [] | Restrict to datasets, domains, presets, or collection:<name> |
max_price | 1000 | Cost ceiling per 1k results (CPM) |
Filtering
Sources
Include, exclude, or soft-rank domains and datasets.
Dates
Filter by publication date.
Collections
Save reusable source bundles.
All parameters
SDK arguments use camelCase in TypeScript (maxNumResults) and snake_case in Python (max_num_results).
Full parameter reference
Full parameter reference
Natural-language search query. Use semantic phrasing, not operators (no
site:, AND, OR, or quotes).Number of results to return. 1-20 by default; up to 100 with the
increased_max_results permission on your API key.all (web + proprietary), web, proprietary, or news.Minimum relevance score (0-1). Results below the threshold are dropped. Raise it for precision, lower it for recall.
Maximum price per thousand results (CPM) you are willing to pay. Acts as a cost ceiling. Web search is ~$1.50/1k, proprietary ~$0.50/1k.
Restrict the search to these sources. Accepts dataset ids (
valyu/valyu-arxiv), domains/URLs (arxiv.org), presets (academic, finance, patent, …), collections (collection:<name>), or the keyword web.Exclude these sources. Same formats as
included_sources. If both are set, included_sources wins.Soft-rank sources without hard filtering. Map each source to an integer from
-5 (strong demotion) to +5 (strong boost); 0 is neutral.Content returned per result:
short (~25k chars), medium (~50k), large (~100k), max (full content), or an exact integer character count.Natural-language category hint to steer ranking (e.g.
"machine learning"). Max 500 characters.Free-text instructions that guide how results are selected and ranked. Max 500 characters.
Include content published on or after this date. Format
YYYY-MM-DD.Include content published on or before this date. Format
YYYY-MM-DD.ISO 3166-1 alpha-2 country code to bias results toward a region (e.g.
"GB", "US"). Use ALL for no preference.true optimises results for LLM consumption (the default for agents); false optimises for human reading.Lower-latency responses with shorter content. Cannot be combined with
search_type="proprietary".Return URLs and metadata without extracting full content. Only valid with
search_type="web" or "news".Allow results to be served from the historical cache where available.
Fast mode (lower latency)
Fast mode (lower latency)
Returns quicker responses with shorter content. Good for general queries. Cannot be combined with
search_type="proprietary".Returning up to 100 results
Returning up to 100 results
The default maximum is 20 results per query. To return up to 100, request the
increased_max_results permission:- Go to API Key Management
- Request the
increased_max_resultspermission - Create a new API key after approval
Python
Error handling
Error handling
Python
Response format
Top-level fields
Top-level fields
| Field | Description |
|---|---|
success | Whether the search completed successfully |
error | Empty on success; error message otherwise |
tx_id | Transaction ID for tracing and support |
query | The processed search query |
results | Array of result objects, ranked by relevance |
results_by_source | Result counts split into web vs proprietary |
total_deduction_dollars | Total cost in USD |
total_characters | Total characters across results |
Result fields
Result fields
| Field | Description |
|---|---|
title | Document or article title |
url | Canonical URL (may include tracking parameters) |
content | Extracted text, trimmed per response_length |
description | Brief summary |
source | Source category: web, academic, etc. |
price | Cost in USD for this result |
length | Character count |
source_type | Specific source classification (see below) |
publication_date | ISO 8601 date when available |
relevance_score | Score between 0 and 1 |
image_url | Extracted images |
doi, authors, citation, citation_count, references | Academic results only |
metadata | Additional structured metadata (financial/specialized) |
Source types
Source types
| Type | Description |
|---|---|
general | General knowledge (e.g., Wikipedia) |
website | General web pages |
forum | Forums and Q&A sites |
paper | Academic papers (arXiv, etc.) |
data | Market data and analytics |
report | SEC regulatory filings |
health_data | Global health indicators |
clinical_trial | Clinical trial summaries from ClinicalTrials.gov |
drug_label | FDA drug labels from DailyMed |
grants | NIH funding data |
Next steps
Prompting guide
Write queries that get better results
Tips & tricks
Optimise performance and control costs
API reference
Complete parameter documentation
Data sources
Every source you can target

