What is API Anything?
API Anything is an MIT-licensed TypeScript tool for giving an AI agent an API to websites that do not offer one. It sits in the Web Scraping & Crawling category of the Data & Labeling tools and is open-source, written in TypeScript and licensed MIT. To get started: make a first call.
Overview
API Anything is an MIT-licensed TypeScript tool for giving an AI agent an API to websites that do not offer one. Instead of having an agent drive a browser click by click, it learns the request a site's own frontend sends to fetch its data, saves it as a named operation, and from then on calls that operation directly and returns JSON. Operations are exposed through an MCP server, a CLI (including JSONL batches), a TypeScript library, a Python client and a local HTTP server with REST, OpenAPI and MCP endpoints.

The work happens in three steps. To learn, a headless browser loads the page for two example inputs; the values that changed between the two requests become parameters, the rest is kept as is, and cookies are stored as references rather than values — no LLM is involved. To call, the request goes out over plain HTTP with Node's fetch first, falls back to a fetch from inside a browser page when the site blocks that, and as a last resort for reads runs the page and reads its response. To repair, when an answer stops matching the saved shape it tries an updated operation from the catalog or re-learns the request, and keeps the fix only after a successful replay.
Every result carries machine-readable `class`, `write`, `retry` and `nextCall` fields, so an agent can tell a rate limit from a login wall or a drifted page and knows the next step to take. Writes are off unless allowed, sent once, refused if repeated and only reported as applied when a follow-up read confirms them. An opt-in shared catalog lets installs search operations others have learned, with contributed reads and repairs verified by other installs before they go live. The project does not solve CAPTCHAs: an unresolved challenge comes back as `blocked`.
What it does
- Learns a site's internal request from two example inputs with a headless browser — no LLM, no hand-written scraper
- Three-tier calls: plain HTTP first, a fetch from inside a browser page when blocked, and running the page as a last resort for reads
- Self-repair: a drifted operation is re-learned or swapped for a catalog version and saved only after a successful replay
- Agent-friendly results with `class`, `retry` and `nextCall` fields, `--fields` to cap output and `--changes` to report what is new since the last call
- Guarded writes: off by default, sent once, repeats refused, and confirmed by a read before they are reported as applied
- One `setup` command wires the MCP server into Claude Code, Codex, Cursor, Claude Desktop, Gemini CLI and VS Code; also a CLI, TypeScript and Python library and a local REST/OpenAPI server

Getting started
API Anything needs Node 22.13 or newer. The first call needs no browser, account or API key; a Chromium browser is needed later for learning new operations and for the browser tier.
Make a first call
Search Hacker News through a bundled operation over plain HTTP and keep only two fields. A working call returns ok: true, tier 1 and a list of stories.
npx -y api-anything call hacker-news search query=sqlite --fields title,url --max-tier 1Connect your agent
setup finds the agents installed on the machine, asks which to connect and writes the MCP server entry for each. Add --dry-run to preview the changes. In Claude Code you can install it as a plugin instead.
npx -y api-anything setup
# or, inside Claude Code
/plugin marketplace add goodnight000/api-anything
/plugin install api-anything@api-anythingOr add the MCP server by hand
For any other client the server entry is {"command":"npx","args":["-y","api-anything","mcp"]}. Claude Code and Codex have one-line shortcuts.
claude mcp add --scope user api-anything -- npx -y api-anything mcp
codex mcp add api-anything -- npx -y api-anything mcpTeach it a new site
Give a URL template and example inputs: --args is your own value, --args2 becomes the operation's shared example and --args3 is a holdout used to check the learned operation.
api-anything learn 'https://lobste.rs/domains/{domain}' \
--args domain=github.com --args2 domain=arxiv.org --args3 domain=youtube.comUse a logged-in site
For sites that need an account, import an existing session from a browser you choose; operation specs reference the cookies rather than storing their values.
api-anything login linkedinCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Give a coding or research agent structured reads from sites that publish no public API
- Replace a slow click-by-click browser agent with direct JSON calls for repeated lookups
- Track what changed on a page between runs with --changes instead of re-reading everything
- Pull mentions of a project from several sites in one script, as the bundled examples/mentions.mjs does

How API Anything compares
API Anything alongside other open-source web scraping & crawling tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Firecrawl | ★ 216k | A crawling service and API that converts whole websites into clean Markdown or structured JSON ready for LLMs. |
| Agent Reach | ★ 117k | A capability layer that installs, health-checks and routes readers so a CLI agent can read and search web pages, YouTube, RSS, GitHub, Reddit, Twitter/X and more without API fees. |
| Scrapling | ★ 108k | A Python web scraping framework whose parser relocates your elements when pages change, with stealthy fetchers and a Scrapy-like spider engine for full crawls. |
| Crawl4AI | ★ 88.4k | A local-first Python web crawler that turns pages into clean Markdown for use in RAG and LLM pipelines. |
| Scrapy | ★ 65.8k | A mature Python framework for writing fast spiders that crawl websites and extract structured data at scale. |
| changedetection.io | ★ 36.2k | A self-hosted web page change monitor with XPath/CSS/jq filters, browser steps and restock alerts, which can route every diff through an LLM to suppress noise. |
| ScrapeGraphAI | ★ 33k | A Python library that uses LLMs and a graph pipeline to extract data from pages based on natural-language prompts. |
| API Anything | — | Turns a website's own internal requests into JSON operations an agent can call |
