---
agentTools:
  projectIndex: https://findify.readme.io/llms.txt
---

# /autocomplete

Get the predictive results. The answer contains both search suggestions to direct the end user to high-conversion queries, and item matches to help them understand what will be displayed in the complete search results.

[block:api-header]
{
  "title": "Autocomplete response description"
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "// Autocomplete response structure\n{\t\n\t/** Autocomplete request meta data */\n\tmeta: {\n\t\t/** Item limit - this is the limitation of the product matches returned */\n\t\titem_limit: 3,\n\t\t/** Suggestion limit - this is the limitation of the suggestions returned */\n\t\tsuggestion_limit: 6,\n\t\t/** Query taht was used to perform request */\n\t\tq: 'sample',\n\t\t/** Rerquest ID - first part: prefix that points to the source of the request (a/s/sc/r/c) */\n\t\t/** In case of autocomplete request prefix - is \"a\" */\n\t\t/** Second part is randomly generated string */\n\t\trid: 's-9fcc881c-1420-4e57-bc58-e234829c363c'\n\t},\n  \tredirect: {\n\t    /** name of the redirect */\n\t    name: \"NAME\",\n\t    /** url of the redirect */\n\t    url: \"URL\"\n\t  },\n  \t/** Array of returned suggestions */\n  \n  /** Mapping of returned content items for each requested content source */\n  content: {\n  \t\"shopify-blog_123\": [\n      {\n        /** Returnable content items fields */\n      \ttitle: \"some title\",\n        url: \"some-url\",\n        [field_name]: \"field-value\"\n      }\n    ]\n  },\n\tsuggestions: [\n    \t{\n\t\t\tvalue: 'a',\n\t\t\tredirect: {\n\t\t\t\t/** name of the redirect */\n\t\t\t\tname: \"NAME\",\n\t\t\t\t/** url of the redirect */\n\t\t\t\turl: \"URL\"\n\t\t\t}\n\t\t},{\n\t\t\tvalue: 'b'\n\t\t}\n\t],\n\t/** Array of returned product matches */\n\titems: [\n\t\t/** Object that represents default autocomplete product match */\n\t\t/** Important note: there might be additional fields in response, it depends on autocomplet returnable fields configuration */\n\t\t{\n\t\t\t/** Boolean flag that indicates whether the product is available or not */\n\t\t\tavailability: true,\n\t\t\t/** Product ID */\n\t\t\tid: '4123451324123',\n\t\t\t/** Product URL */\n\t\t\tproduct_url: 'https://store-name.com/path_to_product',\n\t\t\t/** Price with which the discount price is compared */\n\t\t\t/** In case when product doesn't have sale price this fields will be -1 */\n\t\t\tcompare_at: 100,\n\t\t\t/** Array of availble product prices */\n\t\t\tprice: [90],\n\t\t\t/** If product has a sale price this field contains array of numbers */\n\t\t\t/** that represents discount value in percentage for each discounted price */\n\t\t\tdiscount: [10],\n\t\t\t/** Url for thumbnail image (cropped main product image) */\n\t\t\tthumbnail_url: 'https://cdn_name.com/path_the_thumbnail_image',\n\t\t\t/** Object with boolean flags which indicates which stickers to show  */\n\t\t\tstickers: {\n\t\t\t\tdiscount: true,\n\t\t\t\tavailability: true,\n\t\t\t\tin-stock: true,\n\t\t\t\tout-of-stock: false\n\t\t\t}\n\t\t}\n\t]\n}",
      "language": "javascript"
    }
  ]
}
[/block]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "API Settings",
    "version": "4"
  },
  "servers": [
    {
      "url": "https://api-v3.findify.io/v3"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "name": "X-Key",
        "in": "header",
        "x-default": "2e963f3e-38bd-4c00-9636-c00e48945eb7",
        "type": "apiKey"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/autocomplete": {
      "post": {
        "summary": "/autocomplete",
        "description": "Get the predictive results. The answer contains both search suggestions to direct the end user to high-conversion queries, and item matches to help them understand what will be displayed in the complete search results.",
        "operationId": "search-api-autocomplete",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "t_client",
                  "user",
                  "q"
                ],
                "properties": {
                  "t_client": {
                    "type": "string",
                    "description": "Timestamp when the request is sent from the browser",
                    "default": "1484316253525",
                    "format": "date-time"
                  },
                  "user": {
                    "type": "object",
                    "required": [
                      "uid",
                      "sid"
                    ],
                    "properties": {
                      "uid": {
                        "type": "string",
                        "description": "max length: 32 characters"
                      },
                      "sid": {
                        "type": "string",
                        "description": "max length: 32 characters"
                      },
                      "email": {
                        "type": "string"
                      },
                      "ip": {
                        "type": "string"
                      },
                      "ua": {
                        "type": "string"
                      },
                      "lang": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "q": {
                    "type": "string"
                  },
                  "callback": {
                    "type": "string"
                  },
                  "log": {
                    "type": "boolean"
                  },
                  "limits": {
                    "type": "object",
                    "description": "Define how much suggestions/product matches/content items to return",
                    "required": [
                      "suggestions",
                      "items"
                    ],
                    "properties": {
                      "suggestions": {
                        "type": "integer",
                        "description": "Number of search suggestions to return",
                        "default": 6,
                        "format": "int32"
                      },
                      "items": {
                        "type": "integer",
                        "description": "Number of product matches to return",
                        "default": 4,
                        "format": "int32"
                      },
                      "[content_source]": {
                        "type": "integer",
                        "description": "Number of particular content source items to return",
                        "format": "int32"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"meta\": {\n    \"q\": \"t\",\n    \"suggestion_limit\": 3,\n    \"item_limit\": 3,\n    \"rid\": \"a-edb49c53-eec3-48cc-85ab-d70f77b6e7b2\"\n  },\n  \"suggestions\": [\n    {\n      \"value\": \"t\",\n      \"redirect\": {\n        \"name\": \"https://findify.myshopify.com/collections/all\",\n        \"url\": \"https://findify.myshopify.com/collections/all\"\n      }\n    },\n    {\n      \"value\": \"t shirt\"\n    },\n    {\n      \"value\": \"t example\"\n    }\n  ],\n  \"redirect\": {\n    \"name\": \"https://findify.myshopify.com/collections/all\",\n    \"url\": \"https://findify.myshopify.com/collections/all\"\n  },\n  \"content\": {\n  \t\"shopify-blog_123\": [\n       {\n          \"title\":\"Accessories\",\n          \"url\":\"http://findify.myshopify.com/collections/accessories\"\n       },\n       {\n          \"title\":\"another army\",\n          \"url\":\"http://findify.myshopify.com/collections/army\"\n       },\n       {\n          \"title\":\"Bags\",\n          \"url\":\"http://findify.myshopify.com/collections/bags\"\n       },\n       {\n          \"title\":\"Men's Shoes\",\n          \"url\":\"http://findify.myshopify.com/collections/mens-shoes\"\n       },\n       {\n          \"title\":\"Men\",\n          \"url\":\"http://findify.myshopify.com/collections/men\"\n       }\n    ]\n  },\n  \"items\": [\n    {\n      \"product_url\": \"http://findify-demo-store.myshopify.com/products/example-t-shirt\",\n      \"price\": [\n        19.99,\n        19.99,\n        19.99,\n        19.99,\n        19.99,\n        23,\n        25\n      ],\n      \"id\": \"6411337927\",\n      \"title\": \"Example T-Shirt\",\n      \"thumbnail_url\": \"https://cdn.shopify.com/s/files/1/1281/0545/products/shopify_shirt_small.png?v=1462524515\",\n      \"compare_at\": -1,\n      \"stickers\": {\n        \"in-stock\": false,\n        \"out-of-stock\": false,\n        \"discount\": false,\n        \"free-shipping\": false\n      }\n    },\n    {\n      \"product_url\": \"http://findify-demo-store.myshopify.com/products/hills-canine-vetessentials-mature-adult\",\n      \"price\": [\n        18.38,\n        55.34\n      ],\n      \"id\": \"6411340743\",\n      \"title\": \"Hill's Canine Vetessentials Mature Adult\",\n      \"thumbnail_url\": \"https://cdn.shopify.com/s/files/1/1281/0545/products/hills_vetessentials_canine_mature_adult_small.jpeg?v=1462524523\",\n      \"compare_at\": -1,\n      \"stickers\": {\n        \"in-stock\": false,\n        \"out-of-stock\": false,\n        \"discount\": false,\n        \"free-shipping\": false\n      }\n    },\n    {\n      \"product_url\": \"http://findify-demo-store.myshopify.com/products/hills-canine-vetessentials-adult\",\n      \"price\": [\n        16.75,\n        51.4\n      ],\n      \"id\": \"6411340167\",\n      \"title\": \"Hill's Canine Vetessentials Adult\",\n      \"thumbnail_url\": \"https://cdn.shopify.com/s/files/1/1281/0545/products/hills_vetessentials_canine_adult_small.jpeg?v=1462524521\",\n      \"compare_at\": -1,\n      \"stickers\": {\n        \"in-stock\": false,\n        \"out-of-stock\": false,\n        \"discount\": false,\n        \"free-shipping\": false\n      }\n    }\n  ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "q": {
                          "type": "string",
                          "example": "t"
                        },
                        "suggestion_limit": {
                          "type": "integer",
                          "example": 3,
                          "default": 0
                        },
                        "item_limit": {
                          "type": "integer",
                          "example": 3,
                          "default": 0
                        },
                        "rid": {
                          "type": "string",
                          "example": "a-edb49c53-eec3-48cc-85ab-d70f77b6e7b2"
                        }
                      }
                    },
                    "suggestions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string",
                            "example": "t"
                          },
                          "redirect": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string",
                                "example": "https://findify.myshopify.com/collections/all"
                              },
                              "url": {
                                "type": "string",
                                "example": "https://findify.myshopify.com/collections/all"
                              }
                            }
                          }
                        }
                      }
                    },
                    "redirect": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "example": "https://findify.myshopify.com/collections/all"
                        },
                        "url": {
                          "type": "string",
                          "example": "https://findify.myshopify.com/collections/all"
                        }
                      }
                    },
                    "content": {
                      "type": "object",
                      "properties": {
                        "shopify-blog_123": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string",
                                "example": "Accessories"
                              },
                              "url": {
                                "type": "string",
                                "example": "http://findify.myshopify.com/collections/accessories"
                              }
                            }
                          }
                        }
                      }
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "product_url": {
                            "type": "string",
                            "example": "http://findify-demo-store.myshopify.com/products/example-t-shirt"
                          },
                          "price": {
                            "type": "array",
                            "items": {
                              "type": "number",
                              "example": 19.99,
                              "default": 0
                            }
                          },
                          "id": {
                            "type": "string",
                            "example": "6411337927"
                          },
                          "title": {
                            "type": "string",
                            "example": "Example T-Shirt"
                          },
                          "thumbnail_url": {
                            "type": "string",
                            "example": "https://cdn.shopify.com/s/files/1/1281/0545/products/shopify_shirt_small.png?v=1462524515"
                          },
                          "compare_at": {
                            "type": "integer",
                            "example": -1,
                            "default": 0
                          },
                          "stickers": {
                            "type": "object",
                            "properties": {
                              "in-stock": {
                                "type": "boolean",
                                "example": false,
                                "default": true
                              },
                              "out-of-stock": {
                                "type": "boolean",
                                "example": false,
                                "default": true
                              },
                              "discount": {
                                "type": "boolean",
                                "example": false,
                                "default": true
                              },
                              "free-shipping": {
                                "type": "boolean",
                                "example": false,
                                "default": true
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"error\": {\n    \"message\": \"You should provide Findify API Key\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "You should provide Findify API Key"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl --request POST \\\n  --url https://api-v3.findify.io/v3/autocomplete \\\n  --header \"X-Key: 2e963f3e-38bd-4c00-9636-c00e48945eb7\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\"user\":{\"lang\":[\"en-US\",\"en-GB\",\"no\"],\"uid\":\"test1\",\"sid\":\"ssid\",\"email\":\"test@test.com\",\"ip\":\"192.168.0.1\",\"ua\":\"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36\"},\"q\":\"t\",\"t_client\":1484741395471,\"limits\": { \"suggestions\": 10, \"items\": 10, \"shopify-blog_123\": 10 },\"log\":false}'"
            },
            {
              "language": "javascript",
              "code": "//Please, don't forget to include the SDK script\n//Which you can find here: https://github.com/findify/javascript-sdk\n\nvar client = FindifySDK.init({\n    key: '2e963f3e-38bd-4c00-9636-c00e48945eb7',\n    user: {\n        uid: 'test1',\n        sid: 'ssid',\n      \temail: 'test@test.com'\n    },\n    log: false\n});\n\nvar request = {\n    q: 't',\n    limits: {\n    \tsuggestions: 10,\n      items: 10,\n      \"shopify-blog_123\": 10\n    }\n};\n\nclient.autocomplete(request).then(function (response) {\n  console.log(response);\n});"
            },
            {
              "language": "javascript",
              "code": "var request = require(\"request\"); \n\nvar options = { \n  method: 'POST',\n  url: 'https://api-v3.findify.io/v3/autocomplete',\n  headers: {\n  \t\"X-key\": \"2e963f3e-38bd-4c00-9636-c00e48945eb7\"\n  },\n  body: { \n      user: { \n        lang: [ 'en-US', 'en-GB', 'no' ],\n        uid: 'test1',\n        sid: 'ssid',\n        email: 'test@test.com',\n        ip: '192.168.0.1',\n        ua: 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36' \n      },\n      q: 't',\n      t_client: 1484741395471,\n      limits: {\n      \tsuggestions: 10,\n        items: 10,\n        'shopify-blog_123': 10\n      },\n      log: false\n  \t},\n  \tjson: true \n  };\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});",
              "name": "Node"
            },
            {
              "language": "php",
              "code": "<?php\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n// Configure API key authorization: key\nSwagger\\Client\\Configuration::getDefaultConfiguration()->setApiKey('X-Key', '2e963f3e-38bd-4c00-9636-c00e48945eb7');\n\n$api_instance = new Swagger\\Client\\Api\\DefaultApi();\n$autocomplete = new \\Swagger\\Client\\Model\\AutocompleteRequest(array(\n    'user' => array(\n        'uid' => 'test1',\n        'sid' => 'ssid',\n        'email' => 'test@test.com',\n        'ip' => '192.168.0.1',\n        'ua' => 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36',\n        'lang' => array(\n            'en-US',\n            'en-GB',\n            'no'\n        )\n    ),\n    'q' => 't',\n    't_client' => '1484741395471',\n    'limits' => array(\n    \t'suggestions' => 10,\n      'items' => 10,\n      'shopify-blog_123' => 10\n    ),\n    'log' => false\n));\n\ntry {\n    $result = $api_instance->autocompletePost($autocomplete);\n    echo $result;\n}\ncatch (Exception $e) {\n    echo 'Exception when calling DefaultApi->autocompletePost: ', $e->getMessage(), PHP_EOL;\n}\n\n?>"
            }
          ],
          "samples-languages": [
            "curl",
            "javascript",
            "php"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "5efdd96870e09d003a66a1e6:5efdd96870e09d003a66a1f2"
}
```