Skip to main content
Back to Dev generators

Dev

Mock Pagination Link Generator

Used by developers, writers, and creators worldwide.

A mock pagination link generator produces the first, previous, next, and last links that REST APIs return to help clients page through results. When you build or test pagination — a results list, an infinite scroll, or a client that follows link relations — you need a realistic set of paging URLs to work against. This tool emits a JSON object of pagination links based on the current page, mirroring the common HATEOAS-style links pattern, so your test data behaves like a real paginated endpoint. Enter the current page and generate. It is ideal for developers building API clients, testing pagination UI, and mocking endpoints. The previous link is correctly null on the first page, so your code can exercise the edge cases of paging — the start and end of a result set — without needing a live backend to page against.

Loading usage…

Free forever — no account required

How to use

  1. Choose your options above
  2. Click Generate
  3. Copy your result

Detailed instructions

  1. Enter the current page number.
  2. Click Generate to produce pagination links.
  3. Copy the JSON into your mock or fixture.
  4. Try page 1 to test the null prev edge case.

Use Cases

  • Mocking a paginated API response
  • Testing pagination UI and controls
  • Building a client that follows link relations
  • Fixtures for infinite-scroll logic
  • Exercising first/last page edge cases

Tips

  • Test page 1 and the last page for edge cases.
  • Match the link relations to your real API.
  • Wrap the links in your standard response envelope.
  • Pair with a mock-pagination-response generator for full data.

FAQ

what are pagination links in a rest api

They are URLs an API returns — typically first, prev, next, and last — that let a client navigate pages of results without constructing URLs itself. This HATEOAS-style pattern keeps clients decoupled from the paging scheme.

why is the prev link sometimes null

On the first page there is no previous page, so the prev link is null. Generating that correctly lets you test how your client handles the edges of a result set — the very behaviour pagination bugs tend to hide in.

can i use this to test my api client

Yes — it gives you a realistic links object to feed your client or UI without a live backend. Change the current page to simulate being at the start, middle, or end of a paginated result set and verify your code responds correctly.