Operations (sample payloads)

Main operations
Copy

Paginate JSON
Copy

Paginate an array or object inside a large JSON file.

Sample Input

1
{
2
"file": {
3
"data": [
4
{
5
"id": 1,
6
"name": "John Doe",
7
"email": "john@example.com"
8
},
9
{
10
"id": 2,
11
"name": "Jane Smith",
12
"email": "jane@example.com"
13
},
14
{
15
"id": 3,
16
"name": "Bob Johnson",
17
"email": "bob@example.com"
18
},
19
{
20
"id": 4,
21
"name": "Alice Brown",
22
"email": "alice@example.com"
23
},
24
{
25
"id": 5,
26
"name": "Charlie Davis",
27
"email": "charlie@example.com"
28
}
29
]
30
},
31
"is_array": true,
32
"path": "data",
33
"page_size": 2,
34
"page_number": 1
35
}

Sample Output

1
{
2
"results": [
3
{
4
"id": 3,
5
"name": "Bob Johnson",
6
"email": "bob@example.com"
7
},
8
{
9
"id": 4,
10
"name": "Alice Brown",
11
"email": "alice@example.com"
12
}
13
]
14
}

Paginate newline-delimited JSON (NDJSON)
Copy

Paginate a large NDJSON file.

Sample Input

1
{
2
"file": {
3
"name": "large_data.ndjson",
4
"content": "eyJpZCI6MSwidXNlcm5hbWUiOiJqb2huZG9lIn0KeyJpZCI6MiwidXNlcm5hbWUiOiJqYW5lc21pdGgifQp7ImlkIjozLCJ1c2VybmFtZSI6ImJvYmJyb3duIn0K..."
5
},
6
"page_size": 2,
7
"page_number": 1
8
}

Sample Output

1
{
2
"results": [
3
{
4
"id": 3,
5
"username": "bobbrown"
6
},
7
{
8
"id": 4,
9
"username": "alicejohnson"
10
}
11
]
12
}