browser-to-api
Turn a website's observable HTTP traffic into a best-effort OpenAPI 3.1 spec by analyzing a `browser-trace` capture
Install / Use
npx skills add browserbase/skills --skill browser-to-apiInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Content & MediaSupported Platforms
Our assessment of browser-to-api
browser-to-api scores 91/100 on our quality scale, 353rd of 1,155 Content & Media skills we index (top 31%).
Its SKILL.md is 9.4 KB long, well organised into 26 sections with 5 code examples: a thorough specification that gives an agent plenty to work with.
With 3,731 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so browser-to-api is actively maintained.
- Our last check on 2026-10-28 found the source still online.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit ā read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-01. Automated pattern scan on 2026-09-30. It catches known dangerous patterns, not every risk ā read a skill before letting an agent act on it.
browser-to-api compared with similar skills
All 4 of these similar skills score higher than browser-to-api; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| browser-to-api (this skill)by browserbase | 91 | 3.7k | 2mo ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 8d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.8k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 103.6k | 2d ago | MCP Server |
| crawl4aiby unclecode | 100 | 87.4k | 3d ago | MCP Server |
Frequently asked questions
- How do I install browser-to-api?
- Run
npx skills add browserbase/skills --skill browser-to-api. The install tabs above show the steps for each supported agent. - Which AI agents does browser-to-api work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is browser-to-api safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is browser-to-api still maintained?
- The repository was last updated about 2 months ago, so browser-to-api is actively maintained.
Skill content
View source on GitHubname: browser-to-api
description: 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.
compatibility: "Requires Node 18+ and a browser-trace run directory (.o11y/<run>/) produced by the sibling browser-trace skill. The scripts use only the Node standard library ā no npm install step. jq is referenced in docs for ad-hoc querying but is not required by the scripts."
license: MIT
allowed-tools: Bash, Read, Grep
Browser to API
Replay-driven API discovery. Consume a browser-trace capture, pair its CDP request / response events, templatize observed URLs, infer JSON schemas from samples, and emit an OpenAPI 3.1 document plus a human-readable coverage report.
This skill does not capture traffic. It is purely offline post-processing on top of browser-trace's cdp/network/*.jsonl buckets. The two skills compose:
browser-trace ā .o11y/<run>/cdp/network/{requests,responses}.jsonl
browser-to-api ā .o11y/<run>/api-spec/index.html + openapi.yaml + client.mjs
When to use
- The user wants an OpenAPI document for a third-party or undocumented website API.
- The user has a
browser-tracerun and wants endpoints + schemas extracted from it. - The user is building a client/SDK against a site that doesn't publish a spec.
- The user wants a coverage report showing which flows would broaden the spec.
If the user wants to capture traffic, send them to browser-trace first.
Two-step workflow
1. Capture with browser-trace (and optionally bodies via browse network on)
# Local example against an existing debuggable Chrome target
TARGET=9222
node ../browser-trace/scripts/start-capture.mjs "$TARGET" my-site
browse open about:blank --cdp "$TARGET"
browse network on # capture request/response bodies
browse open https://example.com
# ...drive whatever flows you want covered...
# Snapshot the bodies dir BEFORE turning capture off (the temp dir is shared
# per-session, so subsequent `browse network on` runs would mix your bodies
# with whatever a future capture writes if you skip this step).
cp -r "$(browse network path | jq -r .path)" .o11y/my-site/cdp/network/bodies/
browse network off
node ../browser-trace/scripts/stop-capture.mjs my-site
node ../browser-trace/scripts/bisect-cdp.mjs my-site
browse network on is optional but strongly recommended ā without it, the spec has no response-body schemas (the CDP firehose used by browse cdp does not embed bodies). With it, both request bodies (already captured by CDP) and response bodies are joined into the trace by CDP requestId.
2. Generate the spec
node scripts/discover.mjs --run .o11y/my-site
# ā .o11y/my-site/api-spec/index.html ā open this
# .o11y/my-site/api-spec/client.mjs
# .o11y/my-site/api-spec/openapi.yaml
# .o11y/my-site/api-spec/openapi.json
# .o11y/my-site/api-spec/report.md
# .o11y/my-site/api-spec/confidence.json
# .o11y/my-site/api-spec/samples/*.json
# .o11y/my-site/api-spec/intermediate/*.jsonl
discover.mjs auto-detects <run>/cdp/network/bodies/. To use a body capture from elsewhere (e.g. didn't snapshot, want the live browse network dir), pass --bodies <path> explicitly.
3. Open the HTML report
After discover.mjs finishes, always open the generated HTML report:
open .o11y/my-site/api-spec/index.html
The report is a self-contained HTML file (no server needed) that shows each discovered operation as an expandable card with variables, client usage, request/response examples, and a generated client.mjs snippet at the bottom. This is the primary deliverable ā always open it for the user.
CLI flags
| Flag | Required | Meaning |
|---|---|---|
| --run <path> | yes | Path to a browser-trace run directory |
| --out <path> | no | Output dir; default <run>/api-spec/ |
| --bodies <path> | no | browse network capture dir to join into the trace (auto-detected from <run>/cdp/network/bodies/ when present) |
| --include <regex> | no | Only include URLs matching regex (repeatable) |
| --exclude <regex> | no | Exclude URLs matching regex (repeatable; in addition to defaults) |
| --origins <list> | no | Comma-separated origin allow-list (e.g. api.example.com,example.com) |
| --format <yaml\|json\|both> | no | Output format. Default both |
| --title <string> | no | OpenAPI info.title. Default derived from primary origin |
| --redact <list> | no | Extra header names / JSON keys to redact (comma-separated) |
| --min-samples <n> | no | Minimum samples per endpoint to include. Default 1 |
| --stage <name> | no | Run only one stage: load, filter, normalize, infer, emit |
Output layout
<run>/api-spec/
āāā index.html visual report ā open this (self-contained, no server)
āāā client.mjs zero-dep fetch client with typed functions per operation
āāā openapi.yaml machine-readable spec
āāā openapi.json mirror
āāā report.md markdown summary + curl examples
āāā confidence.json per-endpoint confidence + normalization flags
āāā samples/ redacted request/response examples
ā āāā <method>__<path-hash>.json
āāā intermediate/ pipeline byproducts (paired/filtered/endpoints jsonl)
What you get from browse cdp and browse network
Two complementary capture sources:
| Source | Provides | Limitation |
|---|---|---|
| browse cdp (used by browser-trace) | request method/URL/headers/postData, response status/headers/mimeType, full event timing | Does not embed response bodies. Bodies must be pulled with Network.getResponseBody, which the firehose doesn't do. |
| browse network on (separate command) | request bodies AND response bodies on disk, keyed by CDP requestId | Capture dir is shared per browse session; snapshot before another browse network on overwrites it. |
discover.mjs will pull bodies from a browse network dir if you pass --bodies <path> (or stash them under <run>/cdp/network/bodies/, which is auto-detected). The matching is by requestId ā browse network writes that into each request.json as id, and we join directly.
What changes when bodies are present:
- ā Path templating, query-param schemas, status codes, content-types ā same either way.
- ā
Request-body schemas ā
postDatafrom CDP is enough; bodies dir is a nice-to-have for non-postDatacases. - ā
Response-body schemas ā fully inferred from real samples. Without bodies you get
{ description, content: <mimeType> }skeletons.
The report flags every endpoint that has no response-body sample.
Automatic noise filtering
The normalize stage automatically classifies and drops infrastructure noise:
- Tracking / analytics ā paths containing
/track,/pixel,/beacon,/impression,/pageview,/dag/v* - Bot defense ā Akamai (
/akam/), fingerprint payloads (sensor_data), obfuscated multi-segment paths - Session plumbing ā
/session,/authenticate/start, cookie consent, A/B experiment endpoints - HTML page renders ā
GETrequests returningtext/html(the rendered page, not the API)
This typically drops 60-80% of captured traffic. The --include flag can rescue a false positive.
GraphQL / multiplexed endpoint decomposition
When a single endpoint (like /dapi/fe/gql) is called with different operationName values, the skill automatically splits it into separate logical operations. Each gets its own:
- OpenAPI path entry (e.g.
/dapi/fe/gql [Autocomplete]) - Request/response schema inferred from only that operation's samples
- Curl example and variables table in the report
Detection works on body fields (operationName, method, action) and query params (opname, op). This covers GraphQL (APQ and inline), JSON-RPC, and similar dispatch patterns.
Limitations
- Coverage is bounded by the captured flow. Endpoints not exercised in the trace will not appear. The skill cannot prove completeness.
- Schemas are inductive, not contractual. A field might be optional on the server even if every sample contained it.
- Auth is observed, not specified. The skill records auth-shaped headers in an
x-observed-authextension but won't claim a security scheme. - Path templating is heuristic. Numeric / UUID / hex / slug patterns are detected per segment. Ambiguous URLs are flagged in
confidence.json. - Redaction is best-effort. Default redactions cover common credentials, but app-specific secrets may slip through; use
--redactfor known custom headers/keys.
Best practices
- Drive the flows you want documented. The richer the browser-trace, the richer the spec.
- Use
--originsfor noisy sites. A marketing page hits dozens of analytics hosts; restrict to the API origin you care about. - Inspect
report.mdfirst. It has curl-ready examples and response samples for every discovered operation. - Bump
--min-samplesto 2+ when you want only confidently-shaped endpoints in the final doc ā drop the long tail. - Pair with
browse network onwhen response-body schemas matter. The CDP firehose alone has request bodies but not response bodies.
For pipeline internals and the file format reference, see REFERENCE.md.
Related Skills
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu ā one CLI, zero API fees.
headroom
79.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Scrapling
103.6kš·ļø The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
crawl4ai
87.4kOfficial Crawl4AI Cloud: a hosted web scraping, extraction, and search API for AI agents. Free API key, 1,000 credits a month, no card. Fully open source: this repo is the Apache-2.0 crawler that powers it, and you can self-host it.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit ā see the Safety scan above for what the skill file itself contains.
