Universal Search: Autocomplete
Retrieve a list of suggested queries across all verticals in the experience based on the characters already typed by the user. This API is meant to be hit after each keystroke.
path Parameters
accountId required | string |
query Parameters
v required | string A date in |
experienceKey required | string String key that uniquely identifies the Search experience. |
locale required | string The locale code of the experience (e.g. |
input | string The partial search term from the user. |
version | string The label or version number of the experience configuration to use. Label options are |
Responses
Response samples
- 200
- 400
{- "meta": {
- "uuid": "4f72b877-e2d0-4de4-9324-b9cf2c03e1a0",
- "errors": [ ]
}, - "response": {
- "input": {
- "value": "yex",
- "queryIntents": [ ]
}, - "results": [
- {
- "value": "Yext Listings",
- "matchedSubstrings": [
- {
- "offset": 0,
- "length": 3
}
]
}, - {
- "value": "Yext Search",
- "matchedSubstrings": [
- {
- "offset": 0,
- "length": 3
}
]
}
]
}
}
Universal Search: Query
Search for entities across all verticals within a Search experience. Modules are returned for all verticals with relevant entities. Further fine tuning and filtering of the results can then be done using the vertical query endpoint. A maximum of 50 verticals can be queried with this endpoint.
In order prevent bot traffic from using Search API Capacity, you must integrate with the Search API from the front end of your application. The Search API's Bot Detection feature requires the API to be called directly from the end-user's web browser. If you must integrate with the Search API via another mechanism, all traffic will be charged against your search capacity and some features of Search Analytics, such as Search Terms and Search Term Clustering may not work.
path Parameters
accountId required | string |
query Parameters
v required | string A date in |
experienceKey required | string String key that uniquely identifies the Search experience. |
locale required | string The locale code of the experience (e.g. |
input required | string The search term of the user. |
version | string The label or version number of the experience configuration to use. Label options are |
location | string The user's location as a comma separated latitude and longitude (e.g. |
session_id | string UUID used to track session state when cookies are blocked. |
limit | string JSON object specifying the limit for each vertical. Each key is a vertical key and the value for each of those keys is a number 1-50 that denotes the limit for that vertical. This parameter should be provided as a URL-encoded string containing a JSON object. |
queryTrigger | string String value that is logged to analytics denoting the trigger for the query. Options include:
|
context | string Context is an arbitrary JSON object that is passed to query rules to be used for triggering rules as well as passing data to those rules. This parameter should be provided as a URL-encoded string containing a JSON object. |
referrerPageUrl | string The URL of the webpage that directed to the page this request was made from. |
skipSpellCheck | boolean If true the query will skip spell checking. |
restrictVerticals | string A comma-separated list of verticals (e.g. |
ignoreQueryRules | boolean When set to true, ignores any Query Rules that would otherwise affect the results. Defaults to false. |
queryId | string UUID of the query; recommended when moving through results, to associate multiple requests to the same query. |
source | string Indicates where the query is coming from (e.g. |
jsLibVersion | string The version of the Search UI used for this request. Deprecated. |
Responses
Response samples
- 200
- 400
{- "meta": {
- "uuid": "4f72b877-e2d0-4de4-9324-b9cf2c03e1a0"
}, - "response": {
- "businessId": 0,
- "queryId": "string",
- "modules": [
- {
- "verticalConfigId": "string",
- "resultCount": 0,
- "encodedState": "string",
- "results": [
- {
- "data": { },
- "highlightedFields": { },
- "distance": 0,
- "distanceFromFilter": 0
}
], - "appliedQueryFilters": [
- {
- "displayKey": "string",
- "displayValue": "string",
- "filter": "c_exampleFieldId: { $eq\": \"Search\" }\n",
- "type": "FIELD_VALUE",
- "details": { }
}
]
}
], - "failedVerticals": [
- {
- "verticalConfigId": "string",
- "errorType": "TIMEOUT",
- "details": {
- "responseCode": 0,
- "description": "string"
}, - "queryDurationMillis": 0
}
], - "directAnswer": {
- "type": "string",
- "answer": { },
- "relatedItem": {
- "verticalConfigId": "string",
- "data": { }
}
}, - "spellCheck": {
- "originalQuery": "string",
- "correctedQuery": {
- "value": "string",
- "matchedSubstrings": [
- {
- "offsets": 0,
- "length": 0
}
]
}, - "type": "SUGGEST"
}, - "locationBias": {
- "latitude": 41.7828,
- "longitude": -87.8781,
- "locationDisplayName": "Countryside, Illinois, United States",
- "accuracy": "IP"
}
}
}