Method Signature
getBrowseResults(
filterName: string,
filterValue: string,
parameters?: IBrowseParameters,
networkParameters?: NetworkParameters
): Promise<GetBrowseResultsResponse>
Parameters
Filter name to display results from (e.g., "group_id", "category", "brand")
Filter value to display results from (e.g., "t-shirts", "electronics", "Nike")
Additional parameters to refine the result setShow parameters properties
The page number of the results. Cannot be used together with offset.
The number of results to skip from the beginning. Cannot be used together with page.
The number of results per page to return
Key-value mapping of filters used to refine results. Example: { size: "medium", color: "blue" }
An object specifying whether results must match all, any, or none of a given filter. Example: { brand: "any", size: "all" }
sortBy
string
default:"relevance"
The sort method for results (e.g., "relevance", "price", "rating")
sortOrder
string
default:"descending"
The sort order for results ("ascending" or "descending")
The section name for results
Hidden metadata fields to return in results
Hidden facets to return in results
Parameters relevant to the network requestShow networkParameters properties
Request timeout in milliseconds
Returns
Returns a Promise that resolves to a browse results response object.
Information about the request that was made, including applied filters and parameters
The browse results data
Array of product result objects. Each result includes:
data: Product data including id and other metadata
value: Product name or title
matched_terms: Terms that matched the browse query
labels: Product labels and badges
variations: Product variations (if applicable)
result_id: Unique identifier for tracking (automatically appended)
Available facets for filtering, including facet name, display name, and options
Product groups or categories
Available sorting options for the result set
Total number of results matching the browse criteria
Information about result sources (tokens, embeddings, etc.)
Refined content and merchandising rules
Active features for this browse request
Collection information (if applicable)
Unique identifier for this result set, used for analytics tracking
Examples
Basic Browse Request
const results = await constructorio.browse.getBrowseResults(
'group_id',
't-shirts'
);
console.log(results.response.results); // Array of product results
console.log(results.response.total_num_results); // Total count
const results = await constructorio.browse.getBrowseResults(
'category',
'electronics',
{
resultsPerPage: 40,
page: 2
}
);
Browse with Filters
const results = await constructorio.browse.getBrowseResults(
'group_id',
't-shirts',
{
resultsPerPage: 40,
filters: {
size: 'medium',
color: 'blue'
},
filterMatchTypes: {
size: 'all'
}
}
);
Browse with Sorting
const results = await constructorio.browse.getBrowseResults(
'brand',
'Nike',
{
sortBy: 'price',
sortOrder: 'ascending',
resultsPerPage: 24
}
);
Browse with Advanced Options
const results = await constructorio.browse.getBrowseResults(
'category',
'shoes',
{
filters: {
brand: ['Nike', 'Adidas'],
price: '50-200'
},
filterMatchTypes: {
brand: 'any'
},
hiddenFields: ['internal_id', 'warehouse_location'],
variationsMap: {
group_by: [
{
name: 'color',
field: 'data.color'
}
],
dtype: 'array'
},
fmtOptions: {
groups_max_depth: 2
}
}
);
Browse with Timeout
const results = await constructorio.browse.getBrowseResults(
'group_id',
'accessories',
{
resultsPerPage: 20
},
{
timeout: 5000 // 5 second timeout
}
);
Error Handling
try {
const results = await constructorio.browse.getBrowseResults(
'group_id',
't-shirts',
{ resultsPerPage: 24 }
);
// Process results
console.log(results.response.results);
} catch (error) {
console.error('Browse request failed:', error);
}
Additional Resources