Source: https://eventregistry.org/documentation?tab=suggLocations

# Suggest locations

Retrieve the location URI for a given location name.

Use this API endpoint to map the location name (city or country) to a location URI that can be used when specifying the `locationUri` filter in various API calls. The location name can also be a partial name. The returned value will contain an array of location candidates that match the input label.

**Endpoint:** GET | POST `https://eventregistry.org/api/v1/suggestLocationsFast`

**Headers:** Content-Type: application/json

#### `Parameters`

#### `apiKey`

string (required)

Your API key

#### `prefix`

string

Partial or full name of the location.

## Request examples

### Example 1

Find the list of locations that start with word "Lond".

Request body:

```json
{
  "prefix": "Lond",
  "count": 20,
  "source": [
    "place",
    "country"
  ],
  "lang": "eng",
  "countryUri": "",
  "apiKey": "YOUR_API_KEY"
}
```

```python
from eventregistry import *
er = EventRegistry(apiKey = YOUR_API_KEY)

conceptUrisMatchingObama = er.suggestLocations("Lond")
```

```javascript
var er = new erBase.EventRegistry();
                    er.suggestLocations("Lond").then((response) => {
                        console.info(response);
                    });
```

```typescript
const er = new EventRegistry();
                    er.suggestLocations("Lond").then((response) => {
                        console.info(response);
                    });
```

## Example output

```json
[
  {
    "type": "country",
    "wikiUri": "http://en.wikipedia.org/wiki/Slovakia",
    "label": {
      "eng": "Slovakia"
    },
    "lat": 48.66667,
    "long": 19.5
  },
  {
    "type": "place",
    "wikiUri": "http://en.wikipedia.org/wiki/Martin,_Slovakia",
    "label": {
      "eng": "Martin, Slovakia"
    },
    "lat": 49.06651,
    "long": 18.92399,
    "country": {
      "type": "country",
      "wikiUri": "http://en.wikipedia.org/wiki/Slovakia",
      "label": {
        "eng": "Slovakia"
      },
      "lat": 48.66667,
      "long": 19.5
    },
    "score": 60817
  },
  {
    "#META ITEM": "other locations..."
  }
]
```

## Output schema

```json
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "type": {
        "type": "string"
      },
      "wikiUri": {
        "type": "string"
      },
      "label": {
        "type": "string"
      },
      "lat": {
        "type": "object",
        "properties": {
          "eng": {
            "type": "string"
          }
        }
      },
      "long": {
        "type": "string"
      }
    }
  }
}
```
