Generate Answer
AI-generatedSummary
Send a search query and its associated metadata to the Yext Answers API to generate an answer based on the provided search results for a specified search experience, locale, and version.
Inputs
- Account Id (required) — The Yext account identifier.
- V (required) — API version date in YYYYMMDD format.
- Experience Key (required) — Unique string key identifying the Search experience to query.
- Locale (required) — Locale code (e.g., en_GB) to filter entities that have an associated profile in this locale.
- Search Id (required) — ID of the search associated with the results to be used for answer generation.
- Search Term (required) — The original search term submitted by the user.
- Results (required) — JSON object containing results and metadata for a single vertical of search results relevant to the query.
- Request Options — Optional settings including batching parameters, SSL certificate validation toggle, HTTP proxy configuration, and request timeout in milliseconds.
Output shape
a single JSON response containing the generated answer from the Yext Answers API
This operation returns the API response body in JSON format representing the generated answer. No pagination or multiple items are expected.
Examples
Example 1: Typical usage
Provide your Yext Account Id, the API version date, the Experience Key, and Locale. Include the searchId and searchTerm with the corresponding results JSON from the search vertical you want to generate an answer for. Optionally configure request options such as batching or proxy as needed.