API Pagination Window Calculator
Calculate API pagination windows online from item counts, page limits, latency, workers, payload size, and retry reserve to plan exports safely.{{ result.summaryTitle }}
| Metric | Value | Detail | Copy |
|---|---|---|---|
| {{ row.label }} | {{ row.value }} | {{ row.detail }} |
| Check | State | Recommendation | Copy |
|---|---|---|---|
| {{ row.check }} | {{ row.state }} | {{ row.recommendation }} |
| Plan | Workers | Window | Use case | Copy |
|---|---|---|---|---|
| {{ row.plan }} | {{ row.workers }} | {{ row.window }} | {{ row.useCase }} |
API pagination turns one large collection into a sequence of smaller responses. That keeps list endpoints usable when a resource has thousands or millions of records, but it also creates a planning question: how many requests will the full pull need, how long can those requests take, and which limit is likely to slow the job down?
The answer depends on more than record count. A larger page size can reduce request count, but only up to the endpoint's accepted maximum. A higher worker count can reduce waiting on response latency, but it does not raise the provider's request allowance. Retry backoff, throttling, response overhead, and payload size can turn a quick-looking export into a job that needs staging, storage checks, or smaller partitions.
Cursor and next-token pagination usually make long pulls easier to resume because each response tells the client where to continue. Offset and page-number pagination can be simpler to reason about, but deep offsets are more likely to be slow or unstable when records are inserted or deleted during the run. Incremental exports add another requirement: the sort key, usually a timestamp or ID, must be stable enough that the next window resumes from the right place.
A pagination estimate is not a live service guarantee. It is a preflight model for choosing a page size, checking the active bottleneck, and deciding whether a bulk export should run as one job, a cautious serial pull, or several smaller windows.
Technical Details:
A pagination window starts by converting collection size into request count. The effective page size is the requested page size unless the endpoint cap is greater than zero and lower than the requested value. The page count is rounded up because any remaining records still require another request. With zero records, the modeled request count is zero.
Retrieval time is governed by two ceilings. The rate-limit ceiling says how long the provider's request allowance takes to serve all page requests. The latency ceiling says how long the same number of page requests takes when only a fixed number of workers can be in flight at once. The displayed window uses the slower of those two ceilings, then multiplies it by the retry reserve.
Formula Core
The formulas below show the core model. Display values are rounded for reading, but the calculations use numeric seconds and bytes before formatting.
For 125,000 records at 500 records per page, the page count is 250. At 480 requests per minute, the rate-limit ceiling is 31.25 seconds. With four workers and 180 ms average latency, the latency ceiling is 11.34 seconds, so the rate limit sets the window before any retry reserve is added.
| Rule | Boundary | Effect on the result |
|---|---|---|
| Endpoint cap | API page cap > 0 and requested page size > cap | The effective page size is reduced to the cap, and the review advises lowering the sent limit. |
| Rate-limited run | Rate-limit window >= latency window | Extra workers will not shorten the modeled time unless the request allowance changes. |
| Latency-limited run | Latency window > rate-limit window | Worker count, connection reuse, and page latency have more influence until the rate ceiling catches up. |
| Offset depth warning | Offset mode and page requests > 100 | The review recommends cursor or keyset pagination when the provider supports it. |
| Large payload warning | Payload estimate > 1 TiB | The review warns against running one large export window without smaller test partitions. |
| Retry reserve | 0% to 300% | The reserve multiplies the final time window to account for retries, 429 responses, and transient 5xx responses. |
The page-size comparison uses a small candidate set around common limits and the current page size. It tests 50, 100, 250, 500, 1000, the current value, double the current value, and four times the current value, then caps candidates when an endpoint maximum is known. The fastest tested candidate is reported in the review, but it is still only a modeled tradeoff; provider-specific limits, memory pressure, and response serialization can make a smaller page size safer.
The fetch-time curve is a linear progress projection from zero to the modeled retrieval window. It is useful for planning and status notes, not for predicting each individual page. Real pages can arrive unevenly because caches, partitions, index shape, server load, and backoff timing vary during a long pull.
Everyday Use & Decision Guide:
Begin with the numbers you can defend from the API documentation or a recent sample. Enter Total items, Page size, API page cap, and Rate limit first. Add Average page latency from logs or a staging run, then set Concurrent workers to the number of requests your job can keep in flight without breaking provider policy.
Use Cursor / next-token when the API returns a next token or next URL. Use Offset / page number only when that is the provider's supported pattern, and slow down when the result crosses 100 page requests. Use Incremental export for timestamp or ID based pulls where each run resumes from a stable marker.
- Window Metrics is the first place to read the modeled retrieval window, page requests, active ceiling, payload estimate, and effective item rate.
- Window Review calls out page-size validity, pagination style risk, retry reserve, worker pressure, payload volume, and the fastest tested page-size candidate.
- Shard Plan compares a single worker baseline, the configured window, a retry-reserved window, and a latency burst check.
- Fetch Time Curve gives a progress-shaped estimate for planning notes or status updates.
- Page Size Tradeoff compares request count and modeled minutes across candidate page sizes.
A useful first pass is conservative: keep the page size at or below the documented cap, use the account-level request allowance after other clients are considered, and add a 5% to 25% retry reserve when 429 responses or transient 5xx responses are normal for the endpoint. Leave the reserve at 0% only when you want a clean best-case estimate.
A window ready summary does not prove the provider will accept every page request. It means the inputs do not trigger the calculator's built-in review flags. Before running the job, check whether the provider returns page tokens, whether custom headers must be repeated on later page requests, and whether the output storage can hold the displayed Payload estimate.
Use the review rows as the handoff checklist. If Active limiter says Rate limit, negotiate quota or partition the job instead of adding workers. If Payload volume is high, test one small window before committing to the full export.
Step-by-Step Guide:
Work from collection size to bottleneck review, then check page-size and payload warnings before using the estimate.
- Enter Total items. If the API does not return a count, use the latest estimate from an index, search count, or previous export. The summary should update Page requests once a positive count and page size are present.
- Set Page size and API page cap. If the requested value exceeds the cap, the summary moves to review plan and Window Review explains the effective page size.
- Enter Rate limit, Average page latency, and Concurrent workers. Read Rate-limit window and Latency window in Window Metrics to see which ceiling is active.
- Add Average item size and optional Response overhead. Check Payload estimate before deciding whether one export window is realistic.
- Open Advanced, set Endpoint or resource for the row labels, choose Pagination style, and add Retry reserve when retries or 429 backoff are expected.
- Use Window Review to resolve page-size, offset-depth, retry, worker, and payload recommendations. If the summary remains review plan, clear the recommendation that matches the flagged row before sharing the estimate.
- Compare Shard Plan and Page Size Tradeoff only after the input values are credible. The charts and JSON output should match the same modeled totals shown in Window Metrics.
Interpreting Results:
The main result is Modeled retrieval window. It is the slower of the rate-limit and latency ceilings after retry reserve is applied. Read it beside Page requests and Payload estimate; a short time with a very large payload can still require storage, compression, and restart planning.
The summary status is a review cue, not a release approval. window ready means no built-in warning fired. review plan means at least one input combination deserves attention, such as a requested page size above the cap, a deep offset run, or a payload estimate above 1 TiB.
| Output | Trust this for | Do not overread |
|---|---|---|
| Page requests | How many list calls the modeled page size needs. | It does not prove the API will return a total count or stable next token. |
| Rate-limit window | The minimum time implied by the request allowance. | It does not include provider-side policy changes during the run. |
| Latency window | The time implied by page latency and worker count. | It assumes the average page latency is representative of the full pull. |
| Payload estimate | Storage and transfer planning from item bytes plus per-page overhead. | It is not a compression or database import estimate. |
| Page-size tradeoff | Comparing common page sizes against request count and modeled minutes. | The fastest candidate is not always the safest provider setting. |
Verify the result against one real sample before running a large job. A 20-page trial can confirm average item size, latency, token behavior, exposed rate-limit headers, and whether retries change the modeled window.
Worked Examples:
Orders export limited by request allowance
For /v1/orders, use 125,000 total items, a 500 item page size, a 1,000 item API page cap, 480 requests per minute, 180 ms average latency, four workers, and 900 bytes per item. Window Metrics shows 250 page requests, a 31.3 second Rate-limit window, an 11.3 second Latency window, and about 107.29 MiB of payload.
The modeled retrieval window is 31.3 seconds because the request allowance is slower than the worker-latency path. Adding more than four workers does not help much unless the request allowance rises or the job is partitioned across allowed quota groups.
Requested page size above the endpoint cap
Keep the same 125,000 record export but request 2,000 items per page while the API page cap is 1,000. The effective page size becomes 1,000, so Page requests falls to 125 rather than the 63 requests a 2,000 item page would imply. Window Review reports Page-size validity with a recommendation to lower the requested limit to 1,000 or less.
This is a planning correction, not just a formatting detail. If the job is shipped with an invalid limit, the provider might ignore it, clamp it, or reject the request depending on the endpoint.
Deep offset run with retry reserve
An inventory sync has 250,000 items, 500 items per page, 300 requests per minute, 250 ms average latency, two workers, 1,200 bytes per item, 2 KiB response overhead, offset pagination, and a 15% retry reserve. The result is 500 page requests, a 100 second Rate-limit window, a 62.5 second Latency window, and a 115 second Modeled retrieval window after reserve.
Window Review flags the offset depth because 500 pages is above the 100 page warning boundary. If the provider offers cursor or keyset pagination, switch before treating the estimate as a production plan.
FAQ:
Why does adding workers sometimes barely change the time?
The final window uses the slower of Rate-limit window and Latency window. Once the rate limit is active, extra workers mostly add pressure without increasing the allowed request rate.
What should I enter if the API does not return a total count?
Use a current estimate from a search count, database count, previous export, or sampling run. If Total items is zero, the modeled page request count is zero unless your API still requires a confirmation call.
Why did the page size change in the result?
When API page cap is greater than zero and below the requested Page size, the calculation uses the cap. Window Review explains the mismatch and recommends lowering the sent limit.
Should I choose cursor, offset, or incremental pagination?
Choose cursor or next-token mode when the provider returns a continuation token. Choose offset only when the endpoint requires it, and treat offset runs above 100 pages as review cases. Use incremental mode when a stable timestamp or ID lets the export resume cleanly.
Does the calculator call my API endpoint?
No. The calculation runs in the browser from the values you enter. Avoid putting secrets in Endpoint or resource, because form values can be carried in the page URL when you share or reopen the same state.
Glossary:
- API pagination
- Returning a large collection in smaller pages rather than one oversized response.
- Page size
- The number of records requested in each page response, often sent as
limit,page[size],per_page, or a similar parameter. - Cursor
- A continuation value, next token, or next URL returned by the provider to identify where the next page should begin.
- Offset pagination
- A page-number or row-offset pattern where deep page positions can become slower or less stable as the collection changes.
- Rate limit
- The request allowance for an account, token, endpoint, or quota partition over a time period.
- Latency window
- The modeled time needed when page latency and worker count are the active constraint.
- Retry reserve
- An added time percentage for throttling, 429 backoff, transient 5xx responses, or other repeat attempts.
- Payload estimate
- The projected response volume from average item bytes plus fixed response overhead per page.
References:
- Paging Microsoft Graph data in your app, Microsoft Learn, last updated 2025-04-03.
- TokenPagination, Google for Developers, last updated 2025-05-21 UTC.
- Using pagination in the REST API, GitHub Docs.
- JSON:API Cursor Pagination Profile, JSON:API.
- RFC 6585: Additional HTTP Status Codes, RFC Editor, April 2012.