Turn any website into an agent-ready API harness — without taking the human out of the loop.
API Anything is a local-first runtime for wrapping websites, dashboards, docs, and browser-authenticated apps as typed capabilities that AI agents can inspect and run and humans can understand and approve.
Website / Web app ──► API Anything Harness ──► Agent / CLI / MCP / Workflow
Human UI manifest + adapter typed JSON capability
Humans use websites. Agents need APIs.
A lot of real work still happens inside messy web apps: WhatsApp Web, admin panels, CRMs, docs, inboxes, social tools, dashboards, and portals. Many of those apps either have no public API, have a slow/expensive API, or still require a browser-authenticated human session.
API Anything adds a small bridge:
- 🧩 describe a website as a site harness;
- 📜 expose actions as typed capabilities;
- 🤖 let agents discover capabilities through JSON/CLI/FastAPI;
- 👤 let humans read what will happen before it happens;
- 🔐 keep sessions and secrets local;
- 🧑⚖️ require human approval before writes.
No vendor lock-in. No agent-framework lock-in. No personal workspace assumptions.
Use API Anything when you want agents to help with websites you already use, while keeping final control over risky actions.
Examples:
- read a WhatsApp Web conversation summary;
- pull data from a dashboard;
- search docs and return grounded answers;
- prepare a social post but require approval before publishing;
- send a message only after a human reviewed the exact text and destination.
Use API Anything as an inspectable tool layer:
- JSON-first CLI output;
- FastAPI runtime;
- manifest-based capability contracts;
- read/write risk separation;
- deterministic adapter entrypoint:
run(capability_id, params, context); doctorandinspectcommands before execution;- write actions blocked unless human approval metadata is present.
Compatible with:
- CLI agents
- MCP tools/servers
- browser automation workers
- workflow engines
- local daemons
- custom AI runtimes
- CI/test harnesses
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install "git+https://github.com/<owner>/api-anything.git"
api-anything --helpgit clone https://github.com/<owner>/api-anything.git
cd api-anything
python3 -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
pytest -q
api-anything --helpCreate a local harness skeleton:
api-anything --root ~/.api-anything discover \
--site-id example-com \
--name "Example" \
--base-url https://example.com \
--capability read_pageInspect it:
api-anything --root ~/.api-anything list
api-anything --root ~/.api-anything doctor
api-anything --root ~/.api-anything inspect example-com
api-anything --root ~/.api-anything caps example-comRun a read capability:
api-anything --root ~/.api-anything run example-com read_page \
--params '{"path":"/"}'Wikipedia is a clean read-only example: every article has the same rough shape, so the harness can turn a plain article URL into structured learning data.
api-anything --root ~/.api-anything inspect wikipedia
api-anything --root ~/.api-anything run wikipedia wikialive \
--params '{"url":"https://he.wikipedia.org/wiki/משה_שרת"}'
api-anything --root ~/.api-anything run wikipedia wikialive \
--params '{"url":"https://wiki-alive.vercel.app/wiki/משה_שרת"}'Available capabilities:
| Capability | Type | What it does |
|---|---|---|
extract_article |
read | fetches a Wikipedia article through the official API |
wikialive |
read | returns summary, story, timeline, quiz, cards, keywords, and a WikiAlive URL |
build_timeline |
read | extracts dated events from the article |
generate_quiz |
read | creates simple quiz questions from the article |
The important idea is simple: once a website has a harness, agents do not need to guess the UI every time. They inspect the available commands and run one capability.
api-anything --root ~/.api-anything inspect whatsapp-web
api-anything --root ~/.api-anything caps whatsapp-webAvailable capabilities in the WhatsApp Web example:
| Capability | Type | What it does |
|---|---|---|
health |
read | checks that the browser session is available |
list_chats |
read | returns recent chats |
extract_today |
read | extracts today's messages across chats |
extract_date |
read | extracts messages for a date |
extract_chat |
read | extracts one chat |
summary_today |
read | returns a structured daily summary |
send_message |
write | sends a message after human approval |
Run a read command:
api-anything --root ~/.api-anything run whatsapp-web list_chats \
--params '{"max_chats":10}'Run a write command:
api-anything --root ~/.api-anything run whatsapp-web send_message \
--params '{"chat":"Example Contact","text":"Final approved message"}' \
--confirmed \
--approved-by "human-reviewer" \
--approval-summary "Reviewed final message text and destination"That is the whole shape: inspect → choose capability → run → get JSON.
A site harness is just a folder:
~/.api-anything/
sites/
whatsapp-web/
manifest.yaml
adapter.py
docs.md
The manifest tells agents and humans what is available:
site_id: whatsapp-web
name: WhatsApp Web
base_url: https://web.whatsapp.com/
auth:
type: existing_browser_session
capabilities:
list_chats:
type: read
params: {}
returns: object
extract_chat_by_date:
type: read
params:
chat: string
date: string
returns: object
send_message:
type: write
params:
chat: string
text: string
requires_confirmation: true
returns: objectThe adapter implements the capabilities:
def run(capability_id, params, context):
if capability_id == "list_chats":
return {"ok": True, "chats": []}
if capability_id == "send_message":
# This code is reached only after API Anything verifies:
# confirmed=true + human_approval.approved=true.
return {"ok": True, "sent": True, "evidence": "sent item visible"}
raise ValueError(f"unknown capability: {capability_id}")Reads are automatic. Writes are not.
For anything that publishes, sends, deletes, updates, buys, submits, or changes external state, API Anything requires two gates:
confirmed: true/--confirmed- human approval metadata proving someone reviewed the exact action
CLI example:
api-anything --root ~/.api-anything run whatsapp-web send_message \
--params '{"chat":"Example Contact","text":"Final approved message"}' \
--confirmed \
--approved-by "human-reviewer" \
--approval-summary "Reviewed final message text and destination"HTTP example:
{
"params": {
"chat": "Example Contact",
"text": "Final approved message"
},
"confirmed": true,
"human_approval": {
"approved": true,
"approved_by": "human-reviewer",
"action_summary": "Reviewed final message text and destination"
}
}Optional integrity check:
- callers may include
reviewed_params_sha256; - if the final params differ, the write is rejected;
- the user must review again.
Local development:
uvicorn api_anything.server:app --app-dir src --reload --host 127.0.0.1 --port 8787Network-exposed deployments should set a token and sit behind HTTPS/reverse proxy:
export API_ANYTHING_TOKEN='***'
uvicorn api_anything.server:app --app-dir src --host 127.0.0.1 --port 8787
curl -H "Authorization: Bearer $API_ANYTHING_TOKEN" http://127.0.0.1:8787/sites/health stays public for health checks. Registry and run endpoints require the token when API_ANYTHING_TOKEN is set.
| Concept | Meaning |
|---|---|
| Site | A website/app/docs source you want to wrap |
| Manifest | YAML contract: auth mode, capabilities, params, risk |
| Adapter | Python file that implements run(capability_id, params, context) |
| Capability | A typed action like search_docs, list_items, post, send_message |
| Read | Safe data retrieval; can run automatically |
| Write | Any side effect; requires human-in-the-loop approval |
- 🧩 File-backed harness registry
- 📜 YAML capability manifests
- 🐍 Simple Python adapter contract
- ⚡ FastAPI runtime
- 🛠️ CLI-first workflow
- 🧠 Agent-readable
inspectoutput - ✅
doctorvalidation for harnesses - 🔐 Optional Bearer-token auth via
API_ANYTHING_TOKEN - 🧑⚖️ Human-in-the-loop gate for write actions
- 📦 Batch execution for lower overhead
- 🔎 Optional local cache/index patterns for docs adapters
src/api_anything/
cli.py
server.py
registry.py
models.py
hitl.py
examples/sites/
x-web/
whatsapp-web/
claude-code-docs/
docs/assets/
whatsapp-web-api-commands.png
whatsapp-web-api-commands.svg
tests/
- Keep the core generic.
- Keep credentials out of manifests, docs, logs, tests, and output.
- Keep browser sessions local.
- Prefer read capabilities first.
- Mark every side-effecting action as
type: writeandrequires_confirmation: true. - Require human approval before publishing, sending, deleting, purchasing, or updating external state.
- Do not claim success without verifying the external result.
- Make harnesses inspectable, testable, and portable.
The next layer is a Git-backed adapter hub:
api-anything hub search whatsapp
api-anything hub info whatsapp-web
api-anything hub install whatsapp-webThe goal: adapters submitted by pull request, indexed from Git, installable by the CLI, and reusable by any agent harness.
Early open-source project. Good for local agent workflows and harness experiments. Not a hosted multi-tenant SaaS.
MIT
