LangChain tools for ClawFetch — pay-per-call web intelligence for AI agents (x402, USDC on Base)
pip install langchain-clawfetch Copy PIP instructions
LangChain tools for ClawFetch, a pay-per-call web intelligence API for AI agents. Each call is paid with an x402 micropayment in USDC on Base.
pip install langchain-clawfetch Wallet You need a Base wallet private key that holds USDC. There is no API key and no signup. Payments are gasless EIP-3009 transfers signed locally by the clawfetch SDK, so the wallet does not need ETH. Use a dedicated wallet with a small balance.
export CLAWFETCH_PRIVATE_KEY=0x... Quickstart from langchain_clawfetch import ClawFetchToolkit tools = ClawFetchToolkit().get_tools() # reads CLAWFETCH_PRIVATE_KEY # or: ClawFetchToolkit(private_key="0x...", max_chars=8000) fetch = tools[0] print(fetch.invoke({"url": "https://example.com"})) To use the tools with an agent:
from langchain.agents import create_agent agent = create_agent(llm, tools=tools) # llm: any LangChain chat model agent.invoke({"messages": [{"role": "user", "content": "What's new on news.ycombinator.com?"}]}) You can also create a single tool, or pass an existing client:
from clawfetch import ClawFetch, AsyncClawFetch from langchain_clawfetch import ClawFetchResearch research = ClawFetchResearch(client=ClawFetch(private_key="0x..."), async_client=AsyncClawFetch(private_key="0x...")) Every tool supports invoke and ainvoke. Async calls use AsyncClawFetch.
Supported clawfetch_extract sites: twitter, coingecko, github, news, npm, pypi, crates, hackernews, youtube, wikipedia, producthunt, imdb, amazon, crunchbase, sec-edgar, zillow, redfin.
Tools return a string. Fetch and render return the page title, URL and text. Parse returns Markdown. The other tools return the API response as JSON. Output is cut at max_chars (default 10,000).
SDK errors (PaymentError, RateLimitError, ApiError, NetworkError) are raised as ToolException. To hand the message to the model instead of raising, pass handle_tool_error=True when you create a tool.
ai-agents clawfetch langchain 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.




