A powerful, multi-source web search skill designed for AI agents like Claude Code, OpenCode, or Codex. This tool serves as a superior replacement or enhancement for built-in WebSearch tools by aggregating results from multiple premium sources and synthesizing them using Gemini AI.
- Multi-Source Aggregation: Concurrently fetches search results from Tavily, WebSearchAPI, and Gemini Google Search Grounding.
- AI-Powered Summarization: Uses Gemini models (Flash/Pro) to synthesize aggregated data into structured, actionable Markdown.
- Optimized for Agents: Output is specifically formatted for AI consumptionโconcise for simple facts, structured for research.
- Robustness:
- Concurrent execution using
ThreadPoolExecutorfor speed. - Automatic retry logic with exponential backoff.
- Graceful fallback: If AI summarization fails, it returns formatted raw results.
- Concurrent execution using
- Highly Configurable: Control result depth per source (1-10) and manage API rate limits with automatic model switching.
- Python 3.8+
requestslibrary
pip install requestsCreate a .env file in the project root or set these variables in your environment:
| Variable | Required | Purpose | Get API Key |
|---|---|---|---|
GEMINI_API_KEY |
Yes | AI summarization and Google Search Grounding | Google AI Studio |
TAVILY_API_KEY |
Optional | Premium search results via Tavily | Tavily |
WEBSEARCHAPI_KEY |
Optional | Additional search coverage via WebSearchAPI | WebSearchAPI |
python3 SearchOnline.py "<your search query>" [max_results]max_results: (Optional) Results per source (1-10, default: 5).
Example:
python3 SearchOnline.py "latest features in Python 3.13" 3This project is structured as a Claude Code skill. When integrated, the agent will prioritize SearchOnline over its built-in search tool for:
- Current events and news.
- Real-time data (weather, stocks, trending repos).
- Information beyond the model's knowledge cutoff.
- Parallel Search: The script launches concurrent requests to all configured search providers.
- Context Synthesis: It aggregates all successful responses, removes duplicates, and filters for relevance.
- Smart Summarization: Gemini processes the data based on the query type (e.g., tables for lists, paragraphs for research).
- Adaptive Rate Limiting: If one Gemini model hits a rate limit, the script automatically tries the next available model (
gemini-3-flash-preview,gemini-flash-latest, etc.).
SearchOnline.py: The core implementation logic.SKILL.md: Configuration and instructions for Claude Code integration..env.example: Template for environment variables..gitignore: Pre-configured to keep your API keys safe.
MIT License - feel free to use and modify!
Created with Claude Code