Get Geo-Targeting Options

Returns a paginated list of geographic targeting options. Results can be filtered by type (country, state, city, metro), parent ISO code, country, state, free-text search, or specific ISO code. Supports bulk export in JSON or CSV format. When export=true, the response is streamed as a file attachment in batches of 20,000 records.

Geo-Target Hierarchy

Geo-targets are organized in a four-level hierarchy. When targeting below the country level, you must scope your request using the appropriate parent filter so the API knows which parent to look under.

LevelTypeParent TypeHow to scope the request
1countryNone (top level)No parent filter needed
2statecountryPass parent_iso with the country ISO code (e.g., parent_iso=US)
3citystatePass parent_iso with the state ISO code (e.g., parent_iso=CA)
3metrostatePass parent_iso with the state ISO code (e.g., parent_iso=CA)

Example — fetching each level:

# All countries
GET /v2/meta/geotargeting?type=country

# States within the United States
GET /v2/meta/geotargeting?type=state&parent_iso=US

# Cities within California
GET /v2/meta/geotargeting?type=city&parent_iso=CA

# Metro areas within California
GET /v2/meta/geotargeting?type=metro&parent_iso=CA

The parent_iso value comes from the iso_code field returned on the parent record. Always retrieve the parent first to get the correct ISO code to use when fetching children.

Endpoint

GET

https://lifeapi.pulsepoint.com/RestApi/v2/meta/geotargeting

Query Parameters

NameData TypeRequiredDefaultNotes
typeENUM stringnoGeo-target type filter. Valid values: country, state, city, metro
parent_isostringnoISO code of the parent geo-target to scope results (e.g., US to get US states)
countrystringnoCountry ISO code filter (e.g., usa)
statestringnoState ISO code filter (e.g., ak)
searchstringnoFree-text search across geo-target names
iso_codestringnoLook up a specific geo-target by its ISO code
sortENUM stringnoSort field. Valid values: sequence, name
orderENUM stringnoascSort direction. Valid values: asc, desc
limitintegerno50Maximum number of results per page
cursorstringnoOpaque pagination cursor. Pass the next_cursor value from a previous response to get the next page
exportbooleannofalseWhen true, triggers file-download mode. Results are streamed in batches of 20,000 records
formatENUM stringnojsonExport format. Valid values: json, csv. Only applies when export=true

Sample Request

GET https://lifeapi.pulsepoint.com/RestApi/v2/meta/geotargeting?type=state&parent_iso=US&limit=50

Response Field List

NameData TypeNotes
successbooleanReturns true on a successful request
messagestringHuman-readable result message
requestIdstringUnique identifier for the request
dataarray of objectsList of geo-targeting option objects
data.idintegerUnique identifier of the geo-target
data.namestringDisplay name of the geo-target
data.typestringGeo-target type. One of: country, state, city, metro
data.type_idintegerNumeric identifier for the geo-target type
data.iso_codestringISO code of the geo-target. Use this value as parent_iso when fetching children of this record
data.has_childrenbooleanWhether this geo-target has child entries
data.is_leafbooleanWhether this geo-target is a leaf node with no children
data.children_countintegerNumber of child geo-targets
data.patharray of stringsHierarchy path from root to this geo-target (e.g., ["United States", "California"])
data.country_infoobjectCountry metadata (present for non-country types)
data.country_info.country_isostringCountry ISO code
data.country_info.country_namestringCountry display name
data.state_infoobjectState metadata (present for city and metro types)
data.state_info.state_isostringState/province ISO code
data.state_info.state_namestringState/province display name
paginationobjectPagination metadata
pagination.limitintegerThe page size used for this response
pagination.totalintegerTotal number of records matching the query
pagination.has_morebooleanWhether additional pages of results exist
pagination.next_cursorstringOpaque cursor to pass as the cursor query parameter to retrieve the next page
pagination.next_cursor_urlstringFull URL for the next page of results

Sample Response

{
  "success": true,
  "message": "Operation completed successfully",
  "requestId": "550e8400-e29b-41d4-a716-446655440000",
  "data": [
    {
      "id": 1234,
      "name": "California",
      "type": "state",
      "type_id": 2,
      "iso_code": "ca",
      "has_children": true,
      "is_leaf": false,
      "children_count": 50,
      "path": ["United States", "California"],
      "country_info": {
        "country_iso": "usa",
        "country_name": "United States"
      },
      "state_info": null
    }
  ],
  "pagination": {
    "limit": 50,
    "total": 51,
    "has_more": true,
    "next_cursor": "eyJpZCI6MTIzNDU2fQ",
    "next_cursor_url": "/RestApi/v2/meta/geotargeting?type=state&parent_iso=US&cursor=eyJpZCI6MTIzNDU2fQ&limit=50"
  }
}

Errors

HTTP StatusErrorDescription
400Validation ErrorInvalid query parameters. export must be a boolean. format must be json or csv. type must be one of the allowed enum values
401UnauthorizedInvalid or expired access token
422Unprocessable EntityInvalid parameter combination. For example, passing type=country with a country filter is not allowed
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server error