Skip to main content
POST
Content Search: Execute Search

Authorization

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

Headers

Content-Type
string
default:"application/json"
required
Accept
string
default:"application/json"
required

Path parameters

searchQuery
string
required
The url-encoded search query.

Body

content_type
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
Pagination Object
tuning
object
Override default ranking weights for content search.
identity
object
User identity information for tracking and personalization. Automatically managed by the Storefront Pixel; required for headless integrations.
context
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

results
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:
query
string
The search query that was executed.
contentType
string
The content type filter applied, if any.
totalResults
number
The total number of results matching the search query.
page
number
The current page number.
totalPages
number
The total number of pages.
resultsPerPage
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.