Search
10 endpoints. Each needs an API key or OAuth token with the scope shown; the key already names its store, so paths start at /v1/store. Generated from the live contract; also in openapi.json.
Synonyms, pinned results, redirects and the state of the search index
/v1/store/search/settingsOr name the store: GET /v1/stores/{storeId}/search/settings
Response SearchSettings
synonymsSearchSynonym[]requiredrulesSearchRule[]requireddefaultsobject[]requiredtermsstring[]requiredoneWaybooleanrequired
indexRebuildSearchIndexResponserequired
Example
curl "https://api.shopfa.st/v1/store/search/settings" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/search/settings', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/search/settings",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/search/settings", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Add a synonym rule
/v1/store/search/synonymsOr name the store: POST /v1/stores/{storeId}/search/synonyms
Body
termsstring[]requiredoneWayboolean
Response SearchSynonym
idSearchSynonymIdrequiredtermsstring[]requiredoneWaybooleanrequiredcreatedAtTimestamprequiredupdatedAtTimestamprequired
Example
curl -X POST "https://api.shopfa.st/v1/store/search/synonyms" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"terms": [
"string"
],
"oneWay": false
}'const res = await fetch('https://api.shopfa.st/v1/store/search/synonyms', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"terms": [
"string"
],
"oneWay": false
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/search/synonyms",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"terms": [
"string"
],
"oneWay": False
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/search/synonyms", strings.NewReader(`{
"terms": [
"string"
],
"oneWay": false
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Change a synonym rule
/v1/store/search/synonyms/{synonymId}Or name the store: PUT /v1/stores/{storeId}/search/synonyms/{synonymId}
Parameters
synonymIdssy_…pathrequired
Body
termsstring[]requiredoneWayboolean
Response SearchSynonym
idSearchSynonymIdrequiredtermsstring[]requiredoneWaybooleanrequiredcreatedAtTimestamprequiredupdatedAtTimestamprequired
Example
curl -X PUT "https://api.shopfa.st/v1/store/search/synonyms/ssy_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"terms": [
"string"
],
"oneWay": false
}'const res = await fetch('https://api.shopfa.st/v1/store/search/synonyms/ssy_0123456789abcdefghjk', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"terms": [
"string"
],
"oneWay": false
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"PUT",
"https://api.shopfa.st/v1/store/search/synonyms/ssy_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"terms": [
"string"
],
"oneWay": False
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("PUT", "https://api.shopfa.st/v1/store/search/synonyms/ssy_0123456789abcdefghjk", strings.NewReader(`{
"terms": [
"string"
],
"oneWay": false
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Remove a synonym rule
/v1/store/search/synonyms/{synonymId}Or name the store: DELETE /v1/stores/{storeId}/search/synonyms/{synonymId}
Parameters
synonymIdssy_…pathrequired
Response Ok
okbooleanrequired
Example
curl -X DELETE "https://api.shopfa.st/v1/store/search/synonyms/ssy_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/search/synonyms/ssy_0123456789abcdefghjk', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"DELETE",
"https://api.shopfa.st/v1/store/search/synonyms/ssy_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("DELETE", "https://api.shopfa.st/v1/store/search/synonyms/ssy_0123456789abcdefghjk", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Pin products to a search, or send a search to a page
/v1/store/search/rulesOr name the store: POST /v1/stores/{storeId}/search/rules
Body
kind"pin" | "redirect"requiredquerystringrequiredproductIdsprd_…[]urlstring | nullenabledboolean
Response SearchRule
idSearchRuleIdrequiredkindSearchRuleKindrequiredquerystringrequirednormalizedstringrequiredproductIdsProductId[]requiredurlstringrequiredenabledbooleanrequiredcreatedAtTimestamprequiredupdatedAtTimestamprequired
Example
curl -X POST "https://api.shopfa.st/v1/store/search/rules" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "pin",
"query": "string",
"productIds": [],
"url": null,
"enabled": true
}'const res = await fetch('https://api.shopfa.st/v1/store/search/rules', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"kind": "pin",
"query": "string",
"productIds": [],
"url": null,
"enabled": true
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/search/rules",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"kind": "pin",
"query": "string",
"productIds": [],
"url": None,
"enabled": True
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/search/rules", strings.NewReader(`{
"kind": "pin",
"query": "string",
"productIds": [],
"url": null,
"enabled": true
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Change a pin or redirect
/v1/store/search/rules/{ruleId}Or name the store: PUT /v1/stores/{storeId}/search/rules/{ruleId}
Parameters
ruleIdsrl_…pathrequired
Body
kind"pin" | "redirect"requiredquerystringrequiredproductIdsprd_…[]urlstring | nullenabledboolean
Response SearchRule
idSearchRuleIdrequiredkindSearchRuleKindrequiredquerystringrequirednormalizedstringrequiredproductIdsProductId[]requiredurlstringrequiredenabledbooleanrequiredcreatedAtTimestamprequiredupdatedAtTimestamprequired
Example
curl -X PUT "https://api.shopfa.st/v1/store/search/rules/srl_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "pin",
"query": "string",
"productIds": [],
"url": null,
"enabled": true
}'const res = await fetch('https://api.shopfa.st/v1/store/search/rules/srl_0123456789abcdefghjk', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"kind": "pin",
"query": "string",
"productIds": [],
"url": null,
"enabled": true
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"PUT",
"https://api.shopfa.st/v1/store/search/rules/srl_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"kind": "pin",
"query": "string",
"productIds": [],
"url": None,
"enabled": True
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("PUT", "https://api.shopfa.st/v1/store/search/rules/srl_0123456789abcdefghjk", strings.NewReader(`{
"kind": "pin",
"query": "string",
"productIds": [],
"url": null,
"enabled": true
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Remove a pin or redirect
/v1/store/search/rules/{ruleId}Or name the store: DELETE /v1/stores/{storeId}/search/rules/{ruleId}
Parameters
ruleIdsrl_…pathrequired
Response Ok
okbooleanrequired
Example
curl -X DELETE "https://api.shopfa.st/v1/store/search/rules/srl_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/search/rules/srl_0123456789abcdefghjk', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"DELETE",
"https://api.shopfa.st/v1/store/search/rules/srl_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("DELETE", "https://api.shopfa.st/v1/store/search/rules/srl_0123456789abcdefghjk", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Rebuild the search index now (it also refreshes itself after catalog changes)
/v1/store/search/reindexOr name the store: POST /v1/stores/{storeId}/search/reindex
Response RebuildSearchIndexResponse
productsintegerrequiredcollectionsintegerrequiredpagesintegerrequiredtermsintegerrequiredbuiltAtTimestamp | nullrequiredbuildMsinteger | nullrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/search/reindex" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/search/reindex', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/search/reindex",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/search/reindex", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
What buyers get for a search (synonyms, typos, pins and redirects applied), not counted in analytics
/v1/store/search/previewOr name the store: GET /v1/stores/{storeId}/search/preview
Parameters
qstringquery
Response StorefrontSuggest
querySearchQueryInforequiredproductsSearchProductHit[]requiredcollectionsSearchLinkHit[]requiredpagesSearchLinkHit[]requiredcategoriesSearchLinkHit[]requiredtotalintegerrequiredpopularstring[]required
Example
curl "https://api.shopfa.st/v1/store/search/preview" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/search/preview', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/search/preview",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/search/preview", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Top searches, searches with no results, click-through and searches that led to a purchase
/v1/store/search/analyticsOr name the store: GET /v1/stores/{storeId}/search/analytics
Parameters
range"7d" | "30d" | "90d"querytermsstring | nullquerytermsSort"searches" | "query" | "ctr" | "purchases"querytermsDir"asc" | "desc"queryzerostring | nullqueryzeroSort"searches" | "query"queryzeroDir"asc" | "desc"query
Response SearchAnalytics
rangeSearchAnalyticsRangerequiredfromstringrequiredtostringrequiredtotalsobjectrequiredsearchesintegerrequiredsearchersintegerrequiredzeroResultsintegerrequiredclicksintegerrequiredctrnumberrequiredpurchasesintegerrequiredconversionnumberrequired
seriesobject[]requireddaystringrequiredsearchesintegerrequiredzeroResultsintegerrequiredclicksintegerrequired
topTermsSearchTermRow[]requiredzeroTermsobject[]requiredquerystringrequiredsearchesintegerrequiredlastAtTimestamprequiredsuggestionstringrequired
topClickedobject[]requiredhandlestringrequiredtitlestringrequiredclicksintegerrequired
Example
curl "https://api.shopfa.st/v1/store/search/analytics" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/search/analytics', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/search/analytics",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/search/analytics", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)