LogoLogo
Support
Product Discovery Developer Guide
Product Discovery Developer Guide
  • Product Discovery Developer Guide
  • 🛒Item catalog management
    • What is the Items API?
    • How to work with Items
      • Item Schema
        • Attributes
        • Nested Item Schemas
        • Using the Item Schema API
        • DefaultLocale API
        • Onboarding on/migrating to Fredhopper
        • List of Reserved Attributes
      • Category Tree
        • Using the Category Tree API
        • Onboarding on XO
      • Item Catalog
        • Using the Catalog API
      • Items
        • Using the streaming Items API
        • Using the batch Items API
    • Step by Step guide
      • Step by step guide for Fredhopper customers
    • Feedback
      • Using the Feedback API
    • Authorization to APIs
    • Troubleshooting API errors
  • 🎯XO Recommendations
    • Introduction
    • Using the Recommendations API
    • Setting up the Chrome extension
    • Micro-segmentation
    • XO Legacy APIs
  • 🔎XO Search
    • Introduction
    • Getting started
    • API Reference
      • Search API
      • Autocomplete API (Beta)
      • Product Suggest API
    • API Parameters
      • Search
      • Pagination
      • Faceting
      • Sorting
      • Grouping
      • Filtering
      • Disable features
      • Response mask
      • Context
    • Configuration limitation
  • 🧪A/B testing
    • Fredhopper A/B testing
      • Integration steps for a non-caching solution
      • Integration steps for a caching solution
        • Java SDK Integration
          • Setup
          • Retrieve running A/B tests - Java SDK
          • Filter and request variant - Java SDK
          • Extending the SDK
        • Manual A/B tests integration
          • Retrieve running A/B tests
          • Filter out irrelevant A/B tests
          • Assign variants to user
          • Request variant for page
        • Limitations and Best Practices
  • 📚Resources
    • Glossary
    • Best Practices
      • Tracker Best Practices
      • Items API Best Practices
      • Fredhopper Data Configuration Best Practices
      • Fredhopper Query Response Best Practices
      • Fredhopper Merchandising Studio Best Practices
    • Privacy Notice
  • Archived Pages
    • FHR Tracking plan
    • XO Tracking plan
    • The Tracking API and JS Library
      • What to Track
        • Generic Actions
          • View
          • Click
          • Add to Cart
          • Remove from Cart
          • Purchase
        • Custom Actions
      • Initializing the JavaScript Library
      • REST API Technical Documentation
Powered by GitBook

Copyright @ 2024 Crownpeak Technology, Inc. All rights reserved.

On this page
  • Autocomplete
  • Response
  • suggestions
  • metadata
  • Example
  1. XO Search
  2. API Reference

Autocomplete API (Beta)

Autocomplete API allows you to display queries suggestions, based on the user query. This allows the user to refine its search request, with queries that yield results in the past.

Suggested queries are based on previous queries typed by users that returned results, over the last week (default time span). By default, suggestions are ordered by the number of search views.

Prerequisites to enable autocomplete

  • Having a working XO Search implementation

  • Having tracking enabled

  • Having XO search tracking implemented, as documented in the XO tracking plan:

XO Tracking plan

  • Contact us to enable autocomplete.

Autocomplete

POST https://api-eu.attraqt.io/search/autocomplete

Autocomplete the user's queries and get suggestions using the XO Search engine.

Request Body

Name
Type
Description

token*

string

XO Search token (can be found in the XO Console)

query*

string

The query string used for the search

options.numberOfSuggestions

integer

Number of suggestions to get, at most.

Defaults to 10

(must be between 1 and 20)

configurationId

string

Configuration to use. If unspecified, the default configuration will be used

Example autocomplete request

POST https://api-eu.attraqt.io/search/autocomplete HTTP/1.1
Content-Type: application/json; charset=UTF-8

{
  "token": "SEARCH_API_TOKEN",
  "query": "T-Shirt",
  "options": {
    "numberOfSuggestions": 10
  }
}

Response

The search response contains two parts:

Property
Type
Description

suggestions

array

Array of suggestions. See below for the exact format

metadata

object

Metadata about the autocomplete request: elapsed time, ...

suggestions

The suggestions based on the input query

Property
Type
Description

suggestion

string

A suggestion, prefixed by the input query

metadata

Metadata about the search query and its results.

Property
Type
Description

time

number

Time the request took to complete (in milliseconds)

token

string

Search API token used for the request

id

string

Unique identifier

configurationId

string

Search configuration id used

Example

{
  "suggestions": [
    { "suggestion": "t-shirt black" },
    { "suggestion": "t-shirt for kids" },
    { "suggestion": "t-shirt on sale" }
  ],
  "metadata": {
    "id": "autocomplete_573e30b1-7d97-46a0-bbe0-110527150534",
    "configurationId": "cddda87b-c99d-45aa-bf45-cd53d2bc8ace",
    "time": 35,
    "token": "MY_SEARCH_TOKEN"
  }
}
PreviousSearch APINextProduct Suggest API

Last updated 1 year ago

🔎