How to Read and Debug a JSON API Response
Updated November 2026
When an API call misbehaves, the cause is usually visible in the response itself. A consistent method finds it quickly.
1. Check the status code first
200 means success, 4xx means the request was wrong (401 not authenticated, 404 not found, 422 invalid data), and 5xx means the server failed. An error status often returns a JSON body explaining why.
2. Confirm it is really JSON
Check the Content-Type header. An HTML error page or an empty body causes "Unexpected token" errors; see how to fix them.
3. Format it
Paste the body into the JSON Formatter. The tree view shows nesting, and the validator confirms the syntax is valid.
4. Look for common data problems
- null or missing keys where your code expects a value
- Numbers as strings (
"42"instead of42) - Different shapes: a single object where you expected an array
- Date formats and time zones
- Pagination: data continues at a
nextlink or cursor
5. Compare with a working response
Format both and use Text Compare to see exactly what differs.