Record and analyze API surfaces of web services
assistant skills install api-mappingYou can record and analyze the API surface of any web service using the map CLI.
IMPORTANT: Always use host_bash (not bash) for all map commands. The API mapping CLI needs host access for Chrome CDP, network recording, and browser automation - none of which are available inside the sandbox.
map is a CLI tool that should be available on your PATH. Do NOT search for the binary or try to discover how the CLI works. Just run the commands as documented below.
When the user wants to map a web service's API (e.g. "Map the Notion API" or "Figure out how Figma's API works"):
Ask about the objective - Ask the user: "What service do you want to map?" and "What are you trying to build or integrate with?" This helps focus the recording on the relevant parts of the API surface.
Choose mode - Ask the user: "Should I browse automatically, or do you want to drive?" This determines whether to use auto mode or manual mode:
Run the mapping - Execute the appropriate map command:
map <domain> --jsonmap <domain> --manual --jsonmap <domain> --duration 120 --jsonWait for recording to complete - In auto mode, the CLI will browse and record for the default duration (60 seconds) then stop. In manual mode, the CLI blocks until the user closes the browser or presses Ctrl+C. The command outputs a JSON summary of all discovered endpoints.
Analyze the API map - Review the output and present findings to the user:
/api/v1/users, /api/v1/documents)Offer next steps - Based on the discovered API surface, offer to:
--json flag on all commands for reliable parsing.map <domain> --json # Auto mode: browse and record API calls (default 60s)
map <domain> --manual --json # Manual mode: user drives the browser, CLI records
map <domain> --duration <secs> --json # Auto mode with custom duration
map <domain> --manual --duration <secs> --json # Manual mode with custom timeout
User: "Map the Notion API"
map notion.com --manual --json -> Chrome window opensPOST /api/v3/getSpaces - lists workspacesPOST /api/v3/syncRecordValues - fetches page contentPOST /api/v3/submitTransaction - creates/updates pagesPOST /api/v3/enqueueTask - async operations (export, duplicate)
Authentication: Cookie-based session with token_v2."