The agent that turns websites into APIs.
Project description
Reverse API Engineer
Turn websites into APIs. Browse (or let an agent browse), and get a clean, typed client for the endpoints the site actually uses.
Agent mode
Manual mode
How it works
- You give it a website and a goal ("fetch all Apple jobs").
- A browser visits the site, either driven by you or by an AI agent.
- Network traffic is captured to a HAR file.
- Claude reads the traffic and writes you a working API client (Python, JS, or TS).
No more manually opening DevTools, copying cURL commands, and gluing together a client.
Install
uv tool install reverse-api-engineer # or: pip install reverse-api-engineer
playwright install chromium
Quick start
reverse-api-engineer
> fetch all apple jobs from their careers page
# Browser opens. Navigate, interact, close when done.
# → ./scripts/apple_jobs_api/ (api_client.py, README.md, example_usage.py)
Cycle modes with Shift+Tab:
| Mode | What it does |
|---|---|
manual |
You drive the browser; AI generates the client from captured traffic. |
agent |
An AI agent drives capture autonomously (Playwright or Chrome MCP, or Vercel agent-browser CLI). |
engineer |
Re-run generation on a previous capture (engineer <run_id>). |
collector |
Agent collects structured data (JSON/CSV) using web search + fetch. |
Agent mode providers:
- auto (default): Playwright MCP, single workflow for browsing + reverse engineering.
- chrome-mcp: drives your real Chrome so you keep existing sessions/cookies. Requires Chrome 146+ and Node.js 20.19+.
- agent-browser: Vercel agent-browser CLI (not a Reverse API Engineer browser MCP server). At session start RAE uses whatever
agent-browseris already onPATH, otherwise runsnpm install -g <pin>(same pin as config /RAE_AGENT_BROWSER_PACKAGE), prints a yellow notice, validates with--help, and only then falls back tonpx -y <pin>if npm cannot install. Prompts embed the resolved shell prefix alongsideskills get core --full,skills list, HAR phases, cloud notes fromagent_browser_notes. Tune withagent_browser_npx_package(optional), envRAE_AGENT_BROWSER_*. First Chromium fetch:agent-browser install(add--with-depson trimmed Linux).
Optional sanity checks:
agent-browser doctor --offline --quick || true
agent-browser skills list >/dev/null
Configuration
Settings live in ~/.reverse-api/config.json and can be edited via /settings in the CLI:
{
"agent_provider": "auto",
"agent_browser_npx_package": "agent-browser@0",
"agent_browser_notes": "",
"claude_code_model": "claude-sonnet-4-6",
"collector_model": "claude-sonnet-4-6",
"opencode_model": "claude-sonnet-4-6",
"opencode_provider": "anthropic",
"copilot_model": "gpt-5",
"cursor_model": "composer-2.5",
"output_dir": null,
"output_language": "python",
"real_time_sync": true,
"sdk": "claude"
}
- Models: Sonnet 4.6 (default), Opus 4.6 (most capable), Haiku 4.5 (fastest). For OpenCode see models.dev.
- SDK:
claude(default),opencode,cursor, orcopilot(GitHub Copilot). - Output language:
python,javascript, ortypescript.
CLI
Slash commands inside the CLI:
/settings: configure model, SDK, agent provider, and sync settings./history: list past runs with timestamps, costs, and status./messages <run_id>: view detailed message logs for a run./help(alias:/commands): show the command list./exit(alias:/quit): leave the CLI.
Scriptable subcommands (pipe to jq):
reverse-api-engineer agent --prompt "capture the public jobs api" \
--url https://example.com/jobs --json | jq
reverse-api-engineer list --json
reverse-api-engineer show <run_id> --json
reverse-api-engineer run <run_id> --file api_client.py \
--no-interactive --auto-install -- --org acme
Pass --no-interactive (and/or --json) to skip prompts. With --json, stdout is one JSON document and logs go to stderr.
agent --json schema
| Field | Type | Notes |
|---|---|---|
schema_version |
int |
Currently 1. |
status |
"ok" | "error" |
Top-level result. |
run_id |
string | null |
Use with show / engineer / run. |
prompt |
string |
|
url |
string | null |
|
mode |
string | null |
"auto", "chrome-mcp", or "agent-browser". |
har_path |
string | null |
Captured HAR. |
script_path |
string | null |
Generated client. |
usage |
object |
{input_tokens, output_tokens, total_cost}. |
error |
string | null |
When status == "error". |
Exit codes
| Code | Meaning |
|---|---|
0 |
Success. |
1 |
Runtime error. |
2 |
Missing required arg under --no-interactive / --json. |
For run, the exit code is the underlying script's return code on success, 1 if no script was found, or non-zero if --no-interactive would have had to prompt.
Output locations
~/.reverse-api/runs/scripts/{run_id}/: permanent storage./scripts/{descriptive_name}/: local copy with a readable name- Collector:
./collected/{folder_name}/(items.json,items.csv,README.md)
Caveats
- Generated code runs locally via Claude Code, so review before executing.
- Sites with aggressive bot detection may block capture or require manual interaction.
Development
git clone https://github.com/kalil0321/reverse-api-engineer.git
cd reverse-api-engineer
uv sync
uv run reverse-api-engineer
Build: ./scripts/clean_build.sh. Requires Python 3.11+, Playwright browsers, and an API key for agent mode.
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reverse_api_engineer-0.10.0.tar.gz.
File metadata
- Download URL: reverse_api_engineer-0.10.0.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bf4d31c31b418dded99853d352118e2f5f9a81758b20a3ac63c1961c9f3523e
|
|
| MD5 |
6649677c290f9a58d335559d65745eb7
|
|
| BLAKE2b-256 |
c50242ed54859717766f84ea8d95fdcf08ffaf79ec714a6d466042beb5bfb329
|
File details
Details for the file reverse_api_engineer-0.10.0-py3-none-any.whl.
File metadata
- Download URL: reverse_api_engineer-0.10.0-py3-none-any.whl
- Upload date:
- Size: 135.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc445328b71778f7fb3afd1253ffc7f469bf448dec89d361e87ac1f4f7628369
|
|
| MD5 |
bc6f54e3d0dd3c9d00b495457ffa6b8f
|
|
| BLAKE2b-256 |
02aefe586791e277ef819f674ef71e3d255019b825f410884a470d5dff43221c
|