Source: https://developers.woosmap.com/api-reference/search-api/get-stores-autocomplete/

> For clean Markdown of any page, append `.md` to the page URL.

> For a complete documentation index, see https://developers.woosmap.com/llms.txt

# Autocomplete for assets



# Autocomplete for assets

 GET 
https://api.woosmap.com/stores/autocomplete

Autocomplete on `localizedNames` with highlighted results on asset name. Use the field `localized` in your query parameter to search for localized names.

### Authorization

[`key`](#authorization-woosmap-platform-api-reference-publicapikeyauth)
apiKeyquery

A Public key generated specifically to authenticate API requests on the front side. See how to [register a Public API Key](https://developers.woosmap.com/api-reference/authentication/#registering-a-woosmap-public-api-key).

[`Referer`](#authorization-woosmap-platform-api-reference-refererheader)
apiKeyheader

The Referer HTTP request header is mandatory when using PublicApiKeyAuth. In browser environment, the Referer is set by the browser itself and cannot be overridden.

[`private_key`](#authorization-woosmap-platform-api-reference-privateapikeyauth)
apiKeyquery

A Private key generated specifically to authenticate API requests on server side. Required for Data management API. See how to [register a Private API Key](https://developers.woosmap.com/api-reference/authentication/#registering-a-woosmap-private-api-key).

[`X-Api-Key`](#authorization-woosmap-platform-api-reference-privateapikeyheaderauth)
apiKeyheader

A Private key to authenticate API requests through the Header instead of Query parameter. Use either PrivateApiKeyHeaderAuth or PrivateApiKeyAuth. See how to [register a Private API Key](https://developers.woosmap.com/api-reference/authentication/#registering-a-woosmap-private-api-key).

### Query Parameters

[`query`](#query-query)
string

Search query combining one or more search clauses. Each search clause is made up of three parts structured as `field` `:` `operator` `value`. , e.g. `name:="My cool store"`

### Vocabulary

- **Field** : attribute of the Store that is searched, e.g. the attribute `name` of the store.

- **Operator** : test that is performed on the data to provide a match, e.g. `=`. Each field has a default operator. If none operator follow the `:`, the default one is used.

- **Value** : the content of the attribute that is tested, e.g. the name of the store `"My cool store"`.

Combine clauses with the conjunctions `AND` or `OR`, and negate the query with `NOT`.

### Fields

- `type`: An element is contained within `type` collection. e.g. `type:"myType"`

- `tag`: An element is contained within `tag` collection. e.g. `tag:"myTag"`

- `city`: text matching: the value match the `city` field. e.g. `city:="Paris"`

- `country`: text matching: the value match the `countryCode` field. e.g. `country:="FR"`

- `name`: text matching: the value match the `name` field. e.g. `name:="myName"`

- `idstore`: text matching: the value match the `idstore` field. e.g. `idstore:="myIdStore"`

- `user`: concerns all fields inside `user_properties`. text matching or numerical comparison. e.g. `user.myAttribute:="myValue"`

- `localized`: used for [localizedNames](https://developers.woosmap.com/products/data-api/data-structure/#localizednames) to search in native language. text matching in collection: the value match one of the the `localizedNames`. e.g. `localized:="centro"`

> **userProperties** field has no restriction regarding the data you can put in it (Arrays, Object, Boolean, String, Numeric...) but you can only query for **text matching or numerical comparison**.

### Operators

- `:` : Default and mandatory operator. For `type` and `tag` fields, define that an element is contained within a collection.

- `=` : The content of a string or a number is equal to the other.

- `>` : A number is greater than another.

- `<` : A number is smaller than another.

- `>=` : A number is greater than or equal to another.

- `<=` : A number is smaller than or equal to another.

- `AND` : Return assets that match both clauses.

- `OR` : Return assets that match either clauses.

- `NOT` : Negates a search clause.

For compound clauses, you can use parentheses to group clauses together. For example: `(type:"type1" OR type:"type2") AND tag:"hockey"` You can use `NOT` operator to negates a search clause. For example: `not type:"type1"`

Example:`name:'My cool store'|type:'click_and_collect'`

[`language`](#query-language)
string

The language code, using ISO 639-2 Alpha-2 country codes, indicating in which language the `localized` name property should be searched , if present, or else the default `name` property.

Example:`en`

[`limit`](#query-limit)
integer

If your request returns a high number of assets you should use the `limit` parameters to return only the firsts matching elements (Default is 5, max is 50).

Example:`15`

### Response

200application/json

Assets Successfully Replaced

[`predictions`](#resp-200-predictions)
any

A list of predictions based on similarity in all the `localizedNames` passed in query (or similarity to `store_name` if no `localizedNames` exist)

### Errors

#401

Unauthorized. Incorrect authentication credentials.

 

`application/json`

[`detail`](#err-401-detail)
string

Details for the credentials error

Example:`Incorrect authentication credentials. Please check or use a valid API Key`

#403

Forbidden. This Woosmap API is not enabled for this project.

 

`application/json`

[`detail`](#err-403-detail)
string

Details for the forbidden error message

Example:`This Woosmap API is not enabled for this project.`

#429

Too Many Requests. The rate limit for this endpoint has been exceeded.

 

`application/json`

[`detail`](#err-429-detail)
string

Details for the Over Query Limit error message

Example:`The rate limit for this endpoint has been exceeded`

```shell
curl -L 'https://api.woosmap.com/stores/autocomplete/?language=en&query=localized%3Astreet&limit=3&key=YOUR_PUBLIC_API_KEY' \
-H 'Referer: http://localhost'
```

```javascript
const requestOptions = {
  method: "GET",
  redirect: "follow"
};

fetch("https://api.woosmap.com/stores/autocomplete/?language=en&query=localized%3Astreet&limit=3&key=YOUR_PUBLIC_API_KEY", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
```

```python
import requests

url = "https://api.woosmap.com/stores/autocomplete/?language=en&query=localized%3Astreet&limit=3&key=YOUR_PUBLIC_API_KEY"

payload = {}
headers = {
    'Referer': 'http://localhost'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

```json
{
  "predictions": [
    {
      "store_id": "2670",
      "name": "Sun Street",
      "types": [
        "Coffee shop"
      ],
      "matched_substrings": [
        {
          "offset": 4,
          "length": 6
        }
      ],
      "highlighted": "Sun <b>Street</b>"
    },
    {
      "store_id": "16069",
      "name": "7th Street",
      "types": [
        "Coffee shop"
      ],
      "matched_substrings": [
        {
          "offset": 4,
          "length": 6
        }
      ],
      "highlighted": "7th <b>Street</b>"
    },
    {
      "store_id": "1013873",
      "name": "The Street",
      "types": [
        "Coffee shop"
      ],
      "matched_substrings": [
        {
          "offset": 4,
          "length": 6
        }
      ],
      "highlighted": "The <b>Street</b>"
    }
  ]
}
```

```json
{
  "detail": "Incorrect authentication credentials. Please check or use a valid API Key"
}
```

```json
{
  "detail": "This Woosmap API is not enabled for this project."
}
```

```json
{
  "detail": "The rate limit for this endpoint has been exceeded"
}
```
