Skip to main content
POST
Content Search: Execute Search

Authorization

string
required
Token-based authentication header in the form of <YOUR_LAYERS_TOKEN>.

Headers

string
default:"application/json"
required
string
default:"application/json"
required

Path parameters

string
required
The url-encoded search query.

Body

string
Filter results by content type. Supported values: "article" and "page". When omitted, all content types are searched and results from both articles and pages are returned together.
Pagination Object
object
Override default ranking weights for content search.
object
User identity information for tracking and personalization. Automatically managed by the Storefront Pixel; required for headless integrations.
object
Contextual information about the customer’s session, behavior, and environment. Automatically collected by the Storefront Pixel; must be manually provided for headless integrations. See Contextual Information for implementation guidance.

Response

array
Array of content items matching the search query. Results can include both articles and pages when no content_type filter is applied. Each item includes:
string
The search query that was executed.
string
The content type filter applied, if any.
number
The total number of results matching the search query.
number
The current page number.
number
The total number of pages.
number
The number of results per page.

Response headers

Supported content types

Content search indexes two types of Shopify content: When you omit the content_type parameter, results from both articles and pages are returned together, ranked by a unified scoring model. Use the __typename field to distinguish between content types when rendering results.

Search behavior

Content search uses a configurable ranking model to score and rank results. The default model combines three signal groups: Scores from each signal group are normalized using min-max scaling across the result set, then combined into a single ranking score using a weighted linear combination. You can override these weights per-request using the tuning.rankingWeightOverrides parameter. For product search testing, use Test text search in Lab.

Error handling

When search processing fails (e.g., due to rate limits or service issues), the API returns an empty result set with totalResults: 0 rather than throwing an error. This ensures graceful degradation of the search experience.

Usage example

cURL (all content types)
cURL (pages only)
Content sync: Articles and pages are automatically synced from Shopify via webhooks and bulk operations. Only published content without the seo.hidden metafield is included in search results.