# Pagination Search responses return a data array plus meta.next_cursor. Pass that cursor back as the cursor parameter to fetch the next page, and stop when it comes back null. Each page holds up to 100 rows (set limit to choose fewer), and 1 credit per 100 rows returned, minimum 1, so walking a long result set costs one credit per full page.Checked on 2026-11-12.Official source: [API docs](https://samgovapi.io/docs) | Field | meta.next_cursor | | --- | --- | | Max limit | 100 | | Cost | 1 credit per 100 rows returned, minimum 1 | ## Loop ``` cursor = None while True: page = get(url, cursor) handle(page['data']) cursor = page['meta'].get('next_cursor') if not cursor: break ``` ## How cursors behave A cursor is opaque: treat it as a token, never parse or build one yourself. It encodes the position after the last row you received, so new records published while you page do not shift rows you have already read. Keep the same query parameters on every request in a loop; changing filters or sort order mid-walk invalidates the cursor and the API answers with a 400 error naming the problem. ## Choosing a page size Larger pages mean fewer round trips and the same credit cost per row, which suits nightly syncs and bulk exports. Smaller pages return faster, which suits an interactive table that shows twenty results at a time. The keyless search tool on the MCP server and the free lookups use the same cursor field. ## Stopping early You can stop at any page; nothing stays open on the server and unused cursors simply expire. To resume later, start a fresh query rather than reusing an old cursor, because the result set may have changed overnight when opportunities and awards refresh. ## Related - [Python](https://samgovapi.io/python) - [Credits](https://samgovapi.io/docs/credits) - [JavaScript](https://samgovapi.io/javascript)Updated 2026-11-12. Sources checked 2026-11-12.Independent. Not affiliated with, endorsed by or sponsored by GSA, SAM.gov or any U.S. government agency. Registering in SAM.gov is free at sam.gov.

---

HTML version: https://samgovapi.io/docs/pagination . Markdown: https://samgovapi.io/docs/pagination.md

Independent. Not affiliated with, endorsed by or sponsored by GSA, SAM.gov or any U.S. government agency. Registering in SAM.gov is free at sam.gov.

Get a free API key: https://samgovapi.io/sign-up?ref=ai-claudebot
