Simple text search
Fast text-based product search matching the query against product names, brands, and
descriptions in the store’s catalog. 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.
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.
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.
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
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"details": "The 'email' field is required"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid Authorization header"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests for this API key. Please slow down and try again shortly.",
"remaining": 0,
"reset": 1706198400
}
}{
"error": {
"code": "server_error",
"message": "An unexpected error occurred"
}
}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/*): Secret key required - 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.
Query Parameters
Marketplace operator key only. Narrow the marketplace search to a single merchant's products. Ignored when using a single-store key.
Search query (alternative to 'query' parameter)
Search query (alternative to 'q' parameter)
Maximum number of results to return
1 <= x <= 100Marks 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
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"details": "The 'email' field is required"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid Authorization header"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests for this API key. Please slow down and try again shortly.",
"remaining": 0,
"reset": 1706198400
}
}{
"error": {
"code": "server_error",
"message": "An unexpected error occurred"
}
}
