FreightCake

Paginate List Responses

Traverse FreightCake list endpoints with stable cursor-based pagination.

List endpoints return a cursor-based envelope with data, has_more, and url fields.

Request Parameters

ParameterTypeDescription
limitnumberNumber of records to return, from 1 through 100
starting_afterstringReturn records after this resource ID
ending_beforestringReturn records before this ID on quote and freight lists

Response

{
  "object": "list",
  "url": "/api/v1/quotes",
  "data": [],
  "has_more": false
}

When has_more is true, pass the final resource ID as starting_after in the next request.

Use ending_before only with GET /api/v1/quotes and GET /api/v1/freight. Other list endpoints support forward pagination only.

TypeScript Auto-Pagination

for await (const quote of freightcake.quotes.listAutoPaginate({ limit: 100 })) {
  console.log(quote.id)
}

Auto-pagination uses starting_after and requests the next page only after the current page is consumed.

On this page