Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.valyu.ai/llms.txt

Use this file to discover all available pages before exploring further.

Control exactly which sources your search uses. Focus on trusted domains, access specific datasets, exclude unreliable sources, or soft-rank results toward preferred domains.
Source filters accept domains, URLs, dataset names, specific paths, or collections.
Save time with Collections! If you use the same source combinations frequently, create a Collection to bundle them and reference by name.

What You Can Do

  • Target authoritative sources - Focus on trusted domains and academic datasets
  • Block unreliable content - Exclude low-quality or biased sources
  • Soft-rank by domain - Boost or demote sources without hard filtering
  • Access specific datasets - Search Valyu’s proprietary collections
  • Improve result quality - Get more relevant, higher-quality information

Parameters

included_sources

Type: Array of stringsOnly search within these sources. Can include domains, URLs, or dataset names.Example: ["arxiv.org", "valyu/valyu-pubmed"]

excluded_sources

Type: Array of stringsExclude these sources from results. Same formats as included_sources.Example: ["example.com", "example.org"]

source_biases

Type: Object (domain → integer)Soft-rank sources from -5 (strong demotion) to +5 (strong boost) without hard filtering.Example: {"nasa.gov": 5, "example.com": -3}
If both included_sources and excluded_sources are provided, included_sources takes priority.
When to use source_biases vs hard filters: Use included_sources/excluded_sources when you need strict control over which sources appear. Use source_biases when you want to influence ranking — boosting authoritative domains or demoting low-quality ones — while still allowing all sources to appear if they’re highly relevant.

Source Formats

FormatExampleWhat It Does
Domain"arxiv.org"Includes/excludes entire domain
Base URL"https://docs.aws.amazon.com"Includes/excludes entire site
Specific Path"nasa.gov/news"Targets only that path
Dataset Name"valyu/valyu-arxiv"Searches Valyu’s proprietary datasets
Collection"collection:my-sources"Expands to all sources in your saved collection
Path Specificity: When using paths (e.g., "valyu.ai/blog"), only that exact path is affected. For entire domains, use just the domain name.

Examples

Academic Sources

from valyu import Valyu

valyu = Valyu("your-api-key-here")
response = valyu.search(
    "quantum computing error correction",
    included_sources=[
        "valyu/valyu-arxiv",
        "valyu/valyu-pubmed",
        "valyu/valyu-biorxiv",
        "valyu/valyu-medrxiv"
    ],
    search_type="all"
)

Exclude Non-Government Sources

from valyu import Valyu

valyu = Valyu("your-api-key-here")
response = valyu.search(
    "artificial intelligence safety research",
    excluded_sources=[
        "example.com",
        "example.org",
        "example.net"
    ]
)

Official Documentation

from valyu import Valyu

valyu = Valyu("your-api-key-here")
response = valyu.search(
    "React server components best practices",
    included_sources=[
        "https://react.dev/",
        "https://nextjs.org/docs",
        "https://docs.aws.amazon.com/",
        "developer.mozilla.org"
    ]
)

Use Cases

Financial Research

from valyu import Valyu

valyu = Valyu("your-api-key-here")
response = valyu.search(
    "cryptocurrency regulation impact banking sector",
    included_sources=[
        "federalreserve.gov",
        "sec.gov", 
        "sec.gov/cgi-bin/browse-edgar",
        "treasury.gov",
        "imf.org"
    ],
    max_num_results=15
)

Medical Research

from valyu import Valyu

valyu = Valyu("your-api-key-here")
response = valyu.search(
    "immunotherapy cancer treatment efficacy",
    included_sources=[
        "valyu/valyu-pubmed",
        "valyu/valyu-clinical-trials",
        "valyu/valyu-drug-labels",
        "valyu/valyu-medrxiv"
    ],
    search_type="proprietary"
)

Technical Documentation

from valyu import Valyu

valyu = Valyu("your-api-key-here")
response = valyu.search(
    "Kubernetes security best practices RBAC",
    included_sources=[
        "kubernetes.io/docs",
        "docs.aws.amazon.com",
        "cloud.google.com/kubernetes-engine/docs"
    ]
)

News

from valyu import Valyu

valyu = Valyu("your-api-key-here")
response = valyu.search(
    "artificial intelligence regulation European Union",
    included_sources=[
        "scholar.google.com",
        "gov.uk/search/news",
        "who.int",
        "europa.eu",
        "politico.eu"
    ]
)

Source Biases

Source biases let you influence ranking without hard filtering. Unlike included_sources/excluded_sources, biased sources can still appear (or be absent) based on relevance — biases just nudge the ranking. Values range from -5 (strong demotion) to +5 (strong boost). A value of 0 has no effect.

Boost Government Sources

from valyu import Valyu

valyu = Valyu("your-api-key-here")
response = valyu.search(
    "climate change policy impact",
    source_biases={
        "epa.gov": 5,
        "nasa.gov": 4,
        "noaa.gov": 3,
        "nih.gov": 2,
        "example.com": -4
    }
)

Combine with Hard Filters

You can use source_biases alongside included_sources or excluded_sources for fine-grained control:
from valyu import Valyu

valyu = Valyu("your-api-key-here")
response = valyu.search(
    "federal research funding allocation",
    excluded_sources=["example.com", "example.org"],
    source_biases={
        "nsf.gov": 5,
        "nih.gov": 4,
        "energy.gov": 3
    }
)