# Cities

❗️ Note

The API calls in this section also support the variables quantity (boolean), id_property_type (see Property Types), for_sale (boolean), for_rent (boolean), for_transfer (boolean) and scope (number), for an example of this, see the Countries section.

To obtain information of all the cities of a specific region knowing their id we have the general URI:

api.wasi.co/v1/location/cities-from-region/#id_region

For example for Amazon the id_region is 1, so the URI would be:

api.wasi.co/v1/location/cities-from-region/1

This should return a JSON similar to the following:

{
    "0": {
        "id_city": "270",
        "name": "El Encanto",
        "region_id": "1"
    },
    "1": {
        "id_city": "412",
        "name": "La Chorrera",
        "region_id": "1"
    },
    "2": {
        "id_city": "429",
        "name": "La Pedrera",
        "region_id": "1"
    },
    "status": "success"
}

To obtain information about a specific city knowing its id you have the general URI:

api.wasi.co/v1/location/city/#id_city

For example for Abejorral the id_city is 1, so the URI would be:

api.wasi.co/v1/location/city/1

And you get the answer:

{
    "id_city": "1",
    "name": "Abejorral",
    "id_region": "2",
    "status": "success"
}

# Cities with property

To obtain information of all the cities that have assigned properties, with the respective amounts, we have the general URI:

api.wasi.co/v1/location/cities-with-property
{
    "0": {
        "id_city": 553905,
        "name": "Alajuela",
        "total": "1"
    },
    "1": {
        "id_city": 444186,
        "name": "Antigua",
        "total": "1"
    },
    "2": {
        "id_city": 63,
        "name": "Armenia",
        "total": "58"
    },
    "3": {
        "id_city": 565519,
        "name": "Bella Vista",
        "total": "1"
    },
}

By obtaining the cities with property you can add the filters:

# Filters

Name Type
id_property_type Number Property type identifier, see Property types.
for_sale Boolean Boolean value (true or false) which indicates whether the properties are available for sale or not.
for_rent Boolean Boolean value (true or false) which indicates whether the properties are available for rent (hire, lease) or not.
for_transfer Boolean Boolean value (true or false) which indicates if the property is available for exchange.
scope Number Indicates if the quantity is obtained by counting the own or allied properties, see Countries
with_region Boolean Boolean value (true or false) Indicates whether the Region information is displayed.
with_country Boolean Boolean value (true or false) Indicates whether the Country information is displayed.

# order_by

Value Description
country Sort cities by country name
region Sort cities by region name
city Sort cities by city name

❗ ️ Important

For all requests it is necessary to send credentials, for more information you can visit the section of Getting Started.

Last Updated: 8/3/2020, 9:51:52 PM