llama-index tools clawfetch integration — pay-per-call web intelligence for AI agents (x402, USDC on Base)
pip install llama-index-tools-clawfetch Copy PIP instructions
LlamaIndex tool spec for ClawFetch, a pay-per-call web intelligence API for AI agents. Each call is paid with an x402 micropayment in USDC on Base.
export CLAWFETCH_PRIVATE_KEY=0x... Quickstart from llama_index.tools.clawfetch import ClawFetchToolSpec spec = ClawFetchToolSpec() # reads CLAWFETCH_PRIVATE_KEY # or: ClawFetchToolSpec(private_key="0x...", max_chars=8000) print(spec.fetch("https://example.com")) tools = spec.to_tool_list() To use the tools with an agent:
from llama_index.core.agent.workflow import FunctionAgent agent = FunctionAgent(tools=tools, llm=llm) # llm: any LlamaIndex LLM with tool calling response = await agent.run("What's new on news.ycombinator.com?") Tools Function Price per call What it does fetch(url) $0.001 URL to readable text (no JavaScript) render(url, wait_for=None) $0.005 JavaScript-rendered page to text extract(url, type=None) $0.008 Typed JSON from 17 supported sites research(query, max_results=None) $0.02 Web search plus source texts for citations parse(url, format=None) $0.005 Office document or PDF at a URL to Markdown (no OCR) domains_check(domains) $0.003 Domain availability domains_suggest(keywords, tlds=None, max_check=None) $0.003 Generate and check domain names from keywords Supported extract sites: twitter, coingecko, github, news, npm, pypi, crates, hackernews, youtube, wikipedia, producthunt, imdb, amazon, crunchbase, sec-edgar, zillow, redfin.
Functions return a string. Fetch and render return the page title, URL and text. Parse returns Markdown. The other functions return the API response as JSON. Output is cut at max_chars (default 10,000).
SDK errors (PaymentError, RateLimitError, ApiError, NetworkError, all subclasses of clawfetch.ClawFetchError) are raised unchanged.
ai-agents clawfetch llama-index tools web-scraping x402
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.




