Reliable web access for AI agents. Runs on your machine, with your IP and your sessions.
bun add @andypai/agent-fetch
GitHub
Your agents need to read web pages, but programmatic fetching has gotten adversarial. You can throw a headless browser at every request or route through a scraping API, but that's slow, expensive, and uses datacenter IPs that sites are trained to block.
Each response passes acceptance checks automatically. If the result is blocked, empty, or paywalled, the next strategy fires. No wasted browser launches for pages that work with a plain fetch.
agent-fetch runs locally. Your requests come from your IP address, with your browser sessions. This solves a category of problems that cloud scraping APIs can't.
Start the HTTP server and any agent on your network can fetch web content. Put it behind Tailscale so it's reachable from anywhere on your tailnet without exposing it to the public internet.
agent-fetch server --host 0.0.0.0
# Returns clean markdown by default curl -X POST -H 'Content-Type: application/json' \ -d '{"url":"https://example.com"}' \ http://your-machine:7411/fetch # With options curl -X POST -H 'Content-Type: application/json' \ -d '{"url":"https://example.com","options":{"outputMode":"primary"}}' \ http://your-machine:7411/fetch
This is how tools like openclaw get web content. POST a link, get text back, no browser management on the agent side.
Set up a browser profile, log into your subscriptions once in a headed browser, and agent-fetch reuses those sessions. The profile stores cookies and auth state — not your full browser history. If the profile isn't configured, it fails fast instead of silently returning a login page.
# Log in interactively once agent-browser \ --profile ~/.agent-browser/profiles/work \ --headed open https://stratechery.com # Now agents can fetch paywalled content curl -X POST -H 'Content-Type: application/json' \ -d '{"url":"https://stratechery.com","options":{"strategyMode":"authenticated"}}' \ http://localhost:7411/fetch