The example
The JSON above is the example. Explore it in the Tree tab, press Download to save it as a .json file, or Share to send someone a link to it. All names, ids, emails and values are invented.
Fields explained
| Path | Type | Notes |
|---|---|---|
company | object | The root of the structure. |
company.departments | array of objects | Each department has a name and a list of teams. |
company.departments[].teams | array of objects | Teams belong to a department. |
company.departments[].teams[].members | array of objects | People, the deepest level here. |
Read it in code
JavaScript:
const first = data.company.departments[0].teams[0].members[0].name; // "Ada"Python:
first = data["company"]["departments"][0]["teams"][0]["members"][0]["name"] # AdaWhat this example is good for
- Learning JSONPath: $..members[*].name finds every member at any depth
- Practising tree navigation and copying paths
- Testing code that walks recursive structures
Tips
- Deep nesting is easy to read in a tree but awkward in code; flatten it when you can.
- Use the copy path button in the tree to get the exact path of any value.
Convert this example
Open it in a converter, then switch the output in the Code tab:
- JSON to TypeScript
- JSON to Zod
- JSON to Python (Pydantic)
- JSON to Go
- JSON to JSON Schema
- JSON to CSV
- JSON to YAML
- JSON to XML