# Web Search

> Web search capability using DuckDuckGo API by default, with Tavily API fallback when TRAVILY_TOKEN is provided. Use when you need to search the web for current information, research topics, find URLs, or gather data from online sources. Supports queries for news, technical information, research papers, company data, and general web content. Use when this capability is needed.

- Skill: `tomevault-io/web-search-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/web-search-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/web-search-2/raw
- Safety review: pending (external: skill-scanner WARNING, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Research & Search
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/web-search-2

---


# Web Search

## Quick Start

Search the web using the included script:

```bash
python3 /skills/web-search/scripts/web_search.py "your search query" [max_results]
```

**Example:**
```bash
python3 /skills/web-search/scripts/web_search.py "latest AI research" 5
```

## Search Methods

### DuckDuckGo API (Default)
- **No setup required** - works out of the box
- Uses DuckDuckGo's Instant Answer API
- Returns structured results with titles and URLs
- Good for general searches and research

### Tavily API (Premium)
- **Setup required** - set `TRAVILY_TOKEN` environment variable
- Higher quality results with direct answers
- Better for complex queries and research
- Structured JSON response with content snippets

**To use Tavily:**
```bash
export TRAVILY_TOKEN="your-tavily-api-token"
python3 /skills/web-search/scripts/web_search.py "your query"
```

## Output Format

Both methods return JSON:
```json
[
  {
    "title": "Result Title",
    "url": "https://example.com",
    "content": "Optional content (Tavily only)"
  }
]
```

## Use Cases

- **Research**: Find current information on topics
- **URL Discovery**: Find relevant websites and resources
- **Fact Checking**: Verify information from multiple sources
- **Technical Documentation**: Find official docs and references
- **News & Updates**: Get current events and developments

## Integration with Scripts

The web search can be integrated into other scripts:

```python
import subprocess
import json

def search_and_extract(query, max_results=5):
    result = subprocess.run(
        ['python3', '/skills/web-search/scripts/web_search.py', query, str(max_results)],
        capture_output=True,
        text=True
    )
    return json.loads(result.stdout)
```

## Resources

- **Script**: `/skills/web-search/scripts/web_search.py` - Main search script
- **Reference**: `/skills/web-search/references/search_methods.md` - Detailed method documentation

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/koryaga) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

