Complete Valyu API toolkit for AI agents. Use this skill when asked to perform real-time search across web, academic, medical, transportation, financial sources, content extraction from URLs, AI-powered answers with citations, or comprehensive deep research reports.
Use the skills CLI to install this skill with one command. Auto-detects all installed AI assistants.
Method 1 - skills CLI
npx skills i valyuAI/skills/valyu-search/valyu-best-practicesMethod 2 - openskills (supports sync & update)
npx openskills install valyuAI/skillsAuto-detects Claude Code, Cursor, Codex CLI, Gemini CLI, and more. One install, works everywhere.
Installation Path
Download and extract to one of the following locations:
No setup needed. Let our cloud agents run this skill for you.
Select Provider
Select Model
Best for coding tasks
Environment setup included
This skill provides instructions for using the Valyu API to perform search, content extraction, AI-powered answers, and deep research tasks.
Use this decision tree to select the appropriate Valyu API:
What do you need?
├─ Find information across multiple sources
│ └─ Use Search API
│
├─ Extract content from specific URLs
│ └─ Use Contents API
│
├─ Get an AI-synthesized answer with citations
│ └─ Use Answer API
│
├─ Generate a comprehensive research report
│ └─ Use DeepResearch API
│
└─ Discover available data sources
└─ Use Datasources API
CRITICAL: When writing code that uses the Valyu API, you MUST use the official SDK libraries. NEVER make raw HTTP/fetch calls to the Valyu API endpoints.
valyu-jsnpm install valyu-js
# or
pnpm add valyu-jsimport { Valyu } from 'valyu-js';
const valyu = new Valyu(process.env.VALYU_API_KEY);
// Now use valyu.search(), valyu.contents(), valyu.answer(), valyu.deepResearchvalyupip install valyu
# or
uv add valyufrom valyu import Valyu
valyu = Valyu(api_key=os.environ.get("VALYU_API_KEY"))
# Now use valyu.search(), valyu.contents(), valyu.answer(), valyu.deep_research// DON'T make raw fetch calls
const response = await fetch('https://api.valyu.ai/v1/search', {
method: 'POST',
headers: {
'x-api-key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({ query: '...' })
});// DO use the SDK
import { Valyu } from 'valyu-js';
const valyu = new Valyu(process.env.VALYU_API_KEY);
const response = await valyu.search({ query: '...' });Purpose: Find information across web, academic, medical, transportation, financial, news, and proprietary sources.
const response = await valyu.search({
query: "transformer architecture attention mechanism 2024",
searchType: "all",
maxNumResults: 10
});| Type | Use For |
|---|---|
all | Everything - web, academic, financial, proprietary |
web | General internet content only |
proprietary | Licensed academic papers and research |
news | News articles and current events |
| Parameter (TS/JS) | Parameter (Python) | Purpose | Example |
|---|---|---|---|
query | query | Search query (under 400 chars) | "CRISPR gene editing 2024" |
searchType | search_type | Source scope | "all", "web", "proprietary", "news" |
Academic Research:
await valyu.search({
query: "CRISPR therapeutic applications clinical trials",
searchType: "proprietary",
includedSources: ["valyu/valyu-arxiv", "valyu/valyu-pubmed", "valyu/valyu-biorxiv"],
startDate: "2024-01-01"
});Financial Analysis:
await valyu.search({
query: "Apple revenue Q4 2024 earnings",
searchType: "all",
includedSources: ["valyu/valyu-sec-filings", "valyu/valyu-earnings-US"]
});News Monitoring:
await valyu.search({
query: "AI regulation EU",
searchType: "news",
startDate: "2024-06-01",
countryCode: "EU"
});For detailed patterns, see:
Purpose: Extract clean, structured content from web pages optimized for LLM processing.
const response = await valyu.contents({
urls: ["https://example.com/article"]
});const response = await valyu.contents({
urls: ["https://arxiv.org/abs/2401.12345"],
summary: "Extract key findings in 3 bullet points"
});const response = await valyu.contents({
urls: ["https://example.com/product"],
summary: {
type: "object",
properties: {
product_name: { type: "string" },
price: { type: "number" },
features: { type: "array", items: { type: "string" } }
},
required: ["product_name", "price"
| Parameter (TS/JS) | Parameter (Python) | Purpose | Example |
|---|---|---|---|
urls | urls | URLs to process (1-10) | ["https://example.com"] |
responseLength | response_length | Content length | "short", "medium", "large", "max" |
For detailed patterns, see:
Purpose: Get AI-powered answers grounded in real-time search results with citations.
const response = await valyu.answer({
query: "What are the latest developments in quantum computing?"
});const response = await valyu.answer({
query: "Current Bitcoin price and 24h change",
fastMode: true
});const response = await valyu.answer({
query: "Compare React and Vue for enterprise applications",
systemInstructions: "Provide a balanced comparison with pros and cons. Format as a comparison table."
});const stream = await valyu.answer({
query: "Explain transformer architecture",
streaming: true
});
for await (const chunk of stream) {
// Handle: search_results, content, metadata, done, error
console.log(chunk);
}const response = await valyu.answer({
query: "Apple Q4 2024 financial highlights",
structuredOutput: {
type: "object",
properties: {
revenue: { type: "string" },
growthRate: { type: "string" },
keyHighlights: { type: "array", items: { type: "string" } }
}
}
});| Parameter (TS/JS) | Parameter (Python) | Purpose | Example |
|---|---|---|---|
query | query | Question to answer | "What is quantum computing?" |
fastMode | fast_mode | Lower latency | true |
systemInstructions | system_instructions |
For detailed patterns, see:
Purpose: Generate comprehensive research reports with detailed analysis and citations.
| Mode | Duration | Best For |
|---|---|---|
fast | ~5 minutes | Quick lookups, simple questions |
standard | ~10-20 minutes | Balanced research (most common) |
heavy | ~90 minutes | Comprehensive analysis, complex topics |
const task = await valyu.deepResearch.create({
query: "AI chip market competitive landscape 2024",
model: "standard"
});
// Returns: { deepresearch_id: "abc123", status: "queued" }const status = await valyu.deepResearch.getStatus(task.deepresearch_id);
// status: "queued" | "running" | "completed" | "failed" | "cancelled"
if (status.status === "completed") {
console.log(status.output); // Markdown report
console.log(status.sources); // Cited sources
console.log(status.pdf_url); // PDF download link
}| Parameter (TS/JS) | Parameter (Python) | Purpose | Example |
|---|---|---|---|
query | query | Research question | "AI market trends 2024" |
model | model | Research depth | "fast", "standard", "heavy" |
outputFormat |
For detailed patterns, see:
| Element | Description | Example |
|---|---|---|
| Intent | What you need | "latest advancements" vs "overview" |
| Domain | Topic terminology | "transformer architecture" |
| Constraints | Filters | "2024", "peer-reviewed" |
| Source type | Where to look | academic papers, SEC filings |
BAD: "I want to know about AI"
GOOD: "transformer attention mechanism survey 2024"
BAD: "Apple financial information"
GOOD: "Apple revenue growth Q4 2024 earnings SEC filing"
BAD: "gene editing research"
GOOD: "CRISPR off-target effects therapeutic applications 2024"
# Don't do this
"Tesla stock performance, new products, and Elon Musk statements"
# Do this instead
Query 1: "Tesla stock performance Q4 2024"
Query 2: "Tesla Cybertruck production updates 2024"
Query 3: "Tesla FSD autonomous driving progress"
Use includedSources for domain authority:
Financial Research Collection. Some sources to include:
valyu/valyu-sec-filings - SEC regulatory filingsvalyu/valyu-stocks - Stock market datavalyu/valyu-earnings-US - Earnings reportsreuters.com - Financial newsbloomberg.com - Market analysis
Medical Research Collection. Some sources to include:valyu/valyu-pubmed - Medical literaturevalyu/valyu-clinical-trials - Clinical trial datavalyu/valyu-drug-labels - FDA drug informationnejm.org - New England Journal of Medicinethelancet.com - The Lancet
Tech Documentation Collection. Some sources to include:docs.aws.amazon.com - AWS documentationcloud.google.com/docs - Google Cloud docslearn.microsoft.com - Microsoft docskubernetes.io/docs - Kubernetes docs// Academic
includedSources: ["valyu/valyu-arxiv", "valyu/valyu-pubmed", "nature"]
// Financial
includedSources: ["valyu/valyu-sec-filings", "bloomberg.com", "reuters.com"]
// Tech news
includedSources: ["techcrunch.com", "theverge.com", "arstechnica.com"]For complete prompting guide, see references/prompting.md.
// 1. Quick search to find sources
const searchResults = await valyu.search({
query: "CRISPR therapeutic applications",
searchType: "proprietary",
maxNumResults: 20
});
// 2. Extract key content from top results
const contents = await valyu.contents({
urls: searchResults.results.slice(
// 1. Get SEC filings
const filings = await valyu.search({
query: "Apple 10-K 2024",
includedSources: ["valyu/valyu-sec-filings"]
});
// 2. Quick synthesis
const summary = await valyu.answer({
query: "Apple Q4 2024 financial highlights",
fastMode: true
Valyu provides access to 25+ specialized datasets:
| Category | Examples |
|---|---|
| Academic | arXiv (2.5M+ papers), PubMed (37M+), bioRxiv, medRxiv |
| Financial | SEC filings, earnings transcripts, stock data, crypto |
| Healthcare | Clinical trials, DailyMed, PubChem, drug labels, ChEMBL, DrugBank, Open Target, WHO ICD |
| Economic | FRED, BLS, World Bank, US Treasury, Destatis |
| Predictions | Polymarket, Kalshi |
| Patents | US patent database |
| Transportation | UK Rail, Ship Tracking |
For complete datasource reference, see references/datasources.md.
For complete API documentation including all parameters, response structures, and error codes, see references/api-guide.md.
Platform-specific integration documentation:
maxNumResultsmax_num_results |
| Number of results (1-20) |
10 |
includedSources | included_sources | Limit to specific sources | ["valyu/valyu-arxiv", "valyu/valyu-pubmed"] |
startDate / endDate | start_date / end_date | Date filtering | "2024-01-01" |
relevanceThreshold | relevance_threshold | Minimum relevance (0-1) | 0.7 |
extractEffortextract_effort |
| Extraction quality |
"normal", "high", "auto" |
summary | summary | AI summarization | true, "instructions", or JSON schema |
screenshot | screenshot | Capture screenshots | true |
| AI directives |
"Be concise" |
structuredOutput | structured_output | JSON schema | {type: "object", ...} |
streaming | streaming | Enable SSE streaming | true |
dataMaxPrice | data_max_price | Dollar limit | 1.0 |
output_format |
| Report format |
"markdown", "pdf" |
includedSources | included_sources | Source filtering | ["valyu/valyu-arxiv", "techcrunch.com"] |
startDate / endDate | start_date / end_date | Date range | "2024-01-01" |
developer.mozilla.org - MDN Web Docs