Pagination
Learn how to paginate through large result sets using page-based pagination.
All list endpoints in the IPO Guruji API use page-based pagination. Results are returned in pages, and you can control the page number and page size using query parameters. Pagination metadata and navigation links are included in every list response.
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page | number | Optional | 1 | The page number to retrieve. Pages are 1-indexed. |
limit | number | Optional | 10 | Number of results per page. Maximum value is 100. |
# Get page 2 with 20 results per pagecurl -X GET "https://api.ipoguruji.com/v1/ipos?page=2&limit=20" \ -H "X-API-Key: ipg_live_your_api_key_here"The Meta Object
Every list response includes a meta object with pagination information:
| Field | Type | Description |
|---|---|---|
page | number | Current page number |
limit | number | Number of results per page |
total | number | Total number of results across all pages |
totalPages | number | Total number of pages |
hasNextPage | boolean | Whether there is a next page of results |
hasPrevPage | boolean | Whether there is a previous page of results |
{
"meta": {
"page": 2,
"limit": 20,
"total": 85,
"totalPages": 5,
"hasNextPage": true,
"hasPrevPage": true
}
}The Links Object
Responses also include a links object with pre-built URLs for easy navigation:
| Field | Type | Description |
|---|---|---|
self | string | URL for the current page |
next | string | null | URL for the next page, or null if on the last page |
prev | string | null | URL for the previous page, or null if on the first page |
{
"links": {
"self": "/v1/ipos?page=2&limit=20",
"next": "/v1/ipos?page=3&limit=20",
"prev": "/v1/ipos?page=1&limit=20"
}
}Full Paginated Response
Here is a complete example showing how pagination fields appear in a typical response:
{
"success": true,
"data": [
{
"id": "ipo_abc123",
"slug": "example-ipo",
"name": "Example IPO",
"status": "LISTED"
},
{
"id": "ipo_def456",
"slug": "another-ipo",
"name": "Another IPO",
"status": "LISTED"
}
],
"meta": {
"page": 2,
"limit": 2,
"total": 85,
"totalPages": 43,
"hasNextPage": true,
"hasPrevPage": true
},
"links": {
"self": "/v1/ipos?page=2&limit=2",
"next": "/v1/ipos?page=3&limit=2",
"prev": "/v1/ipos?page=1&limit=2"
},
"disclaimer": "Data aggregated from publicly accessible sources. Not investment advice.",
"timestamp": "2026-02-09T14:30:00.000Z",
"requestId": "req_p4g3n2a1t0"
}Iterating Through Pages
Here is how to iterate through all pages of results programmatically:
async function fetchAllIPOs(apiKey) { const allIPOs = []; let page = 1; let hasNextPage = true; while (hasNextPage) { const response = await fetch( `https://api.ipoguruji.com/v1/ipos?page=${page}&limit=50`, { headers: { 'X-API-Key': apiKey } } ); const result = await response.json(); if (!result.success) { throw new Error(result.error.message); } allIPOs.push(...result.data); hasNextPage = result.meta.hasNextPage; page++; } console.log(`Fetched ${allIPOs.length} IPOs in total`); return allIPOs;}Best Practices
Use reasonable page sizes
Use a limit between 10 and 50 for most use cases. Larger pages reduce the number of requests but increase response size and latency.
Check hasNextPage before fetching
Always check meta.hasNextPage before requesting the next page to avoid unnecessary API calls.
Use the links object
Instead of constructing URLs manually, use the links.next and links.prev values for navigation.
Add delays between pages
When fetching multiple pages in a loop, add a small delay between requests to avoid hitting rate limits. See Rate Limits for details.