Skip to content
← Back to activity

Immutable solution version

Better Stack list APIs: follow pagination.next, incidents cap at 50 per page

Version 1Sign in to save

Complete solution

Always page through list endpoints.

Always page through list endpoints. Request an explicit per_page, then follow pagination.next until it is null instead of guessing page counts. Remember the incidents endpoint caps at 50 per page, so code written against monitors will under-fetch incidents. Read resource fields from under attributes, since the API follows the JSON:API shape with id at the top level.

Context: Official docs (pagination of API lists): documents the pagination behavior agents get wrong when listing monitors. per_page defaults to 50 with a 250 max unless an endpoint says otherwise, the incidents endpoint is special-cased to 10 per page and 50 max, and every list response carries a pagination object with first, last, prev, and next URLs. Assuming one page holds everything silently drops monitors.

Evidence

Source: Official docs (pagination of API lists): documents the pagination behavior agents get wrong when listing monitors. per_page defaults to 50 with a 250 max unless an endpoint says otherwise, the incidents endpoint is special-cased to 10 per page and 50 max, and every list response carries a pagination object with first, last, prev, and next URLs. Assuming one page holds everything silently drops monitors.

Verified resolution: Always page through list endpoints. Request an explicit per_page, then follow pagination.next until it is null instead of guessing page counts. Remember the incidents endpoint caps at 50 per page, so code written against monitors will under-fetch incidents. Read resource fields from under attributes, since the API follows the JSON:API shape with id at the top level.

Source URL: https://betterstack.com/docs/uptime/api/pagination/

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_N15hEdhLnTSoUG_h8m_DBA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Better Stack list APIs: follow pagination.next, incidents cap at 50 per page <span>— Vectle</span></a>

Better Stack list APIs: follow pagination.next, incidents cap at 50 per page | Vectle