Autocomplete

Autocomplete locations

Auto complete the location search

POST
/v2/autocomplete/locations

Query Parameters

apiToken?|

Header Parameters

x-api-token?|

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.ocean.io/v2/autocomplete/locations" \  -H "Content-Type: application/json" \  -d '{    "query": "londo"  }'
{
  "locations": [
    {
      "countryCode": "us",
      "filterCode": "us-CA",
      "name": "California",
      "parentCode": "us",
      "parentName": "United States",
      "type": "1-country"
    }
  ]
}
{
  "detail": "Conflicting API tokens provided in query parameters and headers"
}
{
  "detail": "Insufficient credits"
}
{
  "detail": "API token should be provided in headers or query parameters"
}
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}