api-anything is a free, open source data extraction & web scraping project written in TypeScript and released under MIT. It has 4,241 GitHub stars, 540 forks and 4 open issues, and was last pushed 23 hours ago. On this registry it ranks #53 of 165 tracked projects in Data Extraction & Web Scraping, with 5 head-to-head comparisons available.

What is api-anything?

API Anything is a TypeScript, MIT-licensed tool that turns a website without a public API into a callable JSON interface for AI agents, learning each read once from the site's own frontend traffic and serving it back over the Model Context Protocol, a CLI, or code.

What it is

API Anything is an npm-distributed tool for giving AI agents an API for websites that do not have one. It learns a read once from the site's own frontend traffic, then exposes that learned operation as JSON through an MCP server, the command line, or a program. It ships a catalogue of 114 sites and 323 read operations, uses plain HTTP when it can, falls back to a browser when it needs to, and can repair an operation when the underlying site changes. It lives in the Node and Model Context Protocol ecosystem and is written entirely in TypeScript.

The concrete problem it solves is the cost of driving a browser for every repeated read. A browser agent is the more general tool, because it can read any page a person can click through, but starting one for each lookup is heavier than the task warrants. API Anything replaces that per-read browsing session with a pre-learned operation that can execute at tier: 1, meaning plain HTTP with no browser involved, returning only the fields that were asked for. Recorded operations run on the user's own machine rather than through the shared catalogue.

Key capabilities

  • The call command invokes a learned operation and returns JSON, for example npx -y api-anything call hacker-news search query=sqlite --fields title,url --max-tier 1.
  • --fields trims each response to the named fields, and --max-tier caps how far a call may escalate.
  • Tiered execution is reported in every response: tier: 1 means the read completed over plain HTTP, with a browser used only when required.
  • Operations can repair themselves when a site changes, rather than failing permanently at the first layout shift.
  • An MCP server, started with npx -y api-anything mcp, runs over stdio so any MCP client can launch it with a single npx command.
  • The setup command configures Claude Code, Codex, Cursor, Claude Desktop, Gemini CLI, and VS Code, with --agents hermes for Hermes and --local-only to skip the shared catalogue.
  • Failed calls return a structured reason and a suggested next step instead of a bare error.

Who uses it and how

  • Agent users run setup, restart their client, and then ask questions such as "What does Goodreads rate Piranesi?", which resolve to a learned read rather than a browsing session.
  • Developers doing ad hoc lookups from a terminal can call the catalogue directly, as in a Hacker News search for sqlite filtered down to title and url.
  • Teams that want requests to stay on their own infrastructure can run reads locally, and --local-only keeps the shared catalogue out of the picture entirely.
  • Claude Code users can install it as a plugin through /plugin marketplace add goodnight000/api-anything followed by /plugin install api-anything@api-anything.
  • Desktop applications that cannot resolve npx can generate an entry with absolute paths using npx -y api-anything mcp --print-config.

Getting started

Node 22.13 or newer is the only prerequisite. Run npx -y api-anything setup to wire the tool into a supported client, or make a first read with npx -y api-anything call hacker-news search query=sqlite --fields title,url --max-tier 1, which needs no browser, account, or API key.

How it compares

A general browser agent reaches any page a person can click through, and API Anything deliberately does not try to match that breadth; it covers only reads that have already been learned. In exchange, those learned reads run as plain HTTP without starting a browser, and they execute on the local machine rather than being routed through the shared catalogue. The two approaches are complementary rather than mutually exclusive: browsing remains the fallback for pages that have never been recorded.

When to use it — and when not to

Choose it when an agent repeatedly reads the same sites and the overhead of a browser session per lookup is unwelcome, and when keeping requests local matters more than breadth of coverage. Do not choose it if the sites you need are outside the 114-site, 323-operation catalogue and cannot be learned, if you cannot run Node 22.13 or newer, or if browser-dependent tiers are impossible in your environment. The project's own demonstration is explicitly described as not the median run, so performance expectations should be taken from the benchmarks and method section rather than from that recording.

project readme (upstream, from github) — read inline

Give your agent an API for websites that don't have one.
Learn a read once from the site's own traffic. Call it as JSON from MCP, the CLI, or your code.

npm Shared catalog: live CI npm downloads License: MIT api-anything MCP server Node ≥ 22.13

Quick start · Why · Example · Benchmarks · Integrations · Docs

Add to Cursor Install in VS Code

Look up a book rating, search for flights, or check who's talking about your project without driving a browser for each read. API Anything ships 114 sites and 323 read operations. It uses plain HTTP when it can, falls back to the browser when needed, and can repair an operation when a site changes. Calls run on your machine, not through the shared catalog.


One recorded run from September 28, shown at 3x speed, five departure dates. It is not the median run. The medians and method are under Performance.

Quick start

Try a read. All you need is Node 22.13 or newer. No browser, account, or API key for this call.

npx -y api-anything call hacker-news search query=sqlite --fields title,url --max-tier 1
{"ok":true,"class":"ok","tier":1,"data":[
  {"title":"Hosting SQLite databases on GitHub Pages or any static file hoster",
   "url":"https://phiresky.github.io/blog/2021/hosting-sqlite-databases-on-github-pages/"},
  ...]}

tier: 1 means plain HTTP, with no browser. --fields keeps only what you ask for. If a call fails, it returns a reason and a next step.

Connect your agent.

npx -y api-anything setup

Pick your client, restart it, and ask “What does Goodreads rate Piranesi?” Setup supports Claude Code, Codex, Cursor, Claude Desktop, Gemini CLI, and VS Code; use --agents hermes for Hermes. Use --local-only to skip the shared catalog. Setup for every client · Install instructions for your agent

Or add it by hand. The server is one npx command, so any MCP client can run it:

{
  "mcpServers": {
    "api-anything": { "command": "npx", "args": ["-y", "api-anything", "mcp"] }
  }
}
claude mcp add --scope user api-anything -- npx -y api-anything mcp   # Claude Code
codex mcp add api-anything -- npx -y api-anything mcp                 # Codex

In Claude Code you can also install it as a plugin: /plugin marketplace add goodnight000/api-anything, then /plugin install api-anything@api-anything. Config files and notes for Cursor, VS Code, Claude Desktop, Windsurf and Cline are in docs/CLIENTS.md. If a desktop app can't find npx, run npx -y api-anything mcp --print-config for an entry with absolute paths.

Why not just drive a browser?

A browser agent can read any page you can click through, so it is the more general tool. For a read someone has already learned, API Anything skips the page: one HTTP request, and a JSON answer trimmed to the fields you ask for.

Agent driving a browser Agent with API Anything
A site it has never seen Works Needs the site learned first (two page loads, or one from the catalog)
A read it knows Loads and reads the page One request, with no browser when the site allows plain HTTP
Google Flights, 5 dates (median of 5) 41.6 s 21.1 s
Netflix, 3 episodes (median of 5) 22.3 s 9.6 s
Answer size The agent decides what to keep --fields returns only what you name
Writes Possible Off unless you allow them, and sent once

The times are historical medians from the race, measured with one model and including the agent's whole run. Method and the other tasks

Who's talking about your project

examples/mentions.mjs checks Hacker News, Reddit, YouTube, GitHub, and Mastodon in one run and combines the links into a feed. It makes six read calls, all capped at plain HTTP. If one source is unavailable, the script reports it and keeps the answers from the others.

On November 22, all five runs found 46 DuckDB mentions. The whole process took 1.56–1.89 s per run. Five calls answered over plain HTTP; Reddit reported blocked each time. Rerun details

npm ci
node examples/mentions.mjs duckdb --json

Terminal capture from the November 6 DuckDB search, showing how the script reports each source

Watch the November 6 recording

Performance

60% less time for a fresh CLI read. On November 22, we reran the local benchmarks on current main against the revisions before the latency passes.

Local workload Before Current
First CLI read, including Node startup 574 ms 227 ms
Recognize a rate limit and return 4.59 s, misclassified 14 ms, with retry timing
Stop learning on an unresolved challenge 36.0 s, two browser runs 18.0 s, one browser run
Five-read batch, one field requested per item 3,355 JSON characters 60 JSON characters

These are localhost fixtures: the first read includes process startup, and the batch measures output size, not model tokens or a faster site. Reproduction, baselines, and raw results

The race

In earlier same-agent comparisons, both setups answered every scored question correctly. The times below include the agent's entire run, not just the website call.

Task Browser agent Agent with API Anything
Google Flights, 1 date (Sep 28) 12.9 s 8.4 s
Google Flights, 5 dates (Sep 28) 41.6 s 21.1 s
Netflix, 3 episodes (Oct 31) 22.3 s 9.6 s
IKEA, 5 store addresses (Oct 31) 31.4 s 18.1 s

Historical 2026 medians, five runs per task and setup, all with Claude Opus 5.5. These are not current-build timings. Watch the Google Flights race · Agent timing, tokens, and cost

How it works

  • Learn. A headless browser loads the page for two example inputs. What changed becomes a parameter, the rest is kept byte for byte, and cookies become references. No LLM is involved.
  • Call. Send the request with Node's fetch. If the site blocks that, fetch from inside a browser page; as a last resort for a read, run the page and read its answer.
  • Repair. When the answer stops fitting, try an updated operation from the catalog or re-learn it. A repaired operation is saved only after a successful replay.

The whole idea in 49 seconds · replay, fallback and repair · design

Use it anywhere

The same operations work from an agent, a script, or an app.

Use it from Start here
MCP Set up your agent or connect an agent framework
CLI Call operations or batch reads as JSONL
TypeScript import { call } from "api-anything", or use the call-only host API
Python Use the Python client with typed operations or framework adapters
HTTP Run a local server with REST, OpenAPI, and MCP over HTTP
  • Give agents less to read. Select fields and cap output on calls, including MCP batches. If a kept answer was cut short, get_result retrieves the rest locally, without calling the site again. Result views and continuation
  • Watch for changes. Use --changes to report what's new, gone, or different, and --max-age to reuse a recent answer. Watcher example

Teach it a new site

If the catalog doesn't have the read you need, give learn_site a page URL template and three values: two to learn from and a third to check the result. From a shell:

api-anything learn 'https://lobste.rs/domains/{domain}' \
  --args domain=github.com --args2 domain=arxiv.org --args3 domain=youtube.com

For pages that need clicks or typing, the agent skill walks the agent through proposing and building an operation after you approve. Learning, step by step · Watch a read get learned and reused

The shared catalog

Search the shared catalog for learned operations or a site's own MCP server or OpenAPI document. Opt in to sharing to contribute public reads and repairs. Other installs verify shared operations before they go live. The bundled sites work without reaching the catalog and cover selected features, not whole sites. How the catalog verifies and promotes operations

Safety and what leaves your machine

  • Calls run here, on your machine, network and sessions. The catalog never proxies your calls; a few public operations can be tried from the catalog page.
  • Sessions stay local. Operation specs reference cookies rather than containing their values. login imports a site's cookies from the browser you choose. Session storage and encryption
  • Writes are off unless allowed, sent once, refused as duplicate if repeated, and reported applied only when a read finds the result. No write operation is bundled. Every write guard

What leaves your machine

A search sends its words, domain or URL to the catalog, which keeps no search words. With sharing on, operations learned from public pages are shared, and so are repairs and reports (the version, the outcome, the tier and the time; never your arguments or data). An operation learned signed in goes only after you say yes, or once 3 installs on 3 networks learned the identical thing. Background verification of new operations is a separate question, and its default is no. With sharing off, or with --local-only, nothing is shared or reported. In full, with what the gate checks

Limits

It knows only the operations someone taught it, and the catalog is young. An operation that works for others can still fail for you (another region, a block on your network: Reddit challenges plain HTTP from many). There's no CAPTCHA solving; a challenge that doesn't clear is reported as blocked. Read each site's terms: you're responsible for how you use it. All limits

Help build it

Opt in to sharing to help verify and repair the operations you use. Learn a site that agents requested on the catalog homepage, or contribute a bundled site spec.

Docs

doc what's in it
Setup for agents install, connect each client, learning, timeouts, troubleshooting
Client configs · GitHub Actions copy-paste MCP entries for Cursor, VS Code, Claude Desktop, Windsurf and Cline; a scheduled read in a workflow
Reference the CLI and library, results, creating operations, repair, logging in, safety, sites, limits
HTTP server · Python api-anything serve; the Python package
Frameworks · Agent hosts MCP from agent frameworks; the call-only host API
Design · Catalog the authoritative spec and its reasons; how the catalog promotes, stores and trusts
Benchmark · Demos how every number here was measured; recorded runs with transcripts and tapes
Contributing · MIT license add a site spec, run the checks
Blog posts how it works, a ten-minute tutorial, and what the benchmarks did and did not show

Listed in

Using it somewhere that should be on this list? Open an issue or a pull request.

Who made this

API Anything is made by Charles Zheng, who also builds Forth. Say hi on X or LinkedIn.

Star History

Star History Chart

Frequently asked questions

Is api-anything free to use?

api-anything is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does api-anything do?

Turn any website into an API your agent can call. Learns from the site's own frontend, heals itself when the site changes.

What is api-anything written in?

api-anything is primarily written in TypeScript. Its source is publicly available at https://github.com/goodnight000/api-anything, and it has 4,241 GitHub stars.