Skip to content

Pagination

TeemoCell edited this page Jul 20, 2026 · 2 revisions

Pagination

Steam services use different pagination models. Do not apply one pagination strategy to every endpoint.

App list

app()->GetAppList() follows IStoreService result pages automatically.

$apps = $steam->app()->GetAppList([
    'include_games' => true,
    'include_dlc' => false,
    'max_results' => 50000,
]);

The returned array can be large. For scheduled imports:

  • run the operation outside a web request;
  • process results in chunks;
  • use if_modified_since for incremental refreshes where appropriate;
  • upsert records instead of deleting and recreating the catalog;
  • keep memory limits in mind.

Workshop queries

workshop()->QueryFiles() performs one query per call. Pass the pagination values returned or expected by the selected Steam query mode into the next request.

$arguments = [
    'query_type' => 1,
    'appid' => 620,
    'page' => 1,
    'numperpage' => 100,
    'return_details' => true,
];

$response = $steam->workshop()->QueryFiles($arguments);

When using cursor-based filters, the client defaults the initial cursor to *. Carry the response cursor into the next call according to Steam's response format.

Safe loops

Every pagination loop should have:

  • a clear termination condition;
  • a maximum page or request guard;
  • retry limits;
  • duplicate protection;
  • logging that excludes API keys;
  • persistence checkpoints for large imports.

Clone this wiki locally