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
praisonai "Summarize https://praison.ai/docs" --web-fetch --llm anthropic/claude-sonnet-4-20250514

!Web Fetch Demo

Usage

Basic Web Fetch

bash
praisonai "Summarize https://praison.ai/docs" --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://praison.ai/docs                                                  │
╰──────────────────────────────────────────────────────────────────────────────╯

╭────────────────────────────────── 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
# 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

RequirementValue
ProviderAnthropic only
Modelsclaude-sonnet-4-20250514, claude-3-opus, claude-3-sonnet, claude-3-haiku
API KeyANTHROPIC_API_KEY environment variable

YAML Equivalent

Use web_fetch: true on an agent with an Anthropic model:

yaml
agents:
  fetcher:
    role: Web Content Analyzer
    instructions: "Fetch and analyze web content"
    web_fetch: true
    llm: anthropic/claude-sonnet-4-20250514

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
Diagram

Prompt + URL

Claude Agent

Fetch URL

Parse Content

Analyze

Response

Use Cases

Summarization

bash
praisonai "Summarize this article: https://example.com/article" \
  --web-fetch --llm anthropic/claude-sonnet-4-20250514

Data Extraction

bash
praisonai "Extract all product prices from https://example.com/products" \
  --web-fetch --llm anthropic/claude-sonnet-4-20250514

Content Analysis

bash
praisonai "Analyze the sentiment of https://example.com/review" \
  --web-fetch --llm anthropic/claude-sonnet-4-20250514

Documentation Review

bash
praisonai "Review the API documentation at https://api.example.com/docs" \
  --web-fetch --llm anthropic/claude-sonnet-4-20250514

Programmatic Usage

python
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://praison.ai/docs")
print(result)

Comparison with Web Search

FeatureWeb FetchWeb Search
PurposeFetch specific URLSearch the web
InputURL requiredQuery
DepthFull page contentSearch snippets
ProviderAnthropic onlyMultiple

Best Practices

DoDon’t
Use for specific URLsUse for general search
Check URL accessibilityAssume all sites work
Use for content analysisUse for real-time data
Combine with save for long contentRely on terminal output

Related