Core concepts

Pagination

Read offset-based collection responses and follow their pagination metadata.

Catalog list endpoints use limit and offset. A successful collection response normally includes:

FieldMeaning
dataReturned records
meta.totalNumber of matching records
meta.limitRequested/effective page size
meta.offsetNumber of records skipped
meta.countReturned count when supplied
meta.hasMoreWhether more records exist, when supplied
meta.links.nextRelative next-page URL or null
meta.links.prevRelative previous-page URL or null
meta.versionAPI version

Default page sizes are 20 for mountains/passes, 50 for trails/lifts, 100 for recorded changes and 25 for the status directory. Status validates a maximum limit of 100 and offset of 10000. Catalog/history routes do not all enforce equivalent bounds; always send positive limits and nonnegative offsets. Search caps results at 50 and has no offset pagination.

// Server-side Node.js; retains filters while following relative next links.
let next = '/api/v1/mountains?countryCode=US&published=true&limit=50';
while (next) {
  const response = await fetch(new URL(next, 'https://api.icecoast.us'), {
    headers: { 'X-API-Key': process.env.ICECOAST_API_KEY },
  });
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  const body = await response.json();
  for (const mountain of body.data) console.log(mountain.id, mountain.name);
  next = body.meta?.links?.next;
}

The catalog can change between pages; this is not a snapshot/cursor API. Deduplicate by ID if collecting multiple pages. Pass mountain expansion is unpaginated. Weather history has a limit but no offset.

For grouped changes, pagination applies to flat changes before grouping. Metadata counts flat records; a group may span pages.