capture-api

Installation
SKILL.md

When to use

Most modern sites load bibliographic data via JavaScript API calls, not in the static HTML. Since translators receive a static DOM copy, you need to identify and replicate those API calls using requestJSON(), requestText(), or requestDocument().

Capture and analyze

node .bin/capture-har.mjs "<url>"

This captures all network traffic via headless Chrome and generates an OpenAPI spec using mitmproxy2swagger. The tool requires mitmproxy2swagger and will prompt to install it if missing (uv tool install mitmproxy2swagger).

The tool automatically runs two passes: first to discover all paths, then to generate full request/response schemas for API-like paths.

Read the output YAML file. It contains everything you need: endpoint paths, HTTP methods, query parameters, and complete response schemas with field names and types. Do NOT go back to the raw HAR file - the YAML is the authoritative, structured output. Use it directly to understand the API and write your translator.

If the tool reports "No obvious API paths found", edit the YAML to remove the ignore: prefix from paths you're interested in, then re-run the command.

Installs
4
GitHub Stars
1.7K
First Seen
Jun 4, 2026
capture-api — zotero/translators