Skip to main content
All list endpoints in the Interstellas API return paginated results. Use the page and limit query parameters to control which subset of records you receive.

Query parameters

page
integer
The page number to retrieve. Starts at 1. Defaults to 1 if omitted.
limit
integer
The number of records to return per page. Defaults to 10.
Example request for page 2 with 25 results per page:
GET /api/v1/clients/members?page=2&limit=25

Pagination object

When a list endpoint returns paginated data, the response includes a pagination object alongside data:
{
  "status": true,
  "message": "Members retrieved successfully.",
  "data": [...],
  "pagination": {
    "totalCount": 84,
    "hasNextPage": true,
    "hasPreviousPage": true,
    "nextPage": 3,
    "previousPage": 1,
    "limit": 25,
    "lastPage": 4
  }
}
pagination.totalCount
integer
Total number of records matching the current query, across all pages.
pagination.hasNextPage
boolean
true if more records exist after the current page.
pagination.hasPreviousPage
boolean
true if records exist on earlier pages.
pagination.nextPage
integer
Pass this value as ?page= to fetch the next page. Only meaningful when hasNextPage is true.
pagination.previousPage
integer
Pass this value as ?page= to fetch the previous page. Only meaningful when hasPreviousPage is true.
pagination.limit
integer
The page size used for this response — reflects your limit parameter or the default of 10.
pagination.lastPage
integer
The final page number, derived from totalCount ÷ limit.

Iterating all pages

Node.js
async function fetchAll(url, headers) {
  let page = 1;
  let hasNextPage = true;
  const results = [];

  while (hasNextPage) {
    const res = await fetch(`${url}?page=${page}&limit=50`, { headers });
    const json = await res.json();
    results.push(...json.data);
    hasNextPage = json.pagination.hasNextPage;
    page = json.pagination.nextPage;
  }

  return results;
}