JSON Forge
100% Client-Side: your data is never sent to a server

JSON examples

Paginated API Response JSON Example

List endpoints rarely return everything at once. This example shows the common envelope: the items under data, paging details under meta and navigation links under links.

Loading editor…
Paste or type JSON on the left to explore it as a tree.
Empty🔒 Processed locally in your browser

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

PathTypeNotes
dataarray of objectsThe items of the current page.
meta.page / perPagenumberWhere you are and how big a page is.
meta.total / totalPagesnumberHow many items and pages exist in total.
links.next / prevstring or nullReady-made URLs. On the last page, next is usually null or missing.

Read it in code

JavaScript:

let url = firstUrl;
const all = [];
while (url) {
  const page = await (await fetch(url)).json();
  all.push(...page.data);
  url = page.links.next ?? null;
}

Python:

url, items = first_url, []
while url:
    page = requests.get(url).json()
    items += page["data"]
    url = page["links"].get("next")

What this example is good for

Tips

Convert this example

Open it in a converter, then switch the output in the Code tab:

More examples

All JSON examples · Cheat sheets