browser-to-api
Convert manual browser actions to reusable Playwright/CDP scripts.
Developer Setup
Setup & Installation
npx skills add https://github.com/browserbase/skills --skill browser-to-apinpx skills add https://github.com/browserbase/skills --skill browser-to-apiOverview
What This Skill Does
Converts real-time manual browser interactions and network requests into clean, reusable Playwright automation code.
Application
When to use this Skill
- When you want to convert manual browser actions into structured API calls or Playwright scripts.
- When you need to record network traffic and convert it to reusable code patterns.
- When you are bootstrapping scraper scripts and want to capture exact selector names dynamically.
- When you need to extract API endpoints and headers used by a specific web app interface.
- When you want to analyze CDP logs to optimize custom network requests.
Documentation
Show Skills.md file
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
Recommendations
Explore other random skills
composio
Use 1000+ external apps via Composio - either directly through the CLI or by building AI agents and apps with the SDK
stripe-best-practices
Best practices for building Stripe integrations
upgrade-stripe
Upgrade Stripe SDK and API versions