> ## Documentation Index
> Fetch the complete documentation index at: https://plai-a079b342.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Targeting Locations

> This endpoint allows you to search for advertising target Locations based on search query. It helps in identifying relevant locations to improve the accuracy and effectiveness of ad targeting.

## Request Body

<ParamField body="userId" type="string" required>
  User ID, If not already created, make a user on [create user
  page](/api-reference/endpoint/auth/create_user) first. If already created,
  retrieve the user ID from [get profile
  page](/api-reference/endpoint/auth/get_profile).
</ParamField>

<ParamField body="query" type="string" required>
  Location Search Query, for example: `New York`
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates that the HTTP response was successful (status code 200 OK).
</ResponseField>

<ResponseField name="results" type="object">
  <Expandable title="Media Results">
    <ResponseField name="success" type="boolean">
      Indicates whether the specific operation or API action was successful.
    </ResponseField>

    <ResponseField name="locations" type="object[]">
      <Expandable title="Location Items">
        <ResponseField name="key" type="string">
          Unique location identifier
        </ResponseField>

        <ResponseField name="name" type="string">
          Display name of the location
        </ResponseField>

        <ResponseField name="region" type="string">
          Administrative region/state
        </ResponseField>

        <ResponseField name="country_name" type="string">
          Full country name
        </ResponseField>

        <ResponseField name="type" type="string">
          Geographic level : `city`, `subcity`, `neighborhood`
        </ResponseField>

        <ResponseField name="country_code" type="string" format="ISO 3166-1 alpha-2">
          2-letter country code
        </ResponseField>

        <ResponseField name="region_id" type="number">
          Internal region identifier
        </ResponseField>

        <ResponseField name="supports_region" type="boolean">
          Whether regional targeting is available
        </ResponseField>

        <ResponseField name="supports_city" type="boolean">
          Whether city-level targeting is available
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="error" type="string">
      Error string if something went wrong
    </ResponseField>
  </Expandable>
</ResponseField>
