Prerequisites
From MyCludo, collect the values for the engine where Pre-search Suggestions are configured:| Value | Description |
|---|---|
| Customer ID | The customer ID for your Cludo account |
| Engine ID | The engine where suggestions were configured |
| Search key | The public search or site key for the engine |
| Region | EU customers use https://api.cludo.com; US customers use https://api-us1.cludo.com |
Step 1: Build the SiteKey authorization header
The request uses SiteKey authentication. Build the token by Base64-encoding{customerId}:{engineId}:{searchKey}:
Step 2: Call the public settings endpoint
Fetch the website public settings for the engine:| Customer ID | Region | Base URL |
|---|---|---|
| Below 10,000,000 | EU | https://api.cludo.com |
| 10,000,000 and above | US | https://api-us1.cludo.com |
Step 3: Parse instantSuggestionsConfiguration
The response contains many website settings. The Pre-search Suggestions field is instantSuggestionsConfiguration.
This field is returned as a JSON-encoded string, so parse the response JSON first, then parse instantSuggestionsConfiguration a second time:
| Field | Description |
|---|---|
suggestions | Curated terms entered in MyCludo, returned in display order |
limit | Maximum number of items to show |
showRecentSearches | Whether your UI should also show the visitor’s recent searches |
showRecentSearches is true, store and merge recent searches client-side, for example in localStorage.
