Headless catalog
Explore API endpoints for retrieving product information, categories, and search results to build headless commerce experiences with VTEX.
The Intelligent Search sections of this guide use Intelligent Search API v1. If you are migrating from Intelligent Search API (Legacy), see Migrating to Intelligent Search API v1.
Be it through category menus, keyword searches, or product pages, shoppers accessing your headless store will need to browse through your products' information.
Below you can learn more about API endpoints you can use to help shoppers find what they need in your store. See the catalog documentation to learn how to manage products, SKUs and categories, among other things.
You can filter the results of the endpoints below by sales channel with the query parameter
sc={salesChannel}.
Categories
One of the ways shoppers will interact with your product information is by browsing through a categories menu.
Use the following endpoint to fetch category information:
Search
Instead of browsing categories, shoppers may prefer to type a keyword into your store’s search bar to find what they want. VTEX provides two different search solutions for your store. We recommend that you use Intelligent Search, but you have the option to use the VTEX Search (Legacy) if you wish.
Learn more about VTEX Intelligent Search.
Intelligent Search
Before implementing Intelligent Search in your headless storefront, make sure to check this Intelligent Search guide and make the necessary configurations.
To retrieve products with the Intelligent Search API, use this endpoint:
For any given Intelligent Search query, you can get search facets and display them so that your shoppers can narrow their search.
Shoppers may have trouble coming up with the optimal search term for their needs. Use these endpoints to help fill in the gaps:
GETGet attempt of correction of a misspelled term (v1)GETGet list of suggested terms similar to the search term (v1)
Banners
You can use the Intelligent Search banners feature with this endpoint:
Intelligent Search autocomplete
You can also improve shopping experience by implementing an autocomplete feature. Use this endpoint to get suggested search terms based on a provided term:
You can also get the most searched terms on your site:
VTEX Search (Legacy)
To retrieve products with VTEX Search (Legacy), use this endpoint:
Note that this endpoint provides multiple filtering and ordering options that can be made available for the shopper to narrow their search, improving the user’s experience. Handy examples include:
- Searching within specific category levels (department, category and subcategory):
https://{accountName}.vtexcommerce{environment}.com.br/api/catalog_system/pub/products/search/{department}/{category}/{subcategory} - Filtering products by collection: query string
fq=productClusterIds:{collectionId} - Sorting by best discount: query string
O=OrderByBestDiscountDESC
See the Search endpoint documentation to learn about all filtering and sorting options.
VTEX Search (Legacy) autocomplete
You can also implement an autocomplete feature to your store’s search bar using VTEX Search (Legacy). To do this, use this endpoint:
Product details
On product pages and in other sections of your headless store, you will need to retrieve information about specific products.
Recommended approach (Intelligent Search)
We recommend using the Intelligent Search API v1 for Product Detail Pages (PDP), as it provides:
- Better search performance: Optimized for faster response times.
- Consistent user experience: When using Delivery Promise, using Intelligent Search ensures delivery estimates and availability match between Product Listing Pages (PLP) and Product Detail Pages (PDP).
- Location-based availability: Supports filtering by ZIP code for accurate product availability.
Use the GET Get product (v1) endpoint to retrieve a specific product by a known identifier. It accepts a field and value parameter and skips the search pipeline, resulting in lower latency.
field value | Identifier type |
|---|---|
id (default) | Product ID |
slug | Product slug |
ean | SKU EAN |
sku | SKU ID |
reference | SKU reference ID |
Examples:
_10https://{accountName}.vtexcommercestable.com.br/api/intelligent-search/v1/products?sc=1&field=id&value=1234
_10https://{accountName}.vtexcommercestable.com.br/api/intelligent-search/v1/products?sc=1&field=slug&value=apple-magic-mouse
For stores using Delivery Promise: Include delivery promise parameters in your requests to ensure accurate delivery estimates and product availability. See the Delivery Promise for headless stores guide for implementation details.
Alternative approach (VTEX Search (Legacy))
Alternatively, you can use VTEX Search (Legacy) API endpoints to retrieve product information:
- Search Product by Product URL
- Search for Products with Filter, Order and Pagination
- Filter by product ID:
fq=productId:{productId} - Filter by SKU ID:
fq=skuId:{skuId}
- Filter by product ID:
VTEX Search (Legacy) endpoints do not support Delivery Promise features. If your store uses Delivery Promise, you must use the Intelligent Search API v1 as described above.
Cross selling
When a shopper is interested in a product, it may be a good idea to display related products that they may be interested in purchasing as well.
See this guide to learn how to set up cross selling capabilities and use the endpoints below to retrieve this information on your storefront:
- Get Product Search of Show Together
- Get Product Search of Accessories
- Get Product Search of Similars
- Get Product Search of Suggestions
Learn more
See these other guides to learn more about building a headless shopping experience using VTEX: