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 | |
|---|---|
| Authentication | Required (API Token, Bearer) |
| HTTP Method | GET |
| Response | JSON |
| Version | 1 |
Resource URL
https://mapaprop.app/api/action/mapaprop-chat-ai-v1/zones/suggestions
Parameters
| Key | Type | Required | Description |
|---|---|---|---|
| term | string | yes | Search term, minimum 3 characters |
| country | string | yes | ISO country code (2 characters). Constants |
| exclude | string | no | Comma-separated list of zone codes to exclude from the results |
| limit | int | no | Number 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).
| Object | Field | Type | Required | Description |
|---|---|---|---|---|
| Response | (root) | Array of Zone | yes | Array of matching zones |
| Zone | country | int | yes | Country ID |
| description | string | yes | Full description of the zone (city, county, state) | |
| localCode | string | yes | Local code of the zone (internal hierarchy) | |
| seoUrl | string | yes | Slug of the zone for URLs | |
| code | string | yes | Full 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.