Page updated:

Web Search Configuration

Scheduled Web Search (added in v6.12.0) is TrendRadar's third data source alongside trending hotlists and RSS feeds. Hotlists show what everyone is talking about today, RSS follows fixed sites, and Web Search acts like a dedicated research assistant that actively searches the open web on schedule for your specific topics — such as regulations, company announcements, open-source releases, or niche industry updates.

Comparing the Three Data Sources

AspectTrending HotlistsRSS FeedsWeb Search
CollectionFetch real-time rankings from mainstream platformsPull articles from specified feed URLsActively search the open web by topic list
FilteringFiltered by keywords or AI smart filterOptional keyword filter + freshness filterBypasses keyword filter; uses quality score, authority & dedup funnel
Storageoutput/news/{date}.dboutput/rss/{date}.dboutput/search/{date}.db
Best forPublic buzz & real-time hot topicsBlogs, media outlets, tech communitiesRegulations, competitor news, releases, niche research

3 Steps to Enable

1
Set up an API Key
Uses the DeepSeek native Web Search API by default. If you already configured a DeepSeek AI_API_KEY (with a deepseek model), Web Search reuses it automatically.
To use a separate key, set WEB_SEARCH_API_KEY (or DEEPSEEK_API_KEY) in GitHub Secrets / .env, or fill web_search.providers.deepseek.api_key in config/config.yaml.
2
Add topics to search_queries.txt
Edit config/search_queries.txt (or use the Visual Config Editor). Leave a blank line to start a new topic.
3
Enable and verify
Set web_search.enabled: true in config/config.yaml (or set WEB_SEARCH_ENABLED=true), then run uv run python -m trendradar --doctor to verify your key and query file.

Query File Syntax (search_queries.txt)

config/search_queries.txt uses simple blank-line blocks: a blank line starts a new search topic. Multiple query lines inside the same block are merged and deduplicated by URL. Lines starting with # are comments.
# Global exclusions (optional, applied to all topics)
[GLOBAL_FILTER]
clickbait
-site:example-spam.com

# Search topics (blank line = new topic)
[SEARCH_TOPICS]

# Example 1: multiple query lines merged and deduplicated
[AI Policy & Regulation]
AI infrastructure regulation policy latest update
AI compute subsidy pilot policy
@8
~7d

# Example 2: restrict to official sites within the last 14 days
[Official Low-Altitude Policy]
low altitude economy policy site:gov.cn
@5
~14d

# Example 3: single-line topic (line itself becomes the display title)
DeepSeek new open source model release
SyntaxDescription
[Topic Name]Optional first line of a block to set a custom display title; if omitted, the first query line is used
site:domainRestrict results to a specific domain, e.g. site:gov.cn for official government sites
-site:domainExclude results from a domain; placing it under [GLOBAL_FILTER] applies to all topics
!wordExclude results whose title or snippet contains the word; works globally under [GLOBAL_FILTER]
@numberOverride max displayed items for this topic, e.g. @5 keeps at most 5 items
~NdOverride freshness window in days for this topic, e.g. ~3d for last 3 days, ~0d for unlimited
@provider:nameOverride the search engine for this topic; defaults to web_search.provider in config.yaml

Core Settings & Quality Funnel

Tune candidate recall, quality thresholds, and query mode under web_search in config/config.yaml:
web_search:
  enabled: true                     # Master switch for Web Search
  provider: "deepseek"              # Default provider
  queries_file: ""                  # Empty uses config/search_queries.txt
  query_mode: "direct"              # direct = search as written | smart = AI distills prompts (cached daily)

  # Quality funnel
  fetch_count: 20                   # Wide candidate recall per query (1-50 on DeepSeek)
  max_items_per_topic: 8            # Display cap per topic after filtering
  freshness_days: 7                 # Keep pages from the last 7 days (0 = unlimited)
  dedup_days: 7                     # Avoid repeating the same URL across 7 days
  min_score: 0.5                    # Relevance threshold (0.0-1.0)
  min_authority: -1                 # Site authority threshold (-1 any, 2-4 authoritative/official)
  allow_unknown_authority: true     # Keep freshly published pages without authority score

  need_content: false               # Fetch full webpage bodies (snippets are usually enough)
  notification_show_snippet: false  # Include short snippets in IM messages (HTML reports always show them)

  providers:
    deepseek:
      api_key: ""                   # Empty falls back to WEB_SEARCH_API_KEY / DEEPSEEK_API_KEY / AI_API_KEY
      api_base: "https://api.deepseek.com"
      localization: ""              # Optional IP hint for regional relevance
FieldDefaultDescription
enabledfalseMaster switch for Web Search (also configurable via WEB_SEARCH_ENABLED=true)
provider"deepseek"Search provider identifier; defaults to DeepSeek native Web Search API with multi-provider extensibility
queries_file""Path to search queries file; empty uses config/search_queries.txt, custom files can live in config/custom/search/
query_mode"direct"direct = search lines as written (no extra AI calls); smart = AI distills plain-language prompts and caches daily
fetch_count20Wide candidate count requested per query (1-50 on DeepSeek; same per-request cost)
max_items_per_topic8Maximum displayed items per topic after quality filtering (0 = unlimited)
freshness_days7Only keep pages published within the last N days (0 = no limit)
dedup_days7Cross-day URL deduplication window so recently seen pages are not pushed as new again (0 = same-day only)
min_score0.5Relevance score threshold (0.0-1.0); 0.5 matches DeepSeek recommended quality cutoff (1.5/3.0). Lower to 0.35 for niche topics
min_authority-1Site authority threshold (-1 any, 0 normal, 2-3 authoritative media, 4 official sites)
allow_unknown_authoritytrueKeep newly published pages whose domain has no authority rating yet
need_contentfalseWhether to fetch full webpage bodies; built-in snippets/summaries are sufficient for normal pushes and AI analysis
notification_show_snippetfalseInclude short snippets in IM push messages (HTML reports always display snippets)
direct vs. smart Query Mode
direct Direct search (default): Sends your query lines straight to the search API with zero extra LLM token cost.
smart AI query distillation: Write natural-language requests (e.g. "Track national low-altitude economy pilot policies from the past week") — AI distills them into concise search queries and caches the result daily to avoid repeat calls.

Environment Variables & Network Options

Environment variables override config.yaml, making them ideal for storing keys in GitHub Secrets or docker/.env:
Env Var / SecretDescription
WEB_SEARCH_ENABLEDEnable or disable Web Search (true / false); overrides config.yaml
WEB_SEARCH_API_KEYDedicated search engine API key (highest priority)
DEEPSEEK_API_KEYFallback DeepSeek key used when WEB_SEARCH_API_KEY is not set
WEB_SEARCH_PROVIDEROverride search provider (defaults to deepseek)
WEB_SEARCH_API_BASECustom search API base URL (defaults to https://api.deepseek.com)
SEARCH_QUERIES_PATHOverride the search queries file path

Advanced Usage: Scheduling, AI Synthesis & Search-Only Mode

1. Per-period control in timeline.yaml
To control quota usage, toggle search and once.search independently per time slot in config/timeline.yaml — for example, run Web Search only during morning and evening summaries:
periods:
  morning_brief:
    start: "08:00"
    end: "10:00"
    collect: true
    search: true         # Run Web Search during this slot
    once:
      search: true       # Run Web Search at most once in this slot
When omitted, search follows collect. See Scheduling for details.
2. Integration with AI Analysis, Regions & MCP
  • AI Topic Insights: Keep ai_analysis.include_web_search: true to automatically add a "Web Search Topic Insights" section to AI reports (see AI Analysis & Push).
  • Region Ordering: Use display.region_order and display.regions.web_search to position or hide the section (see Push Modes).
  • Multilingual Translation: Set ai_translation.scope.web_search: true to translate foreign-language search titles and snippets (see AI Translation).
  • MCP History & Live Search: MCP v4.2.0 adds 4 Web Search tools plus the config://search-queries resource for querying archived findings or running live searches in chat (see MCP Chat Analysis).