Skip to content

Instantly share code, notes, and snippets.

@bgun
Last active August 29, 2015 14:24
Show Gist options
  • Save bgun/8041fe4f20be2b46d519 to your computer and use it in GitHub Desktop.
Save bgun/8041fe4f20be2b46d519 to your computer and use it in GitHub Desktop.

Regions hierarchy

Endpoints

List of countries

r/countries

"countries": [
    {
        "country_id": "GUID",
        "locality_type": 0,
        "name": "United States",
        "language": "en"
    }
    ...
]

List of states/provinces for the United States

r/country/:REGION_ID/admin_1

"country": {
    "country_id": "GUID",
    "locality_type": 0,
    "name": "United States",
    "language": "en"
},
"states": [
    {
        "state_id": "GUID",
        "country_id": "GUID",
        "locality_type": "LOCALITY_TYPE_COUNTRY",
        "name": "Oklahoma",
        "lat": 35.3090716,
        "lon": -98.7165585
    }
    ...
]

List of cities in Oklahoma

r/state/:REGION_ID/cities

"country": {
    "country_id": "GUID",
    "locality_type": 0,
    "name": "United States",
    "language": "en"
},
"state": {
    "state_id": "GUID",
    "country_id": "GUID",
    "locality_type": "LOCALITY_TYPE_COUNTRY",
    "name": "Oklahoma",
    "lat": 35.3090716,
    "lon": -98.7165585
},
"cities": [
    {
        "city_id": "GUID",
        "state_id": "GUID",
        "country_id": "GUID",
        "locality_type": "LOCALITY_TYPE_STATE",
        "name": "Tulsa",
        "lat": 36.1523015,
        "lon": -95.8780106
    }
    ...
]

List of neighborhoods for Tulsa

r/city/:REGION_ID/neighborhoods

"country": {
    "country_id": "GUID",
    "locality_type": 0,
    "name": "United States",
    "language": "en"
},
"state": {
    "state_id": "GUID",
    "country_id": "GUID",
    "locality_type": "LOCALITY_TYPE_COUNTRY",
    "name": "Oklahoma",
    "lat": 35.3090716,
    "lon": -98.7165585
},
"city": {
    "city_id": "GUID",
    "state_id": "GUID",
    "country_id": "GUID",
    "locality_type": "LOCALITY_TYPE_STATE",
    "name": "Tulsa",
    "lat": 36.1523015,
    "lon": -95.8780106
},
"neighborhoods": [
    {
        "neighborhood_id": "GUID",
        "city_id": "GUID",
        "state_id": "GUID",
        "country_id": "GUID",
        "locality_type": "LOCALITY_TYPE_CITY",
        "name": "Blue Dome",
        "lat": 36.156172,
        "lon": -95.987340
    }
    ...
]
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment