browser-to-api
Turn a website's observable HTTP traffic into a best-effort OpenAPI 3.1 spec by analyzing a `browser-trace` capture. Use when the user wants to discover/extract API endpoints from a browser session, build an OpenAPI doc from network traffic, or document a third-party site's XHR/fetch surface for client integration.
Security Assessment
About browser-to-api
Browser to API turns a website's observable HTTP traffic into a best-effort OpenAPI 3.1 specification by post-processing a capture produced by the sibling `browser-trace` skill. It solves the problem of building a client or SDK against a third-party or undocumented website that publishes no API spec: rather than reverse-engineering endpoints by hand, it reads recorded CDP request/response events and derives a documented API surface plus a coverage report. Importantly, the skill does not capture traffic itself, it is purely offline processing over an existing `.o11y/<run>/` trace directory.
The pipeline runs as ordered Node ESM stages (load, filter, normalize, infer, emit) dispatched by `discover.mjs`. It pairs CDP requests and responses by requestId, drops CORS preflights and non-API resource types, templatizes URL paths (detecting UUIDs, integers, and slugs into path variables), collects query parameters, infers JSON Schemas from observed request and response bodies (with enum, format, and required-field detection), and hoists shared schemas into components. Output includes openapi.yaml/json, a self-contained HTML report with expandable operation cards, a generated client.mjs snippet, redacted sample payloads, and a confidence report. Scripts use only the Node standard library (no npm install), include a redaction module, and can optionally preview the spec in a local Swagger UI. Response-body schemas require optionally enabling `browse network on` during capture.
It targets developers and integration engineers building clients against sites that lack published API docs, and teams who want a coverage report showing which flows would broaden a spec. It is MIT-licensed and restricted to Bash, Read, and Grep tools.
FAQ
Does this skill capture network traffic?
No. It only performs offline post-processing on a browser-trace capture directory. To capture traffic you first run the sibling browser-trace skill, optionally with browse network on to include response bodies.
What are the requirements?
Node 18+ and a browser-trace run directory (.o11y/<run>/). The scripts use only the Node standard library, so there is no npm install step. jq is mentioned in docs for ad-hoc querying but is not required.
How accurate is the generated OpenAPI spec?
It is explicitly best-effort. Schemas are inferred from observed samples, so coverage depends on how many flows were exercised during capture; the tool emits a confidence.json and coverage report to show gaps.
Why are response bodies sometimes missing?
The CDP firehose used by browse cdp does not embed response bodies. To include them you must run browse network on during capture and snapshot the bodies directory before turning capture off.
Is sensitive data handled?
The skill ships a redaction module and writes redacted request/response examples into the samples output, reducing the chance of leaking secrets from captured traffic into the generated docs.
All Files
15 filesInstall browser-to-api
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
browserbase/skills