{"slug": "turn-any-app-website-into-an-api", "title": "Turn any app/website into an API", "summary": "API Anything, an open-source tool from developer goodnight000, converts websites into callable API operations that AI agents invoke over MCP, the CLI or TypeScript instead of driving a browser. Across 5 runs of each task, an agent using API Anything (Claude Opus 5.5) answered 1.5 to 2× sooner, read about half as many tokens, and cost the same or less, with all 20 answers correct, according to the project's benchmark. The package is not yet on npm and requires Node 22.13+ and Google Chrome for creating operations and browser fallback.", "body_md": "**Teach your agent a website once. After that, it calls the site like an API instead of driving a browser.**\n\nAPI Anything watches a site's own page make a request and learns which parts of it are your inputs. It saves the result as an operation. Your agent calls that operation with new inputs over MCP, the CLI or TypeScript, and gets JSON back over plain HTTP.\n\n<sub>Same agent (Claude Opus 5.5), same prompt, started together. Left: it drives headless Chrome\nthrough Playwright MCP. Right: it calls API Anything's Google Flights operation. Shown at 3× speed with no cuts;\nthe timers show real elapsed time. Recorded 2026-09-28. [MP4](https://github.com/goodnight000/api-anything/blob/main/docs/media/agent-race.mp4) · [how it was recorded](https://github.com/goodnight000/api-anything/blob/main/bench/README.md#the-recorded-race)</sub>\n\nAcross 5 runs of each task, the agent using API Anything answered 1.5 to 2× sooner, read about\nhalf as many tokens, and cost the same or less. All 20 answers were correct.\n[Method, raw numbers and limits](https://github.com/goodnight000/api-anything/blob/main/bench/README.md).\n\nPaste this into Claude Code, Codex or another coding agent:\n\n```\nSet up API Anything for me: https://github.com/goodnight000/api-anything/blob/main/INSTALL.md\n```\n\nThe agent checks Node 22.13+, builds and installs the `api-anything` command, confirms that a\ncall works, then connects the MCP server and the skill to itself. Restart the agent, then ask it\nsomething like \"What does Goodreads rate Piranesi?\"\n\n## Install by hand\n\nThe package isn't on npm yet. Don't use `npm install -g github:...`, because it fails under npm 11.\n\n```\ngit clone https://github.com/goodnight000/api-anything.git && cd api-anything\nnpm ci && npm install -g \"$(npm pack --silent)\"\napi-anything call hacker-news search query=sqlite\n{\"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/\", ...}, ...],\"ms\":111}\n```\n\n`tier: 1` means plain HTTP with no browser. A failure returns `ok: false` with a `class`, a\n`reason` and a `next` step. Connect an agent with `codex mcp add api-anything -- api-anything mcp`,\n`claude mcp add --scope user api-anything -- api-anything mcp`, or this MCP entry:\n\n```\n{ \"mcpServers\": { \"api-anything\": { \"command\": \"api-anything\", \"args\": [\"mcp\"] } } }\n```\n\nOver MCP an agent **calls** operations, using four tools: `list_sites`, `list_operations`,\n`call_operation` and `login`. To **create** operations, an agent needs a shell and the\n[skill](https://github.com/goodnight000/api-anything/blob/main/skills/api-anything/SKILL.md). Google Chrome is needed only for creating operations and\nfor browser fallback. [Setup details](https://github.com/goodnight000/api-anything/blob/main/docs/QUICKSTART.md).\n\nGive it the page URL with a placeholder, and two example inputs:\n\n```\napi-anything add hn-demo links \\\n  --trigger 'https://news.ycombinator.com/from?site={domain}' \\\n  --example domain=github.com --example2 domain=github.io --match path=/from \\\n  --html '{\"items\":\"tr.athing\",\"fields\":{\"title\":\".titleline > a\",\"url\":\".titleline > a@href\"}}'\n\napi-anything call hn-demo links domain=arxiv.org      # 30 arxiv.org stories, tier 1\n```\n\nHeadless Chrome loads the page once for each example. The part of the request that changed with\nthe input becomes a parameter, and the rest is stored as a template. The agent (or you) picks the\nrequest and the fields. API Anything builds the template without an LLM.\n[Recorded demos](https://github.com/goodnight000/api-anything/blob/main/docs/demos/README.md).\n\nTell an agent what you need from a site. The [skill](https://github.com/goodnight000/api-anything/blob/main/skills/api-anything/SKILL.md) makes it do\nthis, in order:\n\n1. Ask about whatever the request leaves unclear.\n2. Propose operations and wait for your approval.\n3. Scout each page with `capture --outline` . This is a summary of what each request returns, so\nthe agent doesn't have to read full responses.\n4. Build each operation and check it with an input that wasn't an example.\n\nGoodreads has had no public API since 2020. One run took 6.3 minutes and $1.19. It produced search, book details, an author's books and reviews:\n\n```\napi-anything call goodreads searchBooks q=piranesi\napi-anything call goodreads getBook bookId=50202953\n```\n\n- **Tested on unseen books.** The test used 30 books that nobody used while building the\noperations. For the 29 books the search found, every checked field matched the page Chrome\nrendered: title, rating, ratings count and pages. All 146 calls went over plain HTTP.\n- **Agent comparison.** An agent using the operations answered 5 books in 30.5 s; the browser\nagent took 182.5 s. For one book, it cost a third as much.\n- **No agent needed.** A plain script ([`examples/reading-list.mjs`](https://github.com/goodnight000/api-anything/blob/main/examples/reading-list.mjs) )\nbuilds the same five-book table in 16 s with no model.\n\n[How it was explored, tested and compared](https://github.com/goodnight000/api-anything/blob/main/bench/explore/README.md).\n\n22 read operations across 9 sites:\n\n- `google-flights` : search, top flights, price calendar\n- `hacker-news`\n- `x` and`instagram` profiles\n- search on `youtube` ,`airbnb` and`amazon`\n- `linkedin` : profiles, companies and search, with your own login\n- `goodreads` : search, books, author lists and reviews, built by the explorer above\n\nThey cover selected features, not whole sites. `api-anything ops <site>` lists parameters and\ncaveats.\n\n- **Learn.** Chrome records the page's requests for two example inputs. The request that\nfollowed the inputs becomes a template with slots, and cookies and tokens become references to\na local store.\n- **Call.** Fill the slots and send the request with Node's`fetch` . If the site blocks that,\nfetch from inside a Chrome page. As a last resort for reads, run the page itself and read its\nown response.\n- **Repair.** If the request stops working (a rotated id, a moved field), re-learn it and save\nthe new version only after a replay succeeds. Otherwise the call returns an error, not\nsomeone else's data.\n\n- It is a local tool, not a hosted API. It uses your machine, your network and your sessions.\n- It knows only the operations it was taught. It doesn't support every feature of every site.\n- Repair can fail. There is no CAPTCHA solving, and if a site challenges real Chrome, you have to clear the challenge by hand.\n- No write operations are bundled. LinkedIn messaging isn't bundled and hasn't been tested\nagainst LinkedIn. Writes are tested only against a local fixture, and they need\n`--allow-writes` . An HTTP 2xx doesn't prove a message was delivered.\n- Credentials stay in `~/.api-anything` , and specs hold references, never values. Read each\nsite's terms: you are responsible for how you use it.\n\n[Benchmark](https://github.com/goodnight000/api-anything/blob/main/bench/README.md) · [Demos](https://github.com/goodnight000/api-anything/blob/main/docs/demos/README.md) · [Setup for agents](https://github.com/goodnight000/api-anything/blob/main/docs/QUICKSTART.md) ·\n[Reference](https://github.com/goodnight000/api-anything/blob/main/docs/REFERENCE.md) · [Design](https://github.com/goodnight000/api-anything/blob/main/docs/DESIGN.md) · [Release checks](https://github.com/goodnight000/api-anything/blob/main/docs/RELEASE-READINESS.md) ·\n[Contributing](https://github.com/goodnight000/api-anything/blob/main/CONTRIBUTING.md)\n\nMIT licensed.", "url": "https://wpnews.pro/news/turn-any-app-website-into-an-api", "canonical_source": "https://github.com/goodnight000/api-anything", "published_at": "2026-10-09 08:32:27+00:00", "updated_at": "2026-10-09 08:52:31.431749+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools"], "entities": ["API Anything", "goodnight000", "Claude Opus 5.5", "Playwright MCP", "Google Flights", "GitHub", "Node 22.13", "Google Chrome"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/turn-any-app-website-into-an-api", "markdown": "https://wpnews.pro/news/turn-any-app-website-into-an-api.md", "text": "https://wpnews.pro/news/turn-any-app-website-into-an-api.txt", "jsonld": "https://wpnews.pro/news/turn-any-app-website-into-an-api.jsonld"}}