Skip to content
jsonblocks

Sample API response in JSON

A realistic paginated API response: a users array wrapped in a data and pagination envelope, with every JSON type represented. Copy it for testing, or open it in the viewer with one click.

Open in viewer

Real list endpoints rarely return a bare array. They wrap rows in an object carrying the page, the page size, the total, and a has-more flag - exactly the shape below.

The document

json
{
  "data": [
    {
      "id": "user_01",
      "name": "Ada Lovelace",
      "email": "ada@example.com",
      "verified": true,
      "loginCount": 128,
      "lastLogin": null,
      "roles": ["admin", "editor"]
    },
    {
      "id": "user_02",
      "name": "Alan Turing",
      "email": "alan@example.com",
      "verified": false,
      "loginCount": 3,
      "lastLogin": "2026-09-28T14:02:11Z",
      "roles": ["viewer"]
    }
  ],
  "page": 1,
  "perPage": 25,
  "total": 128,
  "hasMore": true
}

What to notice

  • Envelope pattern: data holds rows while page, perPage, total, and hasMore describe the pagination.
  • Mixed types per row: strings, a number, booleans, a null lastLogin, and a roles array.
  • The null lastLogin marks a user who never logged in - explicitly empty, not missing.

Open it in the viewer

  1. Follow the viewer link to load this exact document.

  2. Collapse the data array, then expand one user at a time.

  3. Hover a block to preview its path, click to pin it, and copy $.data[0].email into your code.

Frequently asked questions

How do I open this example in the viewer?

Use the open-in-viewer link on this page: it loads this exact document into the block visualizer with repeated shapes pre-collapsed.

Can I use this JSON for testing?

Yes. Copy it into API mocks, unit tests, or formatter practice. The data is fictional.

Why wrap rows in an envelope instead of returning an array?

Envelopes carry pagination and metadata alongside rows, and they leave room to add fields without breaking clients. Bare arrays are simpler but paint you into a corner.