On this page

Start With the Correct Response Body
To inspect a nested JSON API response, preserve the response body, identify its root, and follow one object key or array index at a time. Confirm the selected record, check whether the field is present, and inspect its value and type. A matching word becomes useful evidence only when you can also explain exactly where it occurs — which branch, which record, which position.
The synthetic examples below provide complete paths and expected results for navigation, and show how to investigate a mismatch without changing the input prematurely. Keep the original response text available throughout, particularly when checking numeric identifiers or repeated property names: understanding the response structure and verifying a parser’s behavior are separate parts of the investigation.
Begin with the network request associated with the action you are investigating. Select its response body and look for a recognizable field or record identifier. Use that detail to confirm you have the relevant response before copying it into an inspector. Keep request parameters, headers, and the response body separate during the investigation — for a question about a returned record, work from the body containing the returned data, and avoid constructing an inspection input by combining text from several views.
Save an unchanged copy before formatting or parsing. JSON is a text-based format, so the original spelling and punctuation provide comparison material when investigating syntax, numeric tokens, or repeated names. Use a JSON formatter to prepare a readable working view: paste the JSON body itself, and keep the JavaScript statements used in this guide separate from that input. If application code uses Response.json(), its promise resolves with the parsed body — label that result as the parsed representation in your notes, alongside the original body, so observations about the input text stay distinct from observations about the parsed result.
Identify the Root and Map the Containers
Inspect the outermost value before writing any path. A JSON document can contain an object, an array, or a single primitive value, and the first access step must fit that starting point:
| Example response | Root | First inspection step |
|---|---|---|
{"items":[]} |
Object | Select the items property |
[{"id":"r1"}] |
Array | Select a position, such as [0] |
"ready" |
Primitive string | Inspect the root value itself |
JSON object property names are strings enclosed in double quotes; arrays are ordered lists whose indexes start at zero. Selecting an item from a root array therefore begins with an array index, not a property name.
Use indentation to map the containers around the desired value. If your viewer offers expandable branches, open the root and then the relevant branches one at a time, asking at each level whether the next selection requires a property name or a position. Check each selected child before continuing — an array can contain elements of different JSON types, so its first element does not establish the structure of every later element. The first record having a populated tags array says nothing about the second.
Trace One Complete Path Through Keys and Indexes
Use this synthetic fixture in a JavaScript environment; the following sections reuse payload:
const payload = JSON.parse('{"result":{"items":[{"id":"r1","tags":["ready","queued"]},{"id":"r2","tags":[]}]}');
payload.result.items[0].tags[1];
// Expected: "queued"
Read the expression from left to right. Each step selects a child of the value reached by the previous step:
| Expression | Selected value |
|---|---|
payload.result |
Object containing items |
payload.result.items |
Array containing two records |
payload.result.items[0] |
First record, identifier r1 |
payload.result.items[0].tags |
Array ["ready","queued"] |
payload.result.items[0].tags[1] |
String "queued" |
The first index, [0], selects a record from items; the second, [1], selects a tag from that record’s tags array. The two indexes operate on different containers — a detail worth stating explicitly, because “the second index” without its container is ambiguous in any report.
When a real response does not match your expectation, inspect the shorter expressions in order and find the first point where the selected value or container differs from what you expected. That observation narrows the investigation to a particular step: a property name, a wrapper, a record position, or an unexpected child structure.
Select a whole record before inspecting its individual fields. In the same fixture, index 1 selects the second item:
payload.result.items[1]; // Expected: {"id":"r2","tags":[]}
payload.result.items[1].id; // Expected: "r2"
payload.result.items[1].tags; // Expected: []
That yields two useful checks: the selected record has identifier r2, and its tags field contains an empty array. The first record’s two tags do not describe the second. Arrays can also contain arrays, in which case consecutive indexes navigate successive levels:
const grid = [["a", "b"], ["c"]];
grid[1]; // Expected: ["c"]
grid[1][0]; // Expected: "c"
Here [1] selects the second inner array and [0] selects that array’s first element. Read the expression as two selections, naming the container reached after each one. When documenting a lookup, include the intermediate record or inner array if that makes the result easier to verify — a short intermediate example can reveal a mistaken outer index before you investigate the final field.
Literal Property Names Versus Nested Paths
Inspect the actual property names before interpreting punctuation as navigation. This synthetic object contains both a literal "user.name" property and a separate user object:
const names = JSON.parse('{"user.name":"literal entry","user":{"name":"nested entry"}}');
names["user.name"]; // Expected: "literal entry"
names.user.name; // Expected: "nested entry"
names["user"]["name"]; // Expected: "nested entry"
In names["user.name"], the quoted string selects one property at the root — the period belongs to that property’s name. In names.user.name, the expression selects user first and then name inside it; the final example follows the same two-step path in bracket syntax. These expressions look similar when written casually but select different entries in this fixture.
Preserve brackets and quotation marks when sharing a lookup. A report that says only “check user.name” leaves the intended interpretation unclear; an exact expression and its expected value make the distinction reviewable. APIs that allow dots in property names — search facets, per-field scores, metric names — make this collision common enough that the habit pays for itself:
// the one-line discriminator:
'dot inside quotes = one property; dot outside quotes = step down'
Find the Intended Occurrence and Confirm the Record
Searching for a value can reveal candidate locations; confirm the surrounding branch before treating a match as the answer. In this fixture, "queued" appears in both a summary and an individual record:
const matches = JSON.parse('{"summary":{"status":"queued"},"items":[{"id":"r1","status":"ready"},{"id":"r2","status":"queued"}]}');
matches.summary.status; // Expected: "queued"
matches.items[1].status; // Expected: "queued"
matches.items[1].id; // Expected: "r2"
Both status expressions return the same string, but the second selects the status belonging to record r2 while the first selects the summary status. After locating a match, inspect its parent record and confirm the identifier. Write down the complete path, record identifier, and observed value together — a useful note for this example is: matches.items[1].status, record r2, value "queued".
An array index identifies a position within the inspected response. Before reusing that index with another response, verify the identifier again — pagination changes, deleted records, or a different sort order can all shift positions while the record itself is unchanged. Ask two questions when reviewing a match: Is this the intended branch? and Does this selected record have the identifier I expected? A yes to both turns “I found the word” into evidence.
Check Types, Missing Fields and Empty Containers
Inspect presence, value, and type separately. This fixture places several distinct cases next to one another:
const sample = JSON.parse('{"nothing":null,"blank":"","list":[],"details":{},"quoted":"123","count":0,"enabled":false}');
sample.nothing; // Expected: null
sample.quoted; // Expected: "123"
sample.count; // Expected: 0
sample.enabled; // Expected: false
There is deliberately no missing property in the object. Record that field as absent without assigning it a runtime result:
| Property | Observation in this fixture |
|---|---|
missing |
Absent from the object |
nothing |
Present with value null |
blank |
Present as an empty string |
list |
Present as an array with no elements |
details |
Present as an object with no properties |
quoted |
Present as the string "123" |
count |
Present as the number 0 |
enabled |
Present as the boolean false |
A property explicitly set to null is still present. The value "123" is a string. Zero and false are explicit values, so report their values and types when describing the record — collapsing “zero, false, null, empty, and absent” into one bucket of “missing” is the single most common misdescription in bug reports about API responses:
// the presence check that distinguishes all five cases:
const has = 'missing' in sample; // false — absent
sample.nothing === null; // true — present, null
sample.blank === ''; // true — present, empty string
Array.isArray(sample.list); // true — present, empty array
Object.keys(sample.details).length; // 0 — present, empty object
For an empty collection, first confirm the record and property you selected, then describe the observation precisely: an empty array, an empty object, or an absent field. Inspect sibling records before drawing conclusions about the collection — in the earlier payload fixture, r1 has two tags while r2 has none, and that difference is visible only when you check both.
Separate Invalid JSON From an Incorrect Lookup
First establish whether the body can be parsed. A syntax problem and an unexpected nesting level require different corrections.
A syntax problem. Consider this input:
{"items":[{"id":"r1"}],}
Expected inspection outcome: invalid JSON. The comma immediately before the final closing brace is a trailing comma, which JSON objects and arrays cannot contain; JSON syntax also does not allow comments. The explanatory comments in this guide’s JavaScript examples appear outside the quoted JSON input. Response.json() can reject with a SyntaxError when the body cannot be parsed — keep the original body associated with that failure so you can inspect the actual text rather than a reconstructed example.
A structural mismatch. This different fixture has an additional wrapper:
const wrapped = JSON.parse('{"data":{"result":{"items":[{"id":"r1"}]}}}');
wrapped.data.result.items[0].id; // Expected: "r1"
The root has a data property whose child contains result; the root itself has no result property. A lookup planned around wrapped.result therefore starts at the wrong level — include the data step to reach the intended record. This is the classic shape of an envelope response, and it produces errors like “undefined is not an object” rather than anything mentioning the field you actually wanted.
Record the parsing outcome and the first structural mismatch separately. If the body parses, inspect the actual containers before editing the response; if parsing fails, investigate the original text before attempting any nested lookup.
Compare Raw Tokens and Repeated Names
When investigating a suspected numeric discrepancy, preserve the original token and record the actual parsed result from the environment under investigation. Use this synthetic input as a comparison exercise:
const numberText = '{"id":9007199254740993}';
const parsedNumber = JSON.parse(numberText);
const observedId = parsedNumber.id;
The original numeric token is 9007199254740993. Inspect observedId and write down the displayed result; confirm the parser’s documented number handling before interpreting that comparison or making any claim about precision:
| Evidence to retain | What to record |
|---|---|
| Original body text | The exact token supplied for id |
| Complete lookup | parsedNumber.id |
| Observed parsed value | The result displayed in the environment being checked |
| Parser details | Its identity and documented numeric behavior |
If an identifier appears inconsistent, ask the API owner how it is intended to be represented — a string-encoded identifier is the usual fix. Keep the original response available while investigating; changing a local example does not establish what the API returned.
Check repeated-name handling explicitly, too. Preserve this separate synthetic input as text:
{"status":"ready","status":"queued"}
It contains two occurrences of the property name status with different values. Check the chosen parser’s documentation and observed behavior to determine how it handles that input — record whether it accepts the text, what it exposes, and whether it reports a problem, and attribute any conclusion to that parser and its documented policy. Verify the stated policies before relying on token preservation or duplicate rejection: ask whether numeric tokens are preserved, whether repeated names are rejected, and how any accepted duplicates are presented. Finish the investigation with a compact record of the original text, complete path, selected identifier, observed value, and relevant parser behavior — those details let another reader follow the lookup and assess the mismatch. The JSON inspector on this site supports the whole workflow locally: paste the response, expand branch by branch, and the raw pane keeps the untouched text for the token comparisons above.