Skip to main content
The Streamforge External API uses cursor-based pagination for all list endpoints. This approach provides stable, efficient pagination that avoids duplicates when data changes between requests.

How Cursor Pagination Works

Unlike offset-based pagination (e.g., page=1, page=2), cursor pagination uses opaque tokens that point to a specific position in the dataset. This means:
  • Stable results: New items added to the beginning won’t cause duplicates
  • Efficient: No need to skip through large offsets
  • Consistent: Results remain consistent even as data updates

Using Cursors

All list endpoints return a next_cursor in paging:

Basic Pagination Pattern

Choosing a Limit

The limit parameter controls how many items are returned per page:
  • Minimum: 1 item
  • Maximum: 25 items. A larger limit is lowered to 25
  • Default: 10 items for profile and content lists, 20 for game content, 25 for brands and industries
  • Credit cost: Each page is one call, charged once whatever its limit: 0.01 credit for profile, content, game content and brand lists, 0.1 credit for industry pages

Limit Selection Guidelines

  • Whole lists: Use limit=25. A page costs the same at any size, so full pages make the fewest calls
  • Real-time updates: Use smaller limits to detect new items faster

Cursor Stability

Cursors are stable tokens that remain valid even as new data arrives. However:
  • Cursors don’t expire, but they may become less efficient over time
  • If you pause pagination for days/weeks, consider restarting from the beginning
  • Cursors encode the sort position, so changing sort order requires a new cursor

Endpoints with Pagination

The following endpoints support cursor-based pagination:
  • GET /platforms/{platform}/profiles - Browse profiles
  • GET /platforms/{platform}/content - List all content
  • GET /platforms/{platform}/profiles/{profile_id}/content - List content by creator
  • GET /platforms/{platform}/games/{game_id}/content - List content for a game
  • GET /brands - List brands by sponsorship activity
  • GET /industries - List industries (36 in all, two pages at the default limit)
  • GET /industries/{industry_id} - An industry’s brand ranking. Keep the same sort on every page; ranks continue across pages, so the second page starts at rank 26

Best Practices

Always check if next_cursor is null before making another request. A null cursor means you’ve reached the end of the results.
  • Respect rate limits: Don’t paginate too aggressively; monitor your quota usage
  • Handle errors: Implement retry logic for failed pagination requests
  • Store cursors: If resuming pagination, store the last cursor to avoid re-fetching data
  • Batch processing: For large datasets, process items in batches rather than loading everything into memory

Example: Paginating Content

Common Pitfalls

Don’t use offset-based pagination patterns. The API doesn’t support page or offset parameters.
  • Assuming page numbers: There are no page numbers; only cursors
  • Reusing old cursors: While stable, very old cursors may not reflect current data
  • Ignoring null cursors: Always check for null to avoid infinite loops
  • Not handling empty results: An empty payload array with a null cursor means no results