Renidlyrenidly
Core Concepts

Pagination

3 min read

List endpoints return one page at a time. Renidly uses two pagination styles — page numbers and opaque cursors — and a list endpoint's response tells you which one it speaks.

Whichever style an endpoint uses, the rule is the same: control page size with limit, and look at the pagination block in the response to decide whether to fetch more. has_moreis the canonical “keep going?” flag — when it is false, you have the whole set.

StyleYou sendYou read backBest for
Page-basedpage, limitpagination.has_moreBrowsing, jumping to a known page.
Cursor-basedcursor, limitpagination.next_cursorStreaming a large set; deep pages stay fast.

Page-based

Start at page=1 and increment until has_more is false. limit sets the page size.

# Page-based: increment the page until has_more is false
curl "https://renidly.com/api/data/v1/companies/employees?slug=google&page=1&limit=20" \
  -H "X-renidly-apikey: $RENIDLY_API_KEY"
{
  "success": true,
  "statusCode": 200,
  "message": "Data retrieved successfully",
  "errors": null,
  "data": [ /* this page of records */ ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "has_more": true
  }
}

Cursor-based

The first call omits cursor. The response carries a next_cursor — pass it back unchanged as ?cursor=… to get the next page. When has_more is false, next_cursor is empty and you are done. Because a cursor points at an exact position, deep pages stay as fast as the first.

# Cursor-based: pass back the cursor you were handed
curl "https://renidly.com/api/data/v1/people/search?title=engineer&limit=25&cursor=cur_5ehe8408s7tme" \
  -H "X-renidly-apikey: $RENIDLY_API_KEY"
{
  "success": true,
  "statusCode": 200,
  "message": "Data retrieved successfully",
  "errors": null,
  "data": [ /* this page of records */ ],
  "pagination": {
    "limit": 25,
    "has_more": true,
    "next_cursor": "cur_8kf3q2p9w1xyz"
  }
}

Iterating safely

The canonical loop walks pages until has_more is false, holding only one page in memory at a time — which also keeps you naturally within your rate limit.

// Cursor loop — holds one page in memory, stops when has_more is false.
async function paginate(path: string) {
  let cursor: string | undefined;
  do {
    const url = new URL("https://renidly.com" + path);
    url.searchParams.set("limit", "50");
    if (cursor) url.searchParams.set("cursor", cursor);

    const body = await fetch(url, {
      headers: { "X-renidly-apikey": process.env.RENIDLY_API_KEY! },
    }).then((r) => r.json());

    if (!body.success) throw new Error(body.message);
    yield body.data;

    cursor = body.pagination?.has_more ? body.pagination.next_cursor : undefined;
  } while (cursor);
}

The start offset

Some endpoints accept an offset-style start parameter (0, then the page size, and so on) instead of, or alongside, the styles above. The response still tells you when to stop. The interactive playground shows exactly which parameters each endpoint takes — the reliable way to see an endpoint's pagination shape without guesswork.