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 |
|---|---|---|
posts[].slug | string | A URL-friendly identifier used in links. |
posts[].author | object | Embedded so one request is enough to display the list. |
posts[].tags | array of strings | A many-to-many relation expressed as a list of names. |
posts[].publishedAt | string | ISO 8601 timestamp, sortable as text. |
posts[].commentsCount | number | A precomputed number so the list does not need the comments. |
Read it in code
JavaScript:
const byAuthor = Object.groupBy(data.posts, (p) => p.author.handle);Python:
from collections import defaultdict
by_author = defaultdict(list)
for p in data["posts"]:
by_author[p["author"]["handle"]].append(p)What this example is good for
- Prototyping a blog or news list
- Grouping by author or tag with code or JSONPath
- Converting to YAML or XML for static site generators and feeds
Tips
- Embedding the author repeats data in every post; referencing an authorId saves space but needs a second lookup.
- Sort by publishedAt: ISO 8601 strings sort correctly as plain text.
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