HTTP API
The app serves a small REST API on 127.0.0.1, authenticated with a bearer token. The CLI and MCP server are clients of it; you can call it from any language.
Authentication
Read the port and token from the app's data folder and send the token as a bearer header. The token file is created with owner-only permissions, so only the same user on the same Mac can call the API.
PORT=$(cat ~/Library/Application\ Support/elcapture/api_port)
TOKEN=$(cat ~/Library/Application\ Support/elcapture/api_token)
curl -s -H "Authorization: Bearer $TOKEN" \
"http://127.0.0.1:$PORT/flows?filter=host:api&limit=10"
Endpoints
| Method & path | Does |
|---|---|
GET /status | Proxy address, request count, recording, system-proxy and certificate state. |
GET /flows?filter=&limit= | Matching requests as rows (id, method, url, status, duration, bytes, app, comment). |
GET /flows/{id}?secrets=1 | One request as a HAR entry (redacted unless secrets). |
GET /har?filter=&secrets=1 | Matching requests as a HAR document. |
GET /rules / PUT /rules | Read or replace the rule set (JSON array). |
GET /commands / POST /command | List command-palette actions, or run one by name. |
POST /select | Select a flow by id (and a tab) in the UI. |
PUT /appearance | Set accent, code theme and editor font size. |
POST /open | Open a URL. |
POST /send | Send a raw HTTP request through the proxy. |
POST /clear | Clear the session. |
POST /recording / POST /proxy | Toggle recording or the system proxy ({"on": true}). |