Aqar Autocomplete API resolves a city or district name to the ids the search route needs. Without city_id the query matches cities. With city_id it matches the districts of that city, with the number of active ads for the chosen category_id. Arabic spelling variants match each other, and English names work too. Each result has city_id and district_id to pass into search unchanged. A query with no match returns an empty list. Failed requests are not billed.
Run this endpoint
Endpoint
Parameters
Start with the required fields, then add optional filters only when your use case needs them.
Runnable path
1 required parameter needed before sending a request.
3 optional filters available.
string
Required
Search text in Arabic or English, 2 to 100 characters. Example: الر.
coffee shops
integer
Optional
City id from a city result. With it the query matches the districts of that city.
1234567890
integer
Optional
Category for the district listing counts (default 6, apartments for sale). Only used with city_id.
1234567890
integer
Optional
Number of results, 1 to 25 (default 10).
10
Response Schema
Example response fields are illustrative; inspect the JSON before integrating.
Example response fields
Scan these fields before integrating.
data
meta
success
{
"data": {
"query": "\u0627\u0644\u0631",
"results": [
{
"id": 21,
"name": "\u0627\u0644\u0631\u064a\u0627\u0636",
"path": "https://sa.aqar.fm/%D8%A7%D9%84%D8%B1%D9%8A%D8%A7%D8%B6",
"type": "city",
"city_id": 21,
"name_en": "Riyadh",
"district_id": null,
"listing_count": null
}
]
},
"meta": {
"billable": true,
"endpoint_family": "autocomplete"
},
"success": true
}
Errors
Handle these documented responses before retrying or showing customer-facing failures.
Validation Error
A required parameter or a range is invalid. This response is not billable.
{
"errors": {
"query": [
"The query field is required."
]
},
"message": "The request validation failed"
}Upstream Unavailable
Aqar could not be reached or returned data that does not match the request. This response is not billable and is retryable.
{
"meta": {
"billable": false,
"retryable": true,
"endpoint_family": "autocomplete"
},
"error": {
"code": "UPSTREAM_UNAVAILABLE",
"message": "Aqar could not be reached. Please retry shortly."
},
"success": false
}Generate Code with AI
Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.
Try It Live
Test this endpoint in our interactive playground with real data.