Search Google Ads locations

Changed on

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Searches Google's location catalog so you can offer a location picker when you create or edit a campaign.

Pass what the person is typing as query. Results come back ordered by how well they match, and each one carries the resource_name you pass to Create campaign in geo_targets.

You do not need a connected Google Ads account, so this works before the account exists. Set country_code to keep results inside one country. An empty query returns Google's unfiltered suggestions rather than an error.

<Note>This endpoint accepts a personal API key. Workspace API keys are not authorized for it and are rejected with a 403.</Note>

get/api/apps/{app_id}/google-ads/geo-targets/search

Request

  • Base URL: https://app.base44.com
  • URL: https://app.base44.com/api/apps/{app_id}/google-ads/geo-targets/search
  • Auth: HTTP bearer

Path parameters

app_idstring required

ID of the app you are planning a Google Ads campaign for.

Query parameters

querystring

What the person is typing. Shorter than two characters is still accepted.

country_codestring

Keep results inside one country, as an ISO 3166-1 alpha-2 code. Empty searches everywhere.

limitinteger

Most results to return.

Response

Locations matching the search string.

resource_namestring required

Google's identifier for the location. Pass it in geo_targets when you create a campaign.

namestring required

The location's own name.

canonical_namestring required

The location's full path, including its region and country.

country_codestring required

ISO 3166-1 alpha-2 country code the location sits in.

target_typestring required

What kind of place this is, for example City, Region or Country.

reachinteger required

Google's estimate of how many people can be reached in this location.

search_termstring required

The query value this result was matched against, echoed back.

Example response

[
  {
    "resource_name": "geoTargetConstants/1014221",
    "name": "San Francisco",
    "canonical_name": "San Francisco,California,United States",
    "country_code": "US",
    "target_type": "City",
    "reach": 4200000,
    "search_term": "san francisco"
  }
]

Changes

    • info

      the security scope read_only was added to the endpoint's security scheme PersonalAccessTokenAuth

    • info

      the security scope full_access was removed from the endpoint's security scheme PersonalAccessTokenAuth

    • info

      the endpoint scheme security PersonalAccessTokenAuth was added to the API