Skip to content
On this page

Fetch Locations (Countries, Provinces, Cities) ​

Retrieve countries, provinces, and cities available in your store.

Endpoint ​

json
https://api-stores.storeino.com/api/locations/search

Query Parameters ​

NameTypeDescription
countrystring(optional) Country ID. Returns provinces for the given country.
provincestring(optional) Province ID. Returns cities for the given province and country.

Usage ​

  • Get all countries:
    Call the endpoint with no query parameters.

  • Get provinces for a country:
    Add ?country=<country_id> to the endpoint.

  • Get cities for a province:
    Add ?country=<country_id>&province=<province_id> to the endpoint.

Example Requests ​

  • Get all countries:

  • Get cities in a province:

Example Responses ​

All Countries ​

json
https://api-stores.storeino.com/api/locations/search
json
{
"results": [
  { "_id": "country_id_1", "name": "Country 1" },
  { "_id": "country_id_2", "name": "Country 2" }
]
}

All Provinces ​

json
https://api-stores.storeino.com/api/locations/search?country=countryId
json
{
  "results": [
    { "_id": "province_id_1", "name": "Province 1" },
    { "_id": "province_id_2", "name": "Province 2" }
  ]
}
json
https://api-stores.storeino.com/api/locations/search?country=country_Id&province=province_id

All Cities ​

json
{
  "results": [
    { "_id": "city_id_1", "name": "City 1" },
    { "_id": "city_id_2", "name": "City 2" }
  ]
}

Released under the MIT License.