Mhonn YbañezSRE, DevOps, AI Engineer
 Today I Learned
Read the full page

What is api-anything and what can it do?

Posted
Tags
ai, agents, mcp

api-anything learns the requests a website's own frontend makes, saves them as a spec, and replays them over plain HTTP. Agents then call a site like an API through MCP, a CLI, a local REST server, or a library. It is a useful option when a site has no API, though it only covers sites someone has taught it.

I have a project that depends on data from a site with no API endpoints, and I have been scraping it by hand. That got me looking for tools built for exactly this problem, and I found api-anything. I don't plan to adopt it today. I just wanted to know that this kind of tool exists and what it can do.

The question I had

Is there a tool that turns a site with no API into something I can call, so I can stop scraping by hand?

What I found

The numbers below are from the project's README on the day I read it. Projects like this change fast.

The short version

api-anything turns websites without public APIs into callable operations. It learns the requests a site's own frontend sends, replays them over plain HTTP, and shares what it learns through a catalog with cookies and tokens stripped out. The catalog shipped with 114 sites and 323 read operations. It needs Node 22.13 or newer, is MIT licensed, and setup is one command:

npx -y api-anything setup

How it learns a website

  1. I give it a page URL with a placeholder and two or three example inputs.
  2. A headless Chrome loads the page once per example and records the background requests.
  3. It compares the traffic across the examples. Whatever changes along with my input (a query parameter, a path segment, a JSON field) becomes a variable slot.
  4. It tests the result with a new input it hasn't seen. If the server ignores the parameter and returns the same data, the operation is flagged as unproven.

No LLM has to guess the API shape. It's just a diff of real traffic.

What the output is

The output is not a generated backend I have to deploy. It is a saved JSON spec per site (operations, request templates, and rules for pulling out the data), plus a runtime that reads the spec and makes the live request. I can reach the same operations four ways:

InterfaceWhat it is for
MCP serverAI agents like Claude Code or Cursor call the operations as tools
call CLITerminal and shell scripts, no agent needed
Local REST server (serve)Any app or curl, with an OpenAPI spec at /openapi.json
Python or TypeScript libraryImport it into my own code

So it is not only an MCP. MCP is one door into the same engine. A result with tier: 1 means one plain HTTP request, with no browser involved.

Is it just a smart curl?

At runtime, yes, close to it. If I already know the hidden URL, headers, and query shape, a raw curl does the same thing. The difference is everything around the request:

CapabilityRaw curlapi-anything
Finding the endpointOpen DevTools and copy requests by handDiscovers it by diffing example page loads
Parsing the responseI write the parsingSaved rules return clean JSON
LoginsI copy cookies and they expireImports them from my browser
The site changesIt silently breaksIt tries to repair the spec

On repair, the README says it adopts another install's fixed version, or re-learns the operation and saves it only after a successful replay.

Logins and writes

I never give it a password. login imports a site's cookies from the browser I'm already signed into, and sessions are encrypted at rest with the OS keychain. Because I sign in through a normal browser, things like 2FA and SSO are my browser's problem, not the tool's.

Writes are off unless I allow them, and no write operation ships in the catalog. That is a sensible default when an agent is acting as me.

Where it fits next to Playwright

For recurring reads on a site it knows, direct HTTP calls are faster and use far fewer tokens than a browser that has to read page trees or screenshots on every step. Playwright is still the better tool for multi-step UI flows, drag and drop, and sites that check browser behavior on every request. They can sit side by side.

What it can't do yet

The README is upfront about the limits:

  • It only knows operations someone taught it, and the catalog is young.
  • The 114 sites cover selected features, not whole sites.
  • An operation that works for others can fail for me, for example from another region or behind a network block.
  • It does not solve CAPTCHAs. An unresolved challenge comes back as blocked.
  • Each site's terms still apply, and I'm responsible for how I use it.

The cousin: mcp-anything

There is also mcp-anything, a separate project by a different author. Its README says "One command to turn any codebase into an MCP server."

api-anythingmcp-anything
InputA live website and its network trafficMy own code, or an OpenAPI, GraphQL, or gRPC spec
OutputCallable operations (MCP, CLI, REST, library)A generated MCP server (Python by default, TypeScript too)
Best forSites I don't own and that have no APIServices I own that agents should be able to call

Where my epiphany came in

It started with the name. If there is an api-anything, maybe there is an mcp-anything for agentic coding too. There is, and they point in opposite directions: one makes a site I don't control callable, the other makes code I do control callable.

The second realization came while asking questions. I first thought api-anything was just a convenient curl, then that it was just an MCP. Both are half right. The HTTP call is the easy part. The value is that finding the request, parsing the response, handling the login, and keeping up when the site changes are automated, and then exposed through whatever door I need.

Takeaway

Tools like this exist, so next time a site has no API I'll look for one before scraping by hand. A learned HTTP call is cheaper and faster than driving a browser for recurring reads, but it only works where someone has already taught it, and each site's terms still apply.