API Anything and Unbrowse: Connect Sites to Claude Code
Learn how to set up API Anything and Unbrowse so Claude Code and Codex can pull website data as JSON, with install steps, MCP setup, and safety limits.
Say you ask Claude to find the cheapest flight for next month. The agent opens a browser, waits for the page to load, clicks a field, types, clicks search, scrolls, and reads the whole page. Each step takes time, and each page it reads uses tokens.
There is a faster path. Behind most modern websites is an internal API, and the page you see is mostly a wrapper around the data. This guide shows how I use two tools, API Anything and Unbrowse, to turn those website actions into data calls that Claude Code and Codex can run directly.
In short: API Anything is a free, open source local tool. It learns a website's request once, then calls it directly and returns JSON. Unbrowse is a hosted service with a CLI, SDK, and MCP server, and running tasks there requires an account.
Key takeaways
- The guide's figures show a Google Flights single-date check at 8.4 seconds and $0.074 with API Anything, versus 12.9 seconds and $0.166 with a browser agent.
- API Anything requires Node.js 22.13 or later, and you can check your version with
node --version. - API Anything's default install path is an agent-run setup that you start by pasting an install link into Claude Code or Codex.
- Unbrowse's running tasks require an account, while searching the public registry and viewing public site details do not.
- Unbrowse's x402 payment system (crypto, USDC) was removed from the API in September 2026.
- Both tools need permission and must follow each site's terms. Start with public information in a separate environment.
What is the idea behind these tools?
These tools learn a website's internal request once, then send that request directly. The agent gets clean data instead of working through a browser page.
Most sites use the same pattern under the hood. When you click search on Google Flights, your browser sends a request to a server and gets clean data back. The fancy page is a wrapper around that response.
Both tools work this way at their core. They learn the request one time. After that, the agent sends it directly and gets JSON back, with no buttons, no scrolling, and no full page to read.
Why does this matter? The table below shows figures from the benchmark write-up for API Anything. They are based on the same prompt with 5 runs per task. I did not run this test myself, and it is not a promise of performance.
| Task | Agent with browser | Agent with API Anything |
|---|---|---|
| Google Flights, one date | 12.9 seconds, $0.166 | 8.4 seconds, $0.074 |
| Google Flights, 5 dates | 41.6 seconds, $0.154 | 21.1 seconds, $0.152 |
| Goodreads, one book | 16.8 seconds, $0.156 | 14.4 seconds, $0.048 |
| Goodreads, 5 books | 182.5 seconds, $0.122 | 30.5 seconds, $0.107 |
According to the write-up, all 20 answers checked were correct, and the agent used about half as many tokens. Results depend on the site, the task, and the version.
The paper Internal APIs Are All You Need (arXiv:2604.00694) reports an average speedup of 3.6 times and a median speedup of 5.4 times across information retrieval tasks on 94 domains. That was a comparison on one host machine, between runs using routes that were already learned and Playwright. It is not a promise for the current service or for the time it takes to learn a new site.
How can you see the API behind a website?
Open Chrome's Developer Tools and look at the Network tab. Search on a site, and you will see the data request the page uses. This takes about a minute and helps you understand what the tools do.
Follow these steps to look for yourself:
- Open Chrome and go to a site with search, such as Hacker News Search at hn.algolia.com.
- Press F12 (on Mac, Cmd+Option+I) and open the Network tab.
- Filter to Fetch/XHR.
- Search for something on the site.
- A new request appears in the list. Click it and open the Response tab.
What you see there is what the agent needs: the data itself, without the design. Both tools automate this process, save it, and can change the input on each call.
How do API Anything and Unbrowse compare?
API Anything runs locally and needs no API key. Unbrowse runs as a hosted service, and its code on GitHub is only the client. Pick the one that matches how much control and convenience you need.
| API Anything | Unbrowse | |
|---|---|---|
| Where it runs | Local tool. Requests go to websites and your model provider. | Hosted service (cloud). The GitHub code is only the client. |
| Account | Not needed. No API key. | Account needed (OAuth or API key). |
| Price | Free, MIT open source | Verified authenticated calls measured against your account plan |
| Browser for learning | Chrome or any Chromium on your machine | Unbrowse's recorded cloud browser |
| Who decides the request | Your agent. The tool builds a template without an LLM. | The service, from recorded traffic |
| Self-repair | Yes, locally. Saved only after a successful run. | Yes, on the server side |
| Ready-made sites | 22 operations across 9 sites, plus more in the registry | Public registry of sites already compiled |
| Sharing | Only when you run publish on purpose | Public routes with no shared secrets by default (you can turn this off in the console) |
| Best for | Full control, privacy, experiments | Speed, running from anywhere, n8n, teams |
How do you install API Anything?
The easiest path is to paste one install link into Claude Code or Codex and let the agent set it up. You can also install it by hand from the code.
The repo is API Anything on GitHub (https://github.com/goodnight000/api-anything). The license is MIT according to the material I reviewed. It is an early tool, so check the version and license in the repo before you install.
What do you need first?
- Node.js 22.13 or later. Check with
node --version. - npm and git.
- A Chromium browser (Chrome by default, or Brave, Edge, Chromium, Vivaldi, or Arc). You only need it to teach new sites. Normal calls at layer 1 do not need a browser.
- If you use a browser that is not the default, set
API_ANYTHING_BROWSERto its name (for example, brave) or to its full path.
How do you install it the easy way?
Open Claude Code or Codex and paste this:
Set up API Anything for me: https://github.com/goodnight000/api-anything/blob/main/INSTALL.md
The agent checks your Node version, builds and installs the command, confirms a call works, and connects the MCP server and skill for itself. When it finishes, restart the agent.
How do you install it by hand?
The package is not on npm yet, so you build it from the code:
git clone https://github.com/goodnight000/api-anything.git
cd api-anything
npm ci
npm install -g "$(npm pack --silent)"
Do not use npm install -g github:goodnight000/api-anything. It fails under npm 11. If you see a permissions error (EACCES), do not use sudo. Fix your global npm folder or use nvm.
Want to try it without installing?
npx -y github:goodnight000/api-anything call hacker-news search query=sqlite
How do you run a first test?
Run these two commands:
api-anything sites
api-anything call hacker-news search query=sqlite
You should see "ok":true and "tier":1. That means the call went through plain HTTP, without a browser.
How do you connect API Anything to Claude Code or Codex?
Add the MCP server with one command for your agent, then copy the skill file into the skills folder. The MCP server gives the agent its tools, and the skill teaches it how to create new actions.
For Claude Code, run:
claude mcp add --scope user api-anything -- api-anything mcp
mkdir -p ~/.claude/skills/api-anything
cp "$(npm root -g)/api-anything/skills/api-anything/SKILL.md" ~/.claude/skills/api-anything/
For Codex, run:
codex mcp add api-anything -- api-anything mcp
mkdir -p ~/.agents/skills/api-anything
cp "$(npm root -g)/api-anything/skills/api-anything/SKILL.md" ~/.agents/skills/api-anything/
For Claude Desktop, Cursor, or any other MCP client, add this to the config file:
{ "mcpServers": { "api-anything": { "command": "api-anything", "args": ["mcp"] } } }
If the desktop app cannot find the command, replace api-anything with the full path that command -v api-anything returns.
The MCP server gives the agent four tools: list_sites, list_operations, call_operation, and login. The skill teaches the agent how to create new operations. One important point: through MCP, the agent can only call existing operations. To create new ones, the agent needs terminal access. Claude Code and Codex both have it.
After a restart, try asking:
What does Goodreads rate Piranesi?
What sites can API Anything call?
What works out of the box with API Anything?
API Anything includes 22 read operations across 9 sites. Each one covers selected features, not whole websites. Run the ops command before you use one.
| Site | What you can do |
|---|---|
| google-flights | Flight search, top flights, price calendar |
| hacker-news | Search |
| x | Profiles |
| Profiles | |
| youtube | Search |
| airbnb | Search |
| amazon | Search |
| Profiles, companies and search, using your connection | |
| goodreads | Book search, book details, books by an author, reviews |
Before you use any operation, run this command. It shows the parameters, the format each one expects, and important notes, such as airport codes only or date limits:
api-anything ops google-flights
How do you teach API Anything a new site the easy way?
Ask the agent, with the skill installed, to turn the site into an API for you. The skill walks the agent through a fixed order of steps. You approve the plan before it builds anything.
Here is an example request:
Turn goodreads.com into an API for me. I want to search books and get book details.
The skill makes the agent work in this order:
- Ask up to three questions about anything unclear. For example: which questions you will ask the site, what changes between calls, which fields you need, and whether a login is required.
- Propose a list of operations in the format
name(input) -> fields, then wait for your approval. For example:searchBooks(query) -> bookId, title, author, rating. - Scan each page with
capture --outline. This gives a summary of what each request returns, without reading full responses. - Build each operation and test it with input that was not used as an example.
- Return a table with the operation, the input, what it returns, and what it was tested with.
According to its makers, mapping Goodreads (which has had no public API since 2020) took 6.3 minutes and cost $1.19 in tokens. It came out with search, book details, books by an author, and reviews. In a test on 30 books that were not used during the build, search found 29. All fields checked for those 29 matched what the browser showed.
How do you teach API Anything a new site by hand?
Use four commands: capture, add, call, and verify. Capture shows the requests the page sends, add builds the operation from two examples, call tests it, and verify checks every operation on the site.
Step 1: See which requests the page sends
api-anything capture "https://hn.algolia.com/?q=sqlite" --example q=sqlite --outline
You get a ranked list of candidates. The carries field shows which example values each request contains. Pick the request that returns the data you want.
To peek at one candidate's response without a browser:
api-anything inspect <captureId> <id>
Step 2: Create the operation with two examples
api-anything add hn-search search \
--trigger "https://hn.algolia.com/?q={query}" \
--example query=sqlite --example2 query=postgres \
--match host=uj5wyc0l7x-dsn.algolia.net \
--extract hits --pick "title,url,points,comments=num_comments"
Step 3: Call it with a new value
api-anything call hn-search search query=duckdb
Step 4: Verify every operation on the site
api-anything verify hn-search
Tips that save time
- Always use two different examples. The second run is what separates a real parameter from a one-time ID.
- An example value needs at least 3 characters, and it must appear in the request itself. A short value (a country code, a page number) works only with both examples:
--example country=US --example2 country=CA. - For pages: learn with pages 2 and 3, not 1 and 2. Many sites do not include the page number on the first page.
- For a site that renders on the server (the data is already inside the HTML), use
--htmlwith selectors, or--embeddedwith a regex for JSON inside a script tag. For JSON-LD from schema.org, prefer it, since it stays stable when the site changes. --pick name=pathrenames a field.name=path~regexkeeps only part of a string.[*]collects from every item in an array.- Made a mistake in the recipe? You do not need to load the page again. Use
api-anything add <site> <op> --from <captureId>with the corrected flags. - An operation with no parameters (a feed or a list) needs
--match path=/api/feedso it knows which request to use.
How do you log in to sites that need an account?
Run api-anything login with the site name. On macOS and Linux, it can import cookies from your browser profiles, except Linux cookies encrypted with the desktop keyring. On Windows, a browser login window opens.
api-anything login linkedin
Some notes on login:
- If you have more than one logged-in profile, the tool does not guess. It returns a list, and you choose:
api-anything login linkedin --profile "Chrome/Profile 1" - If you need 2FA or a CAPTCHA,
--windowopens a visible window for a manual login. - On a server without a browser,
--cookies <file>imports a cookies.txt file. - To log out:
api-anything logout linkedin - On a Mac, the first import brings up one Keychain prompt. Approve it.
The imported session is the same session as your browser. If the site logs it out, both get logged out. Keep traffic light.
How do you share or pull a learned site?
Pull a site someone else already taught from the registry. To share your own, preview exactly what becomes public first, then publish with --yes only when you are ready.
To download a site that has already been taught:
api-anything pull goodreads
api-anything call goodreads searchBooks q=piranesiQuestions people ask
What do API Anything and Unbrowse do?
They learn the requests a browser sends to a website and turn selected actions into repeatable data calls for AI agents. They do not give access to blocked information, and they do not promise support for every website. You still need the right permissions and must follow each site's terms.
What is the main difference between API Anything and Unbrowse?
API Anything is a local tool that stores credentials on your machine and needs no hosted account. Unbrowse is a hosted service with a CLI, SDK, and MCP, and running tasks requires an account. Check permissions, terms, and data policies with either one.
How do I connect API Anything to Claude Code?
Install the tool from the official docs, then add the MCP server with claude mcp add --scope user api-anything -- api-anything mcp. Install the skill if you want the agent to learn new actions. Restart the agent afterward.
Are these tools free?
The API Anything code is open source under MIT, but using an AI model may cost money. Unbrowse measures verified authenticated runs against your account plan. Check the current pricing and quota before you use it.
Can I teach either tool a new website?
Yes, when you have the right access. API Anything uses two example inputs to find the parameters, and Unbrowse can learn through the agent, a site crawl, or HAR recordings. Test with new input and do not share recordings that contain sensitive data.
