APIs and data

How to debug API JSON responses

Format the response, confirm the HTTP status, validate the schema, and compare payload changes before changing application code.

API response bugs often mix two problems: the request did not send what you expected, or the response body does not match what the application expects.

A reliable workflow separates transport, syntax, schema, and change detection so you can find the failure without guessing.

Start from the request

When a bug report includes a copied cURL command, parse it first. Check the method, URL, query parameters, headers, content type, and body before inspecting the response.

A wrong Authorization header, missing content type, stale endpoint, or changed query parameter can produce a valid JSON response that is still the wrong response.

Format and validate the response

Pretty-print the JSON so nested objects, arrays, nulls, and escaped strings are easier to inspect.

Then validate the response against a JSON Schema to catch missing required fields, wrong types, changed enum values, and unexpected nested shapes.

Compare before and after payloads

When an API changes after a release, compare the old and new JSON side by side. Look for renamed fields, new wrappers, removed arrays, changed IDs, and different status values.

Normalize formatting first so the diff focuses on data changes instead of whitespace.

API JSON debugging checklist

  • Parse the copied cURL request and confirm method, URL, headers, and body.
  • Check the HTTP status and content type before inspecting the body.
  • Format the JSON response and remove private values before sharing it.
  • Validate the payload against the expected schema.
  • Diff old and new responses when a release or vendor change breaks behavior.

Related guides

Learn the workflow behind this tool and what to check next.

Related tools