reverse-api-engineer README

The project's README from github.com/kalil0321/reverse-api-engineer. As one markdown file: README.md.

Reverse API Engineer Banner

PyPI Python License CI

Greptile: The War on Bugs

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 Demo
Agent mode

Manual Mode Demo
Manual mode


How it works

  1. You give it a website and a goal ("fetch all Apple jobs").
  2. A browser visits the site, either driven by you or by an AI agent.
  3. Network traffic is captured to a HAR file.
  4. Your configured model reads the traffic and writes a working API client in Python, JavaScript, TypeScript, Go, Java, C#, PHP, Ruby, C, or PowerShell.

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

The secured cryptography dependency no longer supports Intel macOS or 32-bit Windows. Use Linux (including on Intel hardware), Apple Silicon macOS, or 64-bit Windows. Installing on the retired platforms may attempt an unsupported source build requiring Rust and OpenSSL development tools; this is not a supported installation path. Do not downgrade cryptography to restore old wheels. See the upstream platform changes.

Agent mode (the default) captures through npx-launched browser tooling — browser MCP servers (Playwright or Chrome DevTools) or the Vercel agent-browser CLI — and needs no extra Python packages. Manual mode drives a local Playwright browser, which ships in the optional [manual] extra:

uv tool install "reverse-api-engineer[manual]"   # or: pip install "reverse-api-engineer[manual]"
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:

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",
  "ollama_auto_start": true,
  "ollama_base_url": "http://127.0.0.1:11434",
  "opencode_auto_start": true,
  "opencode_base_url": "http://127.0.0.1:4096",
  "opencode_model": "big-pickle",
  "opencode_npx_package": "opencode-ai@latest",
  "opencode_provider": "opencode",
  "copilot_model": "gpt-5",
  "cursor_model": "composer-2.5",
  "output_dir": null,
  "output_language": "python",
  "real_time_sync": true,
  "sdk": "claude"
}

CLI

Slash commands inside 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.

Debugging agent failures

Set the RAE_DEBUG environment variable to 1 to print the Python traceback for unexpected agent capture failures to stderr. Normal error messages remain concise by default, and --json / --json-stream stdout remains machine-readable.

Output locations

Caveats

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+ and an API key for agent mode. Manual mode additionally needs the [manual] extra plus playwright install chromium.

License

MIT. See LICENSE.

reverse-api-engineer (kalil0321/reverse-api-engineer)

Searching Database…

Что это?Reverse API Engineer — это агент, который просматривает сайт (вручную или через ИИ-управляемый браузер), перехватывает сетевой трафик и с помощью ИИ-модели генерирует рабочий типизированный API-клиент по тем эндпоинтам, которые реально использовались.
Это расширение для браузера или отдельный инструмент?Это консольное приложение на Python, а не расширение для браузера и не библиотека; оно запускает собственный интерактивный CLI, который может управлять локальным браузером Playwright или браузерной сессией под контролем ИИ-агента.
Как это запустить?Установите Python-пакет (нужен Python 3.11+), затем запустите CLI и переключайте режимы клавишей Shift+Tab — «manual», чтобы водить браузер самому, или «agent», чтобы ИИ вёл его автономно.
Нужен ли API-ключ или дополнительные инструменты?Режиму agent нужен API-ключ для настроенной модели (по умолчанию Claude Sonnet/Opus/Haiku, либо SDK вроде OpenCode, Cursor, Ollama или GitHub Copilot) плюс Node.js для браузерных инструментов, запускаемых через npx. Режиму manual дополнительно нужны пакет „[manual]“ и „playwright install chromium“.
Есть ли подводные камни при установке?Базовая зависимость cryptography перестала поддерживать macOS на Intel и 32-битную Windows, поэтому поддерживаются только установки на Linux, macOS на Apple Silicon или 64-битную Windows; сайты с агрессивной защитой от ботов могут блокировать перехват трафика или вынудить к ручному взаимодействию.
На каких языках программирования он умеет генерировать клиент?API-клиент можно сгенерировать на Python, JavaScript, TypeScript, Go, Java, C#, PHP, Ruby, C или PowerShell — выбор делается при каждом запуске.
Может ли он работать с бесплатной локальной моделью вместо платного API?Да, через OpenCode он может управлять уже установленным демоном Ollama, показывая только модели с поддержкой tool calling и контекста 64k+, без скрытых загрузок.
Что именно он перехватывает при просмотре сайта?Он записывает весь сетевой трафик сессии просмотра в HAR-файл, который выбранная модель затем читает, чтобы написать клиентский код для реально использованных эндпоинтов.
Может ли он собирать данные напрямую, а не только генерировать код?Да, в режиме „collector“ агент собирает структурированные данные в JSON/CSV с помощью веб-поиска и fetch вместо создания переиспользуемого API-клиента.
Creator
kalil0321
Size
23 MB
Stars
1.4K
Age
9mo
Commits · 90 Days