Skip to main content
Some actions return multiple pages of results, especially search actions and extractions that return lists of data. How pagination works depends on your execution mode.

Quick Decision Guide

Not sure which approach fits your use case? Here’s how to decide:
  • ⚡️ Live mode is ideal when you have a single input and expect few results. It’s the simplest and fastest way to get your data immediately.
  • 📦 Async/Schedule modes are better suited when you expect a lot of results and want to avoid manual pagination. Results are streamed progressively via callbacks, as soon as they’re processed.
Result count may vary: LinkedIn and other platforms may insert sponsored content or dynamic results that don’t match your exact request. We filter these out, which may result in fewer results than expected.

Execution Modes & Pagination

Edges handles pagination differently based on your execution mode:
Execution ModeWho Handles PaginationHow You Control It
liveYou (manually)Use page param and follow response headers
async/scheduleEdgesUse max_results parameter only
  • live mode: You handle pagination manually using page parameters and headers.
  • async/schedule modes: Pagination is automatic — you just specify how many results you want.

Async Pagination (Automatic)

In async and schedule modes, pagination is completely automated:
  • No manual handling required - Edges handles all pagination internally
  • Use max_results parameter - Specify how many total results you want
  • Results delivered via callbacks - Each page generates a separate callback
  • Progressive delivery - Start receiving data immediately
max_results has a default value for each action (see API Reference). There’s also a maximum limit you cannot exceed (0 <= x <= max_value).

How Async Pagination Works

  1. You specify max_results: 100 in your request
  2. Edges automatically paginates with optimal page_size
  3. You receive multiple callbacks, each with a batch of results
  4. Each callback has status: RUNNING until the final SUCCEEDED callback
For detailed callback handling, see Managing Callbacks.

Live Pagination (Manual)

In live mode, you control pagination manually for real-time responses:
In live mode, you won’t receive the total number of pages in advance.
In any case, you should keep following the X-Pagination-Next header until it’s no longer present — this means you’ve reached the end.
As you have full ownership over fetching the results, live mode does not support max_results parameter.

Pagination Parameters

page_size
number
Maximum number of items per page (read-only, varies by action)
page
number
Page number to retrieve (defaults to 1)

Pagination Headers

Each response includes headers to help you navigate:
X-Pagination-Next
string
URL for the next page — follow this exactly (may include a token)
X-Pagination-Previous
string
Not always present — some actions (especially LinkedIn ones) do not support previous page navigation

Two Types of Live Pagination

Live mode supports two different pagination approaches:

Standard Pagination

  • Use page parameter to navigate (e.g., ?page=1, ?page=2)
  • X-Pagination-Previous header is available for backward navigation
  • You can jump to specific page numbers directly

Token-Based Pagination

Some LinkedIn-based actions (e.g. linkedin-extract-post-reposters) require token-based pagination:
  • The X-Pagination-Next header includes a token query parameter (example: ?page=2&token=...)
  • This token is mandatory to access the next page
  • It may change for each page, so you must always follow the latest X-Pagination-Next URL
  • You cannot jump to a specific page number (e.g., page 33 is not directly addressable)
  • The X-Pagination-Previous header is never present in this mode
Do not try to guess or reuse an old token — always rely on the X-Pagination-Next header provided by the previous response.
Best practice: Always follow the X-Pagination-Next header as-is and stop when it’s no longer present: you reached the last page! This universal approach works for both standard and token-based pagination, ensuring a robust implementation.

Live Pagination Examples

Example 1: Standard Pagination

1

1. Make the initial request

Use the page parameter to start fetching the first page of results (this is the default).
curl -i --request POST \
  --url 'https://api.edges.run/v1/actions/salesnavigator-search-company-employees/run/live?page=1' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <your-api-key>' \
  --data '{
    "parameters": {},
    "identity_mode": "auto"
  }'
2

2. Check the response headers

Examine the response headers to find pagination info:
  • X-Pagination-Previous: null (first page) or URL for previous page
  • X-Pagination-Next: URL for next page or null if last page
3

3. Fetch the next page

Use the URL from X-Pagination-Next or manually increment the page:
curl -i --request POST \
  --url 'https://api.edges.run/v1/actions/salesnavigator-search-company-employees/run/live?page=2' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <your-api-key>' \
  --data '{
    "parameters": {},
    "identity_mode": "auto"
  }'
4

4. Continue until done

Repeat until the X-Pagination-Next header is no longer present, meaning you’ve reached the last page.

Example 2: Token-Based Pagination

1

1. Make the initial request

Start with the first page (same as standard pagination):
curl -i --request POST \
  --url 'https://api.edges.run/v1/actions/linkedin-extract-post-reposters/run/live?page=1' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <your-api-key>' \
  --data '{
    "parameters": {
      "post_url": "https://www.linkedin.com/posts/..."
    },
    "identity_mode": "auto"
  }'
2

2. Check the response headers

Look for the X-Pagination-Next header which will include a token:
  • X-Pagination-Next: ?page=2&token=1046206301-... (includes required token)
  • X-Pagination-Previous: not present in token-based pagination
3

3. Fetch the next page

Must use the exact URL from X-Pagination-Next (including the token):
curl -i --request POST \
  --url 'https://api.edges.run/v1/actions/linkedin-extract-post-reposters/run/live?page=2&token=1046206301-...' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <your-api-key>' \
  --data '{
    "parameters": {
      "post_url": "https://www.linkedin.com/posts/..."
    },
    "identity_mode": "auto"
  }'
4

4. Continue until done

Repeat until the X-Pagination-Next header is no longer present.
Critical: Always use the exact URL from X-Pagination-Next — you cannot construct URLs manually or reuse old tokens.
Don’t want to handle pagination manually?
Use async or schedule modes — Edges will handle pagination and stream results via callbacks.

Best Practices Summary

For Live Mode

  • Follow the X-Pagination-Next header iteratively until it is no longer present
  • Avoid relying on page parameter or X-Pagination-Previous header: this strategy works across all actions (including those with token-based pagination) and ensures a robust, universal implementation
  • Always use the exact URL from X-Pagination-Next for token-based pagination

For Async/Schedule Modes

  • Set max_results parameter to control how many total results you want
  • Results are delivered progressively via callbacks as soon as they’re processed
  • No manual pagination handling required
I