Wire up Valyu Search with the TypeScript SDK.
Basic usage
Common patterns
{ "nih.gov": 2, "nih.gov/research": -3 }).
Reference
Parameters
Parameters
query (string, required) - the search query. See the Prompting Guide.| Parameter | Type | Description | Default |
|---|---|---|---|
searchType | "web" | "proprietary" | "all" | "news" | Which sources to search | "all" |
maxNumResults | number | Results to return (1-20, up to 100 with the increased_max_results permission) | 10 |
maxPrice | number | Max cost per thousand retrievals (CPM). Auto-adjusts if not provided | undefined |
isToolCall | boolean | true for AI agents/tools, false for direct user queries | true |
relevanceThreshold | number | Minimum relevance score (0.0-1.0) | 0.5 |
includedSources | string[] | Sources to search within (dataset ids, domains, or presets) | undefined |
excludeSources | string[] | Sources to exclude | undefined |
sourceBiases | Record<string, number> | Bias ranking per source (-5 to +5) without hard filtering | undefined |
instructions | string | Natural-language instructions to rank by intent. Ignored in fast mode | undefined |
category | string | Deprecated. Use instructions | undefined |
startDate / endDate | string | Date filter (YYYY-MM-DD) | undefined |
countryCode | string | 2-letter ISO country code to bias results | undefined |
responseLength | string | number | "short" (25k), "medium" (50k), "large" (100k), "max" (full), or a custom character count | "short" |
fastMode | boolean | Reduced latency, shorter results | false |
urlOnly | boolean | Return URLs only (no content). Applies when searchType is "web" or "news" | false |
Response format
Response format
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.

