> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voyantcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Autocomplete Places

> Fetch Google Places predictions for cities or airports.

## Method

`GET` `/v1/places/autocomplete`

## Query Parameters

<ParamField query="q" type="string" required>Search input (minimum 3 characters). Alias: `input`.</ParamField>
<ParamField query="kind" type="string">Limit results to `city` or `airport`.</ParamField>

## Headers

<ParamField header="Authorization" type="string">Bearer token (e.g. <code>Authorization: Bearer YOUR\_API\_KEY</code>)</ParamField>

## Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.voyantcloud.com/v1/places/autocomplete?q=Paris&kind=city" \
    -H "Authorization: Bearer $VOYANT_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const res = await fetch("https://api.voyantcloud.com/v1/places/autocomplete?q=OTP&kind=airport", {
    headers: { Authorization: `Bearer ${process.env.VOYANT_API_KEY}` },
  })
  const data = await res.json()
  ```

  ```python Python theme={null}
  import os, requests

  resp = requests.get(
    "https://api.voyantcloud.com/v1/places/autocomplete",
    params={"q": "par", "kind": "city"},
    headers={"Authorization": f"Bearer {os.environ['VOYANT_API_KEY']}"},
  )
  predictions = resp.json()
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "predictions": [
      {
        "place_id": "ChIJdUyx15EuEmsR3E0i9zlBzJ0",
        "description": "Paris, France",
        "structured_formatting": {
          "main_text": "Paris",
          "secondary_text": "France"
        }
      },
      {
        "place_id": "ChIJD7fiBh9u5kcRYJSMaMOCCwQ",
        "description": "Paris, Île-de-France, France",
        "structured_formatting": {
          "main_text": "Paris",
          "secondary_text": "Île-de-France, France"
        }
      }
    ]
  }
  ```

  ```json 200 OK theme={null}
  {
    "predictions": [],
    "error": "OVER_QUERY_LIMIT"
  }
  ```
</ResponseExample>

<Tip>Send at least three characters. Shorter queries return an empty array without calling Google Places.</Tip>
