Skip to content

Pagination

List endpoints return a stable list envelope and paginate with an opaque cursor:

{
"object": "list",
"data": [ /* … items … */ ],
"has_more": true,
"next_cursor": "eyJwayI6…"
}

Pass limit (page size) and starting_after (the previous page’s next_cursor):

Terminal window
curl "https://api.sandbox.interglobe.io/v1/esims?limit=50" \
-H "Authorization: Bearer $IG_KEY"
# next page
curl "https://api.sandbox.interglobe.io/v1/esims?limit=50&starting_after=eyJwayI6…" \
-H "Authorization: Bearer $IG_KEY"

Stop when has_more is false. Cursors are opaque — don’t parse them; just pass the last next_cursor straight back.

let cursor: string | undefined;
do {
const page = await ig.esims.list({ limit: 50, starting_after: cursor });
for (const esim of page.data) {
// …
}
cursor = page.has_more ? page.next_cursor : undefined;
} while (cursor);