> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Fetch

> Retrieve and analyze URL content (Anthropic only)

The `--web-fetch` flag enables URL content retrieval and analysis using Anthropic's native web fetch capability.

## Quick Start

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "Summarize https://docs.praison.ai" --web-fetch --llm anthropic/claude-sonnet-4-20250514
```

<img src="https://mintcdn.com/praisonai/Rqp2Yho_5cGAckvS/docs/cli/web-fetch-web-fetch-enabled.gif?s=38e89b5d3a6f9c825e0422a6ca0ef0cf" alt="Web Fetch Demo" width="1497" height="1104" data-path="docs/cli/web-fetch-web-fetch-enabled.gif" />

## Usage

### Basic Web Fetch

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "Summarize https://docs.praison.ai" --web-fetch --llm anthropic/claude-sonnet-4-20250514
```

**Expected Output:**

```
📥 Web Fetch enabled

╭─ Agent Info ─────────────────────────────────────────────────────────────────╮
│  👤 Agent: DirectAgent                                                       │
│  Role: Assistant                                                             │
│  Model: anthropic/claude-sonnet-4-20250514                                          │
│  Web Fetch: Enabled                                                          │
╰──────────────────────────────────────────────────────────────────────────────╯

╭─ Fetching URL ───────────────────────────────────────────────────────────────╮
│  🔗 https://docs.praison.ai                                                  │
╰──────────────────────────────────────────────────────────────────────────────╯

╭────────────────────────────────── Response ──────────────────────────────────╮
│ # Summary of PraisonAI Documentation                                        │
│                                                                              │
│ PraisonAI is a production-ready Multi-AI Agents framework with:             │
│ - Self-reflection capabilities                                              │
│ - Integration with CrewAI and AutoGen                                       │
│ - Low-code solution for multi-agent systems                                 │
│ ...                                                                          │
╰──────────────────────────────────────────────────────────────────────────────╯
```

### Combine with Other Flags

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Web fetch with save
praisonai "Analyze https://example.com/article" --web-fetch --save --llm anthropic/claude-sonnet-4-20250514

# Web fetch with metrics
praisonai "Extract data from https://api.example.com" --web-fetch --metrics --llm anthropic/claude-sonnet-4-20250514
```

## Requirements

<Warning>
  Web Fetch is only available with Anthropic models. It will not work with other providers.
</Warning>

| Requirement | Value                                                                    |
| ----------- | ------------------------------------------------------------------------ |
| Provider    | Anthropic only                                                           |
| Models      | claude-sonnet-4-20250514, claude-3-opus, claude-3-sonnet, claude-3-haiku |
| API Key     | `ANTHROPIC_API_KEY` environment variable                                 |

## How It Works

1. **Enable**: The `--web-fetch` flag activates Anthropic's URL fetching
2. **Fetch**: Claude fetches the content from the specified URL
3. **Parse**: Content is parsed and cleaned
4. **Analyze**: Claude analyzes the content based on your prompt
5. **Respond**: Synthesized response is returned

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
flowchart LR
    A[Prompt + URL] --> B[Claude Agent]
    B --> C[Fetch URL]
    C --> D[Parse Content]
    D --> E[Analyze]
    E --> F[Response]
```

## Use Cases

### Summarization

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "Summarize this article: https://example.com/article" \
  --web-fetch --llm anthropic/claude-sonnet-4-20250514
```

### Data Extraction

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "Extract all product prices from https://example.com/products" \
  --web-fetch --llm anthropic/claude-sonnet-4-20250514
```

### Content Analysis

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "Analyze the sentiment of https://example.com/review" \
  --web-fetch --llm anthropic/claude-sonnet-4-20250514
```

### Documentation Review

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai "Review the API documentation at https://api.example.com/docs" \
  --web-fetch --llm anthropic/claude-sonnet-4-20250514
```

## Programmatic Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

agent = Agent(
    instructions="You are a content analyzer",
    llm="anthropic/claude-sonnet-4-20250514",
    web=True
)

result = agent.start("Summarize https://docs.praison.ai")
print(result)
```

## Comparison with Web Search

| Feature  | Web Fetch          | Web Search      |
| -------- | ------------------ | --------------- |
| Purpose  | Fetch specific URL | Search the web  |
| Input    | URL required       | Query           |
| Depth    | Full page content  | Search snippets |
| Provider | Anthropic only     | Multiple        |

## Best Practices

<Tip>
  Use Web Fetch when you have a specific URL to analyze. Use Web Search when you need to find information.
</Tip>

<Warning>
  Some websites may block automated fetching. Results may vary based on site accessibility.
</Warning>

| Do                                 | Don't                   |
| ---------------------------------- | ----------------------- |
| Use for specific URLs              | Use for general search  |
| Check URL accessibility            | Assume all sites work   |
| Use for content analysis           | Use for real-time data  |
| Combine with save for long content | Rely on terminal output |

## Related

* [Web Search CLI](/cli/web-search)
* [Deep Research CLI](/cli/deep-research)
* [Model Capabilities](/features/model-capabilities)
