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

ParameterTypeRequiredDefaultDescription
pagenumberOptional1The page number to retrieve. Pages are 1-indexed.
limitnumberOptional10Number of results per page. Maximum value is 100.
Example Request
# 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:

FieldTypeDescription
pagenumberCurrent page number
limitnumberNumber of results per page
totalnumberTotal number of results across all pages
totalPagesnumberTotal number of pages
hasNextPagebooleanWhether there is a next page of results
hasPrevPagebooleanWhether there is a previous page of results
Example Meta Object200
{
  "meta": {
    "page": 2,
    "limit": 20,
    "total": 85,
    "totalPages": 5,
    "hasNextPage": true,
    "hasPrevPage": true
  }
}

Responses also include a links object with pre-built URLs for easy navigation:

FieldTypeDescription
selfstringURL for the current page
nextstring | nullURL for the next page, or null if on the last page
prevstring | nullURL for the previous page, or null if on the first page
Example Links Object200
{
  "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:

Full Response with Pagination200
{
  "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:

Paginate Through All Results
javascript
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.