Skip to main content
openbridge.products.list()
openbridge.products.list().limit(20).select(['title', 'handle'])
openbridge.products.list().collection('sale').limit(10)
Fetches a list of products. Supports chaining methods to configure the query.

Chainable Methods

MethodDescription
.limit(count)Limit number of results (default: 250)
.after(cursor)Fetch results after cursor (pagination)
.before(cursor)Fetch results before cursor (pagination)
.search(query)Filter by search query
.collection(handle)Filter by collection handle or GID
.select(fields)Limit returned fields

Returns

ProductsResult
{
  items: ShopifyProduct[]
  pageInfo: ShopifyPageInfo
}

Examples

Basic

const { items, pageInfo } = await openbridge.products.list()

With limit

const { items } = await openbridge.products
    .list()
    .limit(20)

With field selection

const { items } = await openbridge.products
    .list()
    .limit(20)
    .select(['title', 'handle', 'priceRange'])

From collection

const { items } = await openbridge.products
    .list()
    .collection('new-arrivals')
    .limit(8)
const { items } = await openbridge.products
    .list()
    .search('blue shirt')
    .limit(10)

Full chain

const { items, pageInfo } = await openbridge.products
    .list()
    .collection('sale')
    .search('cotton')
    .limit(12)
    .select([
        'title',
        'handle',
        'priceRange',
        'featuredImage',
        'availableForSale'
    ])

Pagination

const page1 = await openbridge.products.list().limit(10)

const page2 = await openbridge.products
    .list()
    .limit(10)
    .after(page1.pageInfo.endCursor)