Skip to main content

Query & Pagination

For APIs that provide search, filtering, and pagination:

Filter

To filter result sets from queryable APIs, we support the following query param filter:

OperatorFormatDescription
eqeq(column:val)perform column=value operation
neqneq(column:val)perform column!=value operation
gtgt(column:val)perform column>value operation
gtegte(column:val)perform column>=value operation
ltlt(column:val)perform column<value operation
ltelte(column:val)perform column<=value operation
likelike(column:val*)perform like val% operation
nlikenlike(column:*val)perform like %val operation
inin(column:val, val1, val2, …)perform in (val, val1, val2, ....) operation
ninnin(column:val, val1, val2, …)perform not in (val, val1, val2, ....) operation

For example:

curl --request GET 'https://api.boldcommerce.com/products/v2/shops/{shop_identifier}/products?filter=eq(id:11)+eq(name:test)' \
--header 'Authorization: Bearer {access_token}' \
--header 'Bold-API-Version-Date: 2022-05-01'

Pagination

Paging through data can be accomplished by using the following request parameters:

  • since_id — Restricts results to after the specified ID.
  • limit — Limits the number of results per-page. Maximum 100.

For example:

curl --request GET 'https://api.boldcommerce.com/products/v2/shops/{shop_identifier}/products?since_id=123&limit=100' \
--header 'Authorization: Bearer {access_token}' \
--header 'Bold-API-Version-Date: 2022-05-01'

Endpoints that can return multiple resources will return pagination elements with the following attributes:

AttributeTypeDescription
totalintTotal number of results available
countintNumber of results returned
per_pageintMaximum number of results per page
current_pageintCurrent page index
total_pagesintTotal number of pages available
next_urlstringURL to fetch next page of results
previous_urlstringURL to fetch previous page of results