AI Compare Ninja AI Compare Ninja

Compare AI tools. Use prompts and skills.

Language
EN

Choose pagination for an API list

Prompt that sets cursor or page numbers, stable sorting, page size and response format for an API list. Paste it into an AI tool of your choice, which then defines pagination.

Topic
Apps & prototypes
Type
Prompt
Level
Intermediate
Time
about 8 min

Results depend on the tool, the model and what you enter.

Result preview

Example: written by our editors, not real AI output.

Recommendation: cursor instead of page numbers, because new orders arrive all the time Sort order: created_at descending, then ID Page size: default 50, at most 200 Request: GET /orders?limit=50&cursor=eyJ0IjoiMTA6MzAiLCJpZCI6OTkxfQ Response: { "data": [...], "next_cursor": "eyJ0Ijo...", "has_more": true } New entries while paging: appear only on the next refresh, never twice Tests: empty list, exactly 50 entries, last page, tampered cursor → 400

Fill in

What you type stays in this browser window. We store and send nothing.

Which list?
How large is it, how often does it change?
Who calls the list?

Your prompt

This is an instruction for an AI, not the result itself.

Where this prompt works

These AI tools are a good fit for this prompt:

How to use it

  1. Fill in the fields or tap a suggestion. Leave out names, addresses and other personal data.
  2. Copy the finished prompt into an AI tool of your choice.
  3. Have a test page through the whole list twice while entries are added in parallel, and check that every entry appears exactly once.

Why does this work?

Page numbers with offsets are simple but become slow and inaccurate for large or fast-changing lists. A stable sort order and a cursor make paging predictable.

Tips

  • Return the cursor as an opaque string. Then you can change the technique behind it later without breaking existing clients.

Also a good fit

You may use our prompts freely, including at work. Please do not republish them as your own collection. We give no warranty for AI results; check them yourself. Terms of use