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.
Dedicated section — never over-filtered by keywords or AI filtering
Because every topic in
config/search_queries.txt is explicitly chosen by you, results appear in their own Web Search section and bypass frequency_words.txt and AI filtering. A built-in relevance, authority, and cross-day deduplication funnel keeps reports concise and high-signal.Comparing the Three Data Sources
3 Steps to Enable
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.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.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| Syntax | Description |
|---|---|
[Topic Name] | Optional first line of a block to set a custom display title; if omitted, the first query line is used |
site:domain | Restrict results to a specific domain, e.g. site:gov.cn for official government sites |
-site:domain | Exclude results from a domain; placing it under [GLOBAL_FILTER] applies to all topics |
!word | Exclude results whose title or snippet contains the word; works globally under [GLOBAL_FILTER] |
@number | Override max displayed items for this topic, e.g. @5 keeps at most 5 items |
~Nd | Override freshness window in days for this topic, e.g. ~3d for last 3 days, ~0d for unlimited |
@provider:name | Override 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 relevancedirect 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 / Secret | Description |
|---|---|
WEB_SEARCH_ENABLED | Enable or disable Web Search (true / false); overrides config.yaml |
WEB_SEARCH_API_KEY | Dedicated search engine API key (highest priority) |
DEEPSEEK_API_KEY | Fallback DeepSeek key used when WEB_SEARCH_API_KEY is not set |
WEB_SEARCH_PROVIDER | Override search provider (defaults to deepseek) |
WEB_SEARCH_API_BASE | Custom search API base URL (defaults to https://api.deepseek.com) |
SEARCH_QUERIES_PATH | Override 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 slot2. Integration with AI Analysis, Regions & MCP
- AI Topic Insights: Keep
ai_analysis.include_web_search: trueto automatically add a "Web Search Topic Insights" section to AI reports (see AI Analysis & Push). - Region Ordering: Use
display.region_orderanddisplay.regions.web_searchto position or hide the section (see Push Modes). - Multilingual Translation: Set
ai_translation.scope.web_search: trueto 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-queriesresource for querying archived findings or running live searches in chat (see MCP Chat Analysis).
Web-Search-only mode
You can set both
platforms.enabled and rss.enabled to false while keeping web_search.enabled: true to run TrendRadar purely as a scheduled web search tracker.