A response crosses the network more slowly than expected, but deleting a field by guesswork is risky. The culprit may be one long description, a repeated metadata object on every record, or a page that returns too many records at once. A path-level size breakdown turns that hunch into a specific place to investigate.
Analyze a JSON payloadMeasure the response your client receives
Start with a captured response body from the environment you are debugging. Keep a representative sample: a tiny fixture can hide repeated fields, while a single unusually large record can distort your conclusions. Record whether the measurement is raw JSON text, minified output, or an estimate of compression. Those are different sizes.
{
"items": [
{ "id": "a-17", "title": "Cable", "description": "...", "audit": { "createdBy": "svc" } },
{ "id": "a-18", "title": "Adapter", "description": "...", "audit": { "createdBy": "svc" } }
],
"page": { "next": "cursor-demo" }
}Read paths in context
A node analyzer can rank paths by their contribution to the sample. A large items[*].description may be useful content that clients need. A smaller items[*].audit can matter because it repeats across many records. Look at both the cost per occurrence and the number of occurrences before proposing a change.
Illustrative path profile · not benchmark data
items[*].descriptionitems[*].auditpage.nextChoose an optimization that preserves the contract
If clients do not need descriptions in a list view, offer a field projection or a summary endpoint. If the response contains too many records, pagination or cursor-based loading may address the repeated cost. If a field is duplicated, check whether clients rely on it before moving or removing it. The response contract and compatibility policy should guide the change.
Re-measure the actual transfer
A tool’s gzip figure is an estimate; actual compressed bytes depend on the server, content, compression settings, and HTTP negotiation. Check response headers and the actual transfer in your network tooling when wire size matters. Compression is described by HTTP’s Content-Encoding header; see MDN’s Content-Encoding reference.
Use Analyze JSON Size to inspect paths and structure, then capture the endpoint in the API Tester. For a response too large to comfortably open all at once, read how to inspect large JSON files.
Separate field cost from record count
A path-level total can be high because each value is large, because it repeats on many records, or both. Compare a typical record with the full collection and check whether an endpoint returns fields that the current screen never uses. This distinction helps choose between projection, pagination, a summary endpoint, or changing a repeated schema.
Make the change backward-compatible
Removing a response field can break older clients even when the current frontend no longer reads it. Consider an opt-in sparse-field parameter or a new summary route, document deprecation, and monitor consumers before removal. Re-run representative contract tests after the payload is smaller; reducing bytes is useful only if the required behavior remains intact.
Tags
- find largest fields in JSON
- JSON payload analyzer
- API response size
- JSON byte size by field
- large API response
- reduce JSON payload
- response profiling
- API performance