OneBasket

Pagination and language

How list endpoints page their results and how to request translated content.

Pagination

List endpoints take two query parameters.

ParameterTypeDefaultDescription
pageinteger1The page of results to return. The first page is 1.
pageSizeinteger25The number of results per page.
curl "$ONEBASKET_API_URL/kiosks?page=2&pageSize=50" \
  -H "x-api-key: $ONEBASKET_API_KEY"

Response shape

The Seating, Kiosks and Timestreams APIs return this envelope:

{
  "page": 2,
  "pageSize": 50,
  "pageTotal": 4,
  "resultsTotal": 180,
  "hasNextPage": true,
  "hasPreviousPage": true,
  "results": []
}
FieldDescription
pageThe current page of results.
pageSizeThe number of results per page.
pageTotalThe total number of pages.
resultsTotalThe total number of results.
hasNextPagetrue if there is a next page.
hasPreviousPagetrue if there is a previous page.
resultsThe results for the current page.

Search products in the Catalogues API returns a different envelope: results, page, pageSize, totalResults, preOrderCount and comingSoonCount. To find out whether there is a next page, compare page * pageSize with totalResults.

Language

The Catalogues API returns translated product content. Send the language you want in the Accept-Language header. The default is en.

curl "$ONEBASKET_API_URL/catalogues/products" \
  -H "x-api-key: $ONEBASKET_API_KEY" \
  -H "Accept-Language: ar"

The languages available depend on how the store and its providers are configured.

On this page