Skip to main content
The browser-to-api skill turns traffic from a browser workflow into a draft OpenAPI 3.1 document. Use it to understand the endpoints a website calls, inspect request and response shapes, or document an API that has no published specification. It analyzes a Browser trace capture offline. It doesn’t capture traffic itself.

Install

You need Node.js 18+ and a Browser trace run directory. Neither skill’s analysis scripts need a separate dependency install. To create a new remote capture, you also need the Browse CLI and BROWSERBASE_API_KEY.

Capture and discover endpoints

Replace the URL and workflow below with the site and actions you want to document:
The trace supplies request and response events. browse network on adds response bodies, which your agent copies into <run>/cdp/network/bodies/ before another capture can reuse the directory. Without those bodies, the generated spec lacks response-body schemas.

Analyze an existing trace

Ask your agent to run scripts/discover.mjs from the installed browser-to-api skill directory with --run pointing to your trace. For example, from that skill directory:
Use --origins to focus on relevant API hosts, --bodies for a separate body capture directory, and --redact for additional sensitive header names or JSON keys.

Review the output

The skill writes an api-spec/ directory inside the run: Coverage only includes the flows you exercised. Schemas infer shapes from samples; they don’t establish the server’s contract. Review ambiguous paths and missing response bodies, then capture additional flows as needed. Default redaction is best-effort, so inspect reports and samples before sharing them.

Further reading

Browser trace

Capture the browser workflow that feeds API discovery.

Skill source

View discovery flags, inference rules, and output formats.