Operations (sample payloads)

Main operations

Paginate JSON

Paginate an array or object inside a large JSON file. Sample Input

{
    "file": {
        "data": [
            \{
                "id": 1,
                "name": "John Doe",
                "email": "john@example.com"
            \},
            \{
                "id": 2,
                "name": "Jane Smith",
                "email": "jane@example.com"
            \},
            \{
                "id": 3,
                "name": "Bob Johnson",
                "email": "bob@example.com"
            \},
            \{
                "id": 4,
                "name": "Alice Brown",
                "email": "alice@example.com"
            \},
            \{
                "id": 5,
                "name": "Charlie Davis",
                "email": "charlie@example.com"
            \}
        ]
    },
    "is_array": true,
    "path": "data",
    "page_size": 2,
    "page_number": 1
}

Sample Output

{
    "results": [
        \{
            "id": 3,
            "name": "Bob Johnson",
            "email": "bob@example.com"
        \},
        \{
            "id": 4,
            "name": "Alice Brown",
            "email": "alice@example.com"
        \}
    ]
}

Paginate newline-delimited JSON (NDJSON)

Paginate a large NDJSON file. Sample Input

{
    "file": \{
        "name": "large_data.ndjson",
        "content": "eyJpZCI6MSwidXNlcm5hbWUiOiJqb2huZG9lIn0KeyJpZCI6MiwidXNlcm5hbWUiOiJqYW5lc21pdGgifQp7ImlkIjozLCJ1c2VybmFtZSI6ImJvYmJyb3duIn0K..."
    \},
    "page_size": 2,
    "page_number": 1
}

Sample Output

{
    "results": [
        \{
            "id": 3,
            "username": "bobbrown"
        \},
        \{
            "id": 4,
            "username": "alicejohnson"
        \}
    ]
}

Was this page helpful?