---
agentTools:
  projectIndex: https://developers.brandwatch.com/llms.txt
---

# Locations

In order to filter by specific locations in a Query, Rule or when [retrieving Mentions](https://developers.brandwatch.com/docs/retrieving-mentions), you must make a call to a specific endpoint to search for the appropriate IDs.

[block:api-header]
{
  "title": "Required Parameters"
}
[/block]

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Definition",
    "h-2": "Accepted Values",
    "0-0": "`type`",
    "1-0": "`prefix`",
    "0-1": "Defines what type of location you are searching for",
    "0-2": "`city`\n`region` \n`country`\n`continent`",
    "1-1": "A search term of what the location begins with",
    "1-2": "String, i.e \"usa\""
  },
  "cols": 3,
  "rows": 2
}
[/block]

The following call retrieves a list of locations which contain the prefix `usa`:

[block:code]
{
  "codes": [
    {
      "code": "curl -X GET 'https://api.brandwatch.com/locations?type=region&prefix=usa'",
      "language": "curl"
    }
  ]
}
[/block]

And the response would look something like this, where the `id` is used when creating a Query, Rule or retrieving Mentions to either include or exclude this location.

[block:code]
{
  "codes": [
    {
      "code": "{\n    \"resultsTotal\": 51,\n    \"resultsPage\": -1,\n    \"resultsPageSize\": -1,\n    \"results\": [\n        {\n            \"id\": \"USA.OR\",\n            \"name\": \"Oregon\",\n            \"type\": \"region\",\n            \"fullName\": \"Oregon, United States of America, North America\",\n            \"qualifiedName\": \"Oregon, United States of America\"\n        },\n        {\n            \"id\": \"USA.OH\",\n            \"name\": \"Ohio\",\n            \"type\": \"region\",\n            \"fullName\": \"Ohio, United States of America, North America\",\n            \"qualifiedName\": \"Ohio, United States of America\"\n        }\n    ]\n}",
      "language": "json"
    }
  ]
}
[/block]