Skip to main content
POST
Retrieve ranked results with source URLs and extracted content. Use Search when your application controls the queries, evidence selection and final response.

Choose the source boundary

Use search_type="web" for web pages or "news" for news. Use included_sources to select dataset IDs, supported presets or domains. The "proprietary" option is the API’s name for its dataset search route; it does not mean every source contains privately owned or exclusive information. By default, included_sources is advisory: when you list two or more dataset IDs, Valyu may search only the most relevant of them for the query. To search every listed dataset, set scope_policy: "strict" and pass 1-128 dataset IDs (no presets, domains or "web"). Strict responses include a source_scope receipt showing which datasets were searched and which returned results. A dataset with no results was not necessarily searched in full. scope_policy is not in the SDKs yet, so send it over HTTP. excluded_sources accepts domains, dataset IDs and preset names such as "finance". site: and -site: operators in the query filter every result, web and dataset alike. Check available sources before relying on a dataset. Request include_abstracts=true to expand PubMed searches beyond papers with available full text. More returned characters do not guarantee access to a complete document. Set include_image_links to false to replace each image with its alt text. For example, ![Product photo](https://example.com/p.jpg) becomes [Image: Product photo]. The API removes an image with no alt text. Other links do not change. The default is true. See remove image links.

Use the results

Keep each result’s url, source and available date alongside its content. Handle empty result sets explicitly. Read warnings too: it says what was skipped or adjusted, for example named datasets outside your plan. See warnings. A relevance score measures the match to a query, not the truth of a claim. total_deduction_dollars is the amount charged for the request and each result’s price is its share. Web results use 0.1 credits each; dataset prices are listed in Datasources. See pricing. Start with a specific question and five results, then adjust source filters and result length against representative tasks. Use DeepResearch when you want to run the investigation and receive a report.

Authorizations

X-API-Key
string
header
required

API key for authentication. Get yours at platform.valyu.ai.

Body

application/json

Search request parameters.

query
string
required

The search query to execute. Supports natural language queries.

Example:

"latest developments in quantum computing"

max_num_results
integer
default:5

Maximum number of results to return. Higher limits (up to 100) are available on request. A value above your limit is lowered to it, and the response carries a max_num_results_capped warning.

Required range: 1 <= x <= 20
Example:

10

search_type
enum<string>
default:all

Controls which data sources are searched.

  • all - Web and proprietary sources (default). An LLM router selects the best sources for your query.
  • web - Web search only. Best for current events and general topics.
  • proprietary - Academic, financial, and premium sources only. Best for research and technical analysis.
  • news - News articles only. Best for recent news and current events.
Available options:
all,
web,
proprietary,
news
Example:

"all"

max_price
number

Caps the cost of the whole request. This is not a token limit or a per-result ceiling. When omitted, the default is 1000. See pricing.

Before searching, the request is checked against its worst-case cost and rejected with 400 (Insufficient max_price. Search requires max_price >= X for your query) if the budget is too low. For example, 10 web results need max_price >= 6.25.

Required range: x > 0
Example:

20

relevance_threshold
number
default:0.5

Minimum relevance score (0.0-1.0) for results after reranking. Results below this threshold are filtered out.

Required range: 0 <= x <= 1
Example:

0.5

included_sources
string[]

Sources to include in the search. Accepts:

  • Domain names or URLs for web filtering (e.g. "arxiv.org", "https://arxiv.org")
  • Dataset identifiers for proprietary sources (e.g. "valyu/valyu-arxiv")
  • Preset names that expand to curated source groups: "academic", "finance", "patent", "transportation", "politics", "legal", "health", "genomics", "chemistry", "physics"
  • "web" keyword to explicitly include web search alongside proprietary sources
  • "collection:NAME" to reference an org-scoped saved source collection

With the default scope_policy: "advisory", a list of two or more dataset IDs is treated as guidance: Valyu may search only the most relevant of them for the query. Set scope_policy: "strict" to search every listed dataset.

Datasets above your plan are dropped; if none remain, the request returns 403 tier_insufficient. DeepResearch-only datasets are dropped when listed alongside other sources, and return 403 when they are the only sources requested.

Note: most specialised and proprietary sources require a subscription. All plans include web search and open academic sources (arXiv, PubMed).

Example:
excluded_sources
string[]

Sources to exclude from the search. Accepts domain names, URLs, dataset identifiers and preset names (e.g. "finance", "academic"). Excluded datasets and presets are never searched. With scope_policy: "strict", only dataset identifiers are accepted, and they are removed from the included_sources list.

Example:
scope_policy
enum<string>
default:advisory

How included_sources is applied to datasets.

  • advisory (default) - included_sources guides source selection. With two or more dataset IDs, Valyu may search only the most relevant of them.
  • strict - search exactly the dataset IDs in included_sources, minus any in excluded_sources. Requires 1-128 dataset IDs. Presets, domains, URLs, "web" and search_type: "web" are rejected, and web search is skipped. The response includes a source_scope receipt.

Strict errors: 400 invalid_scope_policy (unknown value), 400 invalid_strict_source_scope (missing, empty or oversized list, a non-dataset entry, or nothing left after exclusions), 400 unsupported_strict_source (a dataset Search cannot serve), and 403 dataset_outside_task_scope (a dataset outside your plan or grants; no partial fallback).

Not yet in the Python or TypeScript SDKs. Send it in the request body over HTTP.

Available options:
advisory,
strict
Example:

"strict"

source_biases
object | null

Bias values for specific sources to influence ranking without hard filtering. Keys are domains (e.g., 'nasa.gov') or URL paths (e.g., 'nih.gov/research'). Values are integers from -5 (strong demotion) to +5 (strong boost). Most specific path match wins.

Example:
instructions
string

Natural language instructions to help rank results by relevance to user intent. Acts as a system prompt for the search. Max 500 characters. Ignored when fast_mode is true.

Maximum string length: 500
Example:

"Focus on oncology clinical trials from 2023 onwards"

category
string
deprecated

Deprecated. Use instructions instead. Falls back to this value if instructions is not set.

Maximum string length: 500
is_tool_call
boolean
default:true

Indicates whether this request originates from an AI tool call. Affects query rewriting behavior.

response_length
default:short

Controls the maximum character length of content per result.

  • "short" - 25,000 characters (default)
  • "medium" - 50,000 characters
  • "large" - 100,000 characters
  • "max" - No limit
  • Any positive integer for a custom character limit
Available options:
short,
medium,
large,
max
Example:

"short"

start_date
string

Filter results published on or after this date. Accepts YYYY, YYYY-MM-DD or an ISO-8601 datetime. Sub-day timestamps require historical_cache: true. If set without end_date, end_date defaults to today.

Example:

"2024-01-01"

end_date
string

Filter results published on or before this date. Accepts YYYY, YYYY-MM-DD or an ISO-8601 datetime. Sub-day timestamps require historical_cache: true. If set without start_date, start_date defaults to 1900-01-01. start_date must be on or before end_date.

Example:

"2024-12-31"

country_code
enum<string>

ISO 3166-1 alpha-2 country code for geo-targeted web search results.

Available options:
ALL,
AR,
AU,
AT,
BE,
BR,
CA,
CL,
DK,
FI,
FR,
DE,
HK,
IN,
ID,
IT,
JP,
KR,
MY,
MX,
NL,
NZ,
NO,
CN,
PL,
PT,
PH,
RU,
SA,
ZA,
ES,
SE,
CH,
TW,
TR,
GB,
US
Example:

"US"

fast_mode
boolean
default:false

Skip query rewriting and reranking for lower latency. Searches the web and financial data in parallel. Cannot be used with search_type: "proprietary".

url_only
boolean
default:false

Return only URLs without full content extraction. Only available when search_type is "web" or "news". Skips reranking.

historical_cache
boolean
default:false

Prefer cached content captured within the requested date window instead of the latest crawl. Requires a date range. With the default historical_cache_strict="prefer", a result can fall back to a live crawl when no suitable snapshot exists. Use "only" to drop results without a qualifying snapshot; neither mode guarantees complete historical coverage or reproduces an entire past search index.

historical_cache_strict
enum<string>
default:prefer

Snapshot policy when historical_cache is true. "prefer" uses an in-window snapshot when available and otherwise may fall back to a live crawl. "only" drops results without a snapshot captured at or before the end-date cutoff. "off" disables strict snapshot filtering. Empty results are possible in every mode. For backtests, inspect record dates and snapshot evidence; publication-date filters alone do not establish point-in-time validity.

Available options:
off,
prefer,
only
include_abstracts
boolean
default:false

Expand PubMed search from papers with available full text to the complete abstract corpus. Results include the abstract and, when full text is available, the most relevant full-text chunks. Has no effect on other sources.

Keep image URLs in the content. When true (default), images stay as markdown, for example ![Product photo](https://example.com/p.jpg). When false, each image becomes [Image: Product photo]. The API removes the image URL and keeps the alt text. The API removes an image with no alt text. A linked image [![alt](src)](href) becomes [[Image: alt]](href). Other links do not change. Set false to use fewer tokens.

hls_coverage
enum<string>
default:hls

Coverage for Wiley Health & Life Sciences (wiley/wiley-hls) searches. hls returns licensed Wiley content only. increased_coverage blends it with open-access biomedical literature in one ranked result set. See Wiley HLS.

Available options:
hls,
increased_coverage
Example:

"hls"

Response

Search completed successfully with results.

Search response containing results and metadata.

success
boolean
required

Whether the search completed successfully.

Example:

true

tx_id
string
required

Transaction ID for tracking and support.

Example:

"tx_a1b2c3d4-e5f6-7890-abcd-ef1234567890"

query
string
required

The original query as submitted.

Example:

"latest developments in quantum computing"

results
object[]
required

Search results ordered by relevance.

results_by_source
object
required

Count of results broken down by source type.

Example:
total_deduction_dollars
number
required

Total cost charged for this search.

Example:

0.0009375

total_characters
integer
required

Sum of all result content lengths in characters.

Example:

174

error
string | null

Error or warning message. May be non-empty even on successful responses if some sources had issues.

Example:

null

warnings
object[]

What the search skipped or adjusted, for example named datasets outside your plan. Present only when there is something to say. New warning types may be added at any time. See Warnings.

source_scope
object

Receipt for a scope_policy: "strict" request. Present only for strict requests. It shows which datasets were dispatched and which returned rows. It does not certify full coverage: a dataset with no returned rows was not necessarily searched and found empty.