Simple text search
Fast text-based product search matching the query against product names. When no product name matches,
the query is retried by similarity against product names and brands (see Typo tolerance). Returns a ranked list of matches with a relevance
score and a human-readable matchReason.
Auth: accepts both publishable (tybrite_pk_*) and secret (tybrite_sk_*) API keys, so
it is safe to call directly from client-side storefront code — no customer session required.
Plans: keyword search is available on every plan.
When to use: use this GET endpoint for fast type-ahead and keyword search where exact
term matching is enough. For natural-language intent (“wireless headphones with noise
cancellation”), use the semantic POST /v1/search (semanticSearch) instead, which scores
by meaning rather than literal terms.
Typo tolerance. When exact matching finds nothing, the query is retried against a
similarity match over product names and brands, so a misspelling still reaches the product
— “snoboard” finds the snowboards. Those results carry a matchReason of Similar name or
Similar brand rather than Text match, so a storefront can label them (“showing results
for …”) instead of presenting an approximate match as an exact one. Exact matches always
rank first: the fallback only runs when there were none, so a query that already worked is
unaffected.
Merchandising. A merchant can place results deliberately from their admin, for a query or a family of queries: pin a product to the top, bury one to the bottom, or boost one so it lifts past near neighbours without jumping the queue. Rules can run between dates, and a higher-priority rule wins where two overlap.
Rules apply after ranking and only reorder — they never introduce a product the query did not
match, and a pinned product that is deleted, offline or otherwise not sellable does not appear.
Pinned and boosted results carry a matchReason of Featured by the store, so a storefront can
label a deliberate placement rather than presenting it as an earned one. Nothing needs to be
requested or configured on the client: the ordering already reflects the rules, and a store with
none behaves exactly as before.
Synonyms. A merchant can declare words that mean the same (“sofa”, “couch”, “settee”) or a one-way pairing (“trainers” also finds “sneakers”, not the reverse). A query containing one of the words is also searched with each alternative; matches for the words typed rank first, then the matches each synonym adds.
Understanding. When neither the words, their synonyms nor the spelling fallback match a product
name, the query is read for its meaning: words that carry none (“best”, “products”, “for”) are set
aside and the rest are matched against product names, brands, categories, subcategories, SKUs and
tags, together with the products of a collection the query names. “best products for summer” finds
the summer range. These results carry a matchReason of Related to your search or
In the <name> collection. GET /v1/products?search= applies the same reading when its own name
and SKU match finds nothing, so a search page and a product list agree.
Redirects. A merchant can send a query to one place: a page address, a collection, a category
or a product. The response carries redirect (null when there is none) beside the results, and the
storefront decides whether to navigate.
Ranking by popularity, promotions and stock. A store can turn on a ranking that, after its rules, lifts the products shoppers add to their carts most this week and those in a live buy-one-get-one or bundle offer or on sale, nudges down a product at or below the store’s low-stock level, and places sold-out products after the rest. Pinned results stay first and buried results stay last. The setting is the merchant’s; nothing is requested on the client.
Marketplace: when called with a marketplace operator key, searches products across all
merchants in the marketplace; pass ?store_id=<merchant> to narrow results to a single
merchant. Synonyms, understanding, redirects and the ranking setting belong to a store’s own search
and do not apply to marketplace searches.
curl --request GET \
--url https://api.tybritelabs.com/v1/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tybritelabs.com/v1/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tybritelabs.com/v1/search', 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://api.tybritelabs.com/v1/search",
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://api.tybritelabs.com/v1/search"
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://api.tybritelabs.com/v1/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/search")
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{
"query": "wireless headphones",
"results": [
{
"productId": "7d425c0a-50e7-4e39-af79-6f7945f9dfa8",
"score": 0.92,
"matchReason": "Matched product name and description"
}
],
"totalResults": 1,
"redirect": null
}Authorizations
API Key Authentication
Use your API key in the Authorization header:
Authorization: Bearer tybrite_sk_live_YOUR_KEY
Key Types:
Secret Keys (Server-Side Only):
- Format:
tybrite_sk_live_*(production) ortybrite_sk_test_*(sandbox) - Full read/write access to all endpoints
- ⚠️ NEVER expose in client-side code or public repositories
- Required for: every write a shopper does not make for themselves, authentication, payment verification, AI recommendations
Publishable Keys (Client-Safe):
- Format:
tybrite_pk_live_*(production) ortybrite_pk_test_*(sandbox) - Catalogue reads, plus the actions a shopper takes for themselves
- ✅ Safe for client-side JavaScript, mobile apps, and public code
- Allowed for: browsing products, search, CMS content, pricing queries, cart and wishlist, reviews, storefront events, and the Agent API's quotes, cart drafts and checkout intents
Endpoint-Specific Requirements:
- Authentication endpoints (
/v1/auth/*): state-changingPOSTcalls require a secret key, for store and marketplace keys alike;GET /v1/auth/meaccepts either key - Payment verification (
POST /v1/payments/verify): Secret key required - AI Recommendations (
POST /v1/recommendations): Secret key required - Semantic Search (
POST /v1/search): Both key types allowed (read-only operation) - Shopper actions (cart, wishlist, reviews, storefront events, Agent API quotes, cart drafts and checkout intents): Both key types allowed
- All other write operations: Secret key required
- All read operations: Both key types allowed
Using a publishable key for restricted operations returns 403 Forbidden.
Limited publishable keys:
A publishable key can be limited to the products that carry one tag (for example starter:jewellery), created from
the store's Developers page. The limit applies to the key, never to the shopper: shopper sign-up and sign-in stay store-wide.
- Reads return only the slice: products (with their facets, filters, search, brands and specifications), categories and
subcategories that hold in-slice products, collections, promotions, posts and lookbooks that carry the tag, reviews of
in-slice products, prices, discovery lists and the store information summary, with every count computed on the slice.
A product outside the slice answers
404, as if it did not exist. - A write that names a product or variant outside the slice (adding to the cart or wishlist, reserving stock, an order line,
a review, a promotion calculation, a storefront event) answers
403with the error codeout_of_scope, and nothing is written or reserved. An order is refused as a whole. - A route that carries no slice behaviour is not available to the key: it answers
403withendpoint_not_allowed. - Orders placed through such a key record the tag on the order's attribution as
key_scope. - Secret keys and connected-app keys cannot be limited.
- Responses are cached per key limit: a limited key never receives a response cached for the whole store, and the reverse.
Query Parameters
Marks the request as coming from a wholesale buyer (identify them with any of
x-auth-token, x-external-auth, or x-idp-token).
A search result is a reference to a product — an id, a score and a match reason — and
carries no price, so this does not price results. What it does is keep the response out
of the caches, because a buyer's results can be narrowed to the range they may order from
and a narrowed set must not be served to anyone else. Fetch the priced page from
GET /v1/products?b2b=true, which prices against that buyer's own agreement.
curl --request GET \
--url https://api.tybritelabs.com/v1/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tybritelabs.com/v1/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tybritelabs.com/v1/search', 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://api.tybritelabs.com/v1/search",
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://api.tybritelabs.com/v1/search"
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://api.tybritelabs.com/v1/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/search")
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{
"query": "wireless headphones",
"results": [
{
"productId": "7d425c0a-50e7-4e39-af79-6f7945f9dfa8",
"score": 0.92,
"matchReason": "Matched product name and description"
}
],
"totalResults": 1,
"redirect": null
}
