Numbers & Inventory

Search locations by prefix

Search for locations (cities) that have DID numbers starting with a specific prefix.

Important notes:

  • Useful for finding locations with specific area codes
  • Prefix can be partial number (e.g., "212" for NYC area code)
  • Returns combined location information (country, state, city)

When to use:

  • Implementing "vanity number" search by prefix
  • Finding locations with specific area codes
  • Reverse lookup of number to location

locations[].city_id feeds numbers_countries_cities_dids_index and numbers_search_show (city_id). locations[].state_id feeds numbers_search_show (region_id).

get/api/v2/numbers/countries/{country_id}/locations

Request

  • Base URL: https://app.didlogic.com
  • URL: https://app.didlogic.com/api/v2/numbers/countries/{country_id}/locations
  • Auth: HTTP bearer

Path parameters

country_idinteger required

Country id from numbers_countries_index

Query parameters

prefixinteger required

Number prefix to search for

sms_enabledstring

Filter locations by SMS capability

Response

returns list of locations

Example response

{
  "locations": [
    {
      "city_id": 313,
      "city_name": "New York",
      "country_name": "United States",
      "state_id": 42,
      "country_id": 301,
      "label": "New York 212200, United States",
      "city_code": 212200,
      "state_name": "New York"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.