Appearance
Search
Search products and categories
GET: /headless_api/search/?query={search}
The example below shows a search on a string tröj
so it will also highlight the matching parts om the string for you inside of <em></em>
{
"hits": [
{
"product_id": 5,
"id": 5,
"slug": "troja",
"image_url": "https://cdn.nyehandel.se/store_9904aa1a-6a87-4c72-91b7-15d41ba460a8/images/Iwxyu4HX79rt5BR1655888947.jpeg",
"thumb_url": "https://cdn.nyehandel.se/eyJrZXkiOiJzdG9yZV85OTA0YWExYS02YTg3LTRjNzItOTFiNy0xNWQ0MWJhNDYwYThcL2ltYWdlc1wvSXd4eXU0SFg3OXJ0NUJSMTY1NTg4ODk0Ny5qcGVnIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoxMDAsImhlaWdodCI6MTAwLCJmaXQiOiJpbnNpZGUifX19",
"title": "<em>Tröj</em>a",
"product_description": "",
"stock": 0,
"formatted_price": "0 kr",
"formatted_comparison_price": "0 kr",
"has_compare_price": false,
"sku": "XXL-Svart",
"url": "https:\/\/developse.nyehandel.test\/sv\/products\/troja"
}
],
"popular_searches": [], // array with strings if matched
"categories": [ // matched categories
{
"id": 3,
"slug": "trojor",
"name": "Tröjor",
"image_url": "",
"thumb_url": null,
"url": "https://yourdomain.com/sv/categories/trojor"
}
],
"query": "tröj",
"search-url": "https://yourdomain.com/sv/search?query=tr%C3%B6j"
}