Examples โ†’

Fetch and extract text from a PDF for an AI agent

PDFs are a routing nightmare for agents โ€” most generic web fetchers return raw bytes. AgentFetch detects PDF URLs by extension or content-type, runs pypdf locally, and returns extracted text page-by-page as Markdown headers. Zero external API calls; PDF fetch is the cheapest tier.

Try it

Get a free key at agentfetch.dev (500 free fetches/mo, no credit card).

curl -X POST https://api.agentfetch.dev/fetch \
  -H "Content-Type: application/json" \
  -H "X-AgentFetch-Key: af_xxx" \
  -d '{
    "url": "https://www.example.com/whitepaper.pdf",
    "max_tokens": 2000
  }'

In an MCP-aware agent

fetch_url(
  url="https://www.example.com/whitepaper.pdf",
  max_tokens=2000,
)

In LangChain

from langchain_agentfetch import AgentFetchTool

tool = AgentFetchTool(api_key="af_xxx")
result = tool.run({"url": "https://www.example.com/whitepaper.pdf"})

How it routes

AgentFetch automatically routes fetch pdf for ai agent-style URLs through pypdf (local) based on domain heuristics โ€” you don't pick a fetcher.

When agents reach for this

Read whitepapers, extract financial reports, parse research papers.


Related patterns

Fetch a Hacker News thread for an AI agent
Fetch a Twitter / X thread for an AI agent
Fetch a GitHub README for an AI agent
Fetch an arXiv paper for an AI agent
Fetch a public Notion page for an AI agent
Fetch a Reddit thread for an AI agent