Operun
← All guides

Capturing Multi-Megabyte API Responses as HAR, Without Cutting Them in Half

How Operun's network capture keeps 2 MB+ JSON and GraphQL responses whole, marks every truncation and exports HAR 1.2. An enterprise operator-build feature.

network-capture har graphql enterprise

Enterprise feature. Network capture needs Chrome’s debugger permission, so it is available only in the separately distributed operator build, never in the Chrome Web Store build. Contact us about enterprise access.

Why capture the network at all

Many dashboards render a few rows on screen and fetch thousands in the background. The API response behind a report is often the most complete and most structured version of the data, and reading it is more reliable than scraping the DOM.

The catch is size. A GraphQL listing answer is commonly several megabytes. A recorder that clips bodies at a small fixed limit hands back JSON that is cut in half. Worse, it can still parse and mean something different.

Start, drive, stop

A capture is a session on one tab. You start it, drive the page as usual, then stop it and get a HAR 1.2 document:

# record requests whose URL matches, and read their response bodies
operun browser capture start --tab 7 --match "/api/" --bodies

# drive the page: navigate, click, scroll
operun browser goto --tab 7 https://example.com/reports

# stop and write the HAR to disk
operun browser capture stop --tab 7 --out report.har

--tab is required on both commands. There is no “whichever tab is focused” fallback, because a recording nobody named would be running on a page nobody chose.

The limits, and how each one is reported

A capture is where data accumulates, so it has explicit ceilings. Each one drops data instead of failing the whole recording, and each drop is counted:

LimitDefaultWhat happens at it
Entries500the oldest entry is dropped; dropped counts them
One response body5 MiBthe body is cut, marked body_truncated, and keeps its true size
All bodies combined8 MiBlater bodies are omitted and counted in bodies_omitted

With the 5 MiB default, a 2 MB+ JSON or GraphQL body comes back whole. You can adjust the per-body ceiling for the page you are recording:

# keep HAR files small on a chatty console
operun browser capture start --tab 7 --bodies --max-body-size 262144

A value above the 8 MiB whole-capture budget is refused, not quietly cut down. The ceiling in force is recorded in the HAR as body_limit, so a reader can tell a 64-character cut from a 5 MiB one.

The 8 MiB total is a transport bound: the HAR travels in one WebSocket frame, and base64 bodies grow by a third.

What the HAR file contains

  • Response bodies verbatim in content.text. Binary bodies keep content.encoding: "base64" and are not decoded into text they are not.
  • content.size in bytes, measured from the whole body before any cut. This matters for non-ASCII payloads, where characters and bytes differ.
  • Request bodies marked as not captured. A POST without postData carries _operun.requestBody: "not captured", so it is never mistaken for an empty request.
  • Provenance under log._operun: the tab, the match pattern, and how many entries and bodies were dropped.
  • No invented numbers. Fields the browser does not report are -1 or 0, as HAR defines, not estimates.

Security and side effects

  • A HAR is credential material. Request headers carry the page’s Cookie. The full document goes only to the call that asked for it; the cloud’s retained logs keep the step with the HAR removed and a withheld marker.
  • The tab is attached while recording. Chrome shows its debugging bar on that tab, and other debugger-based commands on the same tab are refused until the capture stops.
  • It is not a proxy. Nothing is intercepted, blocked or rewritten. The page’s traffic runs exactly as it would have.
  • Closing the tab releases the capture and its buffer, so nothing is left held in memory.

Book a demo · Enterprise

Tell us which workflow to automate

Leave your work email and pick the closest workflow. We will prepare a plan around how your team actually works.

We only use this email to reply to your request, never for bulk marketing. See our Privacy Policy.