Search Collections
curl --request GET \
--url https://{store-domain}/search/suggest.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://{store-domain}/search/suggest.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{store-domain}/search/suggest.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{store-domain}/search/suggest.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{store-domain}/search/suggest.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{store-domain}/search/suggest.json")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{store-domain}/search/suggest.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"resources": {
"results": {
"collections": [
{
"id": "<string>",
"title": "<string>",
"handle": "<string>",
"description": "<string>",
"published_at": "<string>",
"image": "<string>",
"url": "<string>",
"products_count": 123
}
],
"products": [
{}
],
"articles": [
{}
],
"pages": [
{}
]
}
}
}Search
Search Collections
Search collections by keyword
GET
/
search
/
suggest.json
Search Collections
curl --request GET \
--url https://{store-domain}/search/suggest.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://{store-domain}/search/suggest.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{store-domain}/search/suggest.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{store-domain}/search/suggest.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{store-domain}/search/suggest.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{store-domain}/search/suggest.json")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{store-domain}/search/suggest.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"resources": {
"results": {
"collections": [
{
"id": "<string>",
"title": "<string>",
"handle": "<string>",
"description": "<string>",
"published_at": "<string>",
"image": "<string>",
"url": "<string>",
"products_count": 123
}
],
"products": [
{}
],
"articles": [
{}
],
"pages": [
{}
]
}
}
}Search Collections
Searches collections by keyword. Keyword search over collections is served by the storefront predictive-search endpoint — requestcollection as the
resource type. This is served from the store domain and needs no OAuth token.
To list or filter collections with an OAuth app token (e.g. by published
status / pagination), use
GET /api/v1/collections.json
instead. This page covers keyword search.Request
curl -X GET "https://mystore.launchmystore.io/search/suggest.json?q=summer&resources[type]=collection"
Parameters
string
required
Search query (predictive search activates at 2+ characters). Also accepts
the
query alias.string
default:"product,collection,article,page"
Resource types to search. Set to
collection to return only collections.integer
default:"10"
Maximum results (max 50). Also accepts the
limit alias.Response
Matches the predictive-search shape: aresources.results object.
Collections are returned under results.collections.
object
Show resources
Show resources
object
Show results
Show results
array
Matching collections.
array
Matching products (when requested).
array
Matching articles (when requested).
array
Matching pages (when requested).
Example Response
{
"resources": {
"results": {
"products": [],
"collections": [
{
"id": "col_abc123",
"title": "Summer Collection 2024",
"handle": "summer-collection-2024",
"description": "Our latest summer styles featuring lightweight fabrics...",
"published_at": "2024-04-01T00:00:00.000Z",
"image": "https://cdn.launchmystore.io/images/summer-2024.jpg",
"url": "/collections/summer-collection-2024",
"products_count": 48
},
{
"id": "col_def456",
"title": "Summer Essentials",
"handle": "summer-essentials",
"description": "Must-have items for the summer season...",
"published_at": "2024-04-01T00:00:00.000Z",
"image": "https://cdn.launchmystore.io/images/summer-essentials.jpg",
"url": "/collections/summer-essentials",
"products_count": 24
}
],
"articles": [],
"pages": []
}
}
}