Instant Typeahead Search
With Instant Typeahead Search, you can provide autocomplete suggestions as the user is typing. Even if they've only typed a few characters, Miso can anticipate what they're looking for and connect them with the right products on your site.

Introduction
When a site supports Instant Typeahead Search, users will see a list of suggested search results appear as they're typing a query, with the most likely options at the top. Since sites like Google have offered powerful personalized autocomplete for years, users expect this functionality across the web. It's essential to help people find what they're looking for faster and enable them to discover new products on your site.
Using Miso's Autocomplete API, you'll get results that adapt in real time to connect users with precisely what they're looking for, even if they've only typed one or two characters. The Autocomplete API is similar to the Search API and is typo-resistant, meaning that Miso can still find the right results if the query contains spelling mistakes. As always, you have control over which results show here using [boosting, filtering, and other advanced parameters](/docs/deep-dives/filtering-boosting-and-other-advanced-topics).
Before You Start
API Call / JSON Response
To fetch your Instant Typeahead Search results, POST to the Autocomplete API with the following minimum parameters:
user_id
oranonymous_id
: The user or anonymous visitor to personalize the recommendations forq
: The partial search query that the user has entered.
By default, we only autocomplete against the value in the title
field. The completion_fields
parameter lets you specify the attributes you want to autocomplete against.
Miso will return a list of completions
containing both the autocompletion text and the product_id
for instant linking.
fq
,
boost_fq
, and
order_by
.
Read more in the deep dive
Example API Call
POST /v1/search/autocomplete?api_key=<API_KEY> HTTP/1.1
{
"user_id":"user-123",
"completion_fields":["suggested_queries","title"],
"q":"bab",
"rows":6
}
Example JSON Response
{
"message": "success",
"data": {
"took": 38,
"miso_id": "ae75e25c-ddf4-11eb-9862-ba7ee8b57635",
"completions": {
"suggested_queries": [
{
"text": "baby wipes",
"text_with_markups": "bab<mark>y wipes</mark>",
"text_with_inverted_markups": "<mark>bab</mark>y wipes"
},
{
"text": "baby food",
"text_with_markups": "bab<mark>y food</mark>",
"text_with_inverted_markups": "<mark>bab</mark>y food"
},
{
"text": "baby bottle",
"text_with_markups": "bab<mark>y bottle</mark>",
"text_with_inverted_markups": "<mark>bab</mark>y bottle"
},
...
],
"title": [
{
"text": "Pampers Baby Wipes Sensitive 56ct",
"text_with_markups": "<mark>Pampers </mark>Bab<mark>y Wipes Sensitive 56ct</mark>",
"text_with_inverted_markups": "Pampers <mark>Bab</mark>y Wipes Sensitive 56ct",
"product": {
"product_id": "pampers-baby-wipes",
"_boosted": false
}
},
{
"text": "Pampers Diapers Baby-Dry Size 6 21ct",
"text_with_markups": "<mark>Pampers Diapers </mark>Bab<mark>y-Dry Size 6 21ct</mark>",
"text_with_inverted_markups": "Pampers Diapers <mark>Bab</mark>y-Dry Size 6 21ct",
"product": {
"product_id": "pampers-diapers-baby-dry",
"_boosted": false
}
},
...
]
}
}
}
Before You Launch
API Reference
Need more info on the API? Check out our dedicated API page with all the info you could ever want.
Read API Reference