Any site: REST API + widget
Use SeekGist on a custom store with the REST API and the drop-in search widget.
Use this when your store runs on your own code, or on a platform without a SeekGist connector.
1. Keep your products in sync
From your server, with the secret key, call POST /v1/products/batch when a product is saved, when stock changes and when a product is deleted. Up to 1,000 products per call. Send an Idempotency-Key so a retry never does the work twice. See Get started for an example.
For a full sync (for example every night), send all products with the same sync_id, and set sync_complete: true on the last batch. With replace_all: true, products you did not send in this sync are removed.
2. Add suggestions while typing
The SeekGist widget is a small script with no dependencies (about 8 KB gzipped). It works right-to-left, follows your colors, and works with the keyboard. It uses only your public key.
<script src="https://cdn.seekgist.com/widget/1/seekgist-widget.js" async
data-key="sg_pub_..." data-input="input[name=q]" data-search-url="/search?q="
data-locale="ar"></script>All options, theming and the chat button are in the JavaScript widget guide.
Recent searches are kept only in the shopper's browser (up to 10, with a "clear" button). They are never sent to SeekGist.
3. Show search results
You have two choices.
A. Render results in the browser. Call /v1/search with your public key and show hits. Each hit has a product card (name, price, image, link).
B. Render results on your server (best when prices depend on the customer). Call /v1/search from your server, take ids in order, load those products from your own database, and render your own cards.
If you call SeekGist from your server, protect your store with a fallback:
- Wait at most 300 ms in total (150 ms to connect).
- On a timeout, a connection error, HTTP 5xx, 429, 401 or 403, or a body without
ids, show your own search results instead. Never show an error page. - After 5 failures in 60 seconds, skip SeekGist for 30 seconds, then try one call.
Read Store fallback for the full rules.
4. Send clicks and events
- Click on a result:
POST /v1/clickwithsearch_id,product_idandposition. - Add to cart, order or view:
POST /v1/eventwithtype(add_to_cart,order,view), one event or a batch of up to 100.
Send them in the background. Never make the shopper wait for them.