BETA

Zone suggestion service to autocomplete a zone from a search term. Unlike GET /api/action/mapaprop-chat-ai-v1/zones, it is not limited to the zones where the customer has properties: it searches over the full geographic catalog of the specified country.

Resource information
AuthenticationRequired (API Token, Bearer)
HTTP MethodGET
ResponseJSON
Version1

Resource URL

https://mapaprop.app/api/action/mapaprop-chat-ai-v1/zones/suggestions

Parameters

KeyTypeRequiredDescription
termstringyesSearch term, minimum 3 characters
countrystringyesISO country code (2 characters). Constants
excludestringnoComma-separated list of zone codes to exclude from the results
limitintnoNumber of records to return. Defaults to 10, maximum 100

Sample code

GET /api/action/mapaprop-chat-ai-v1/zones/suggestions?term=palermo&country=AR HTTP/1.1
Host: mapaprop.app
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
Authorization: Bearer {access_token}

Response

An array of matching zones, returned directly (without a container object).

ObjectFieldTypeRequiredDescription
Response(root)Array of ZoneyesArray of matching zones
ZonecountryintyesCountry ID
descriptionstringyesFull description of the zone (city, county, state)
localCodestringyesLocal code of the zone (internal hierarchy)
seoUrlstringyesSlug of the zone for URLs
codestringyesFull code of the zone, with country prefix

Sample response

[
    {
        "country": 1,
        "description": "Palermo, Capital Federal",
        "localCode": "1-46",
        "seoUrl": "palermo-capital-federal",
        "code": "1-1-46"
    },
    {
        "country": 1,
        "description": "Palermo Soho, Palermo, Capital Federal",
        "localCode": "1-50",
        "seoUrl": "palermo-soho-palermo-capital-federal",
        "code": "1-1-50"
    }
]

If term or country is missing, or term has fewer than 3 characters, or country does not have exactly 2 characters, the service responds HTTP 400 with {"error": "REQUIRED_INPUT", "description": "validation failed"} or {"error": "INPUT_TOO_SHORT", "description": "validation failed"} depending on the case. An ISO country code not recognized by Mapaprop also produces an error.