Skip to content
Scrappa Get API key
Aqar API 1 credit/request

Aqar Autocomplete API Documentation

GET https://scrappa.co/api/aqar/autocomplete

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.

Aqar Autocomplete API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/aqar/autocomplete
Auth header
x-api-key
Cost
1 credit/request
query = coffee shops
Response preview
200 OK
{
    "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
            }
...

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.

query string Required

Search text in Arabic or English, 2 to 100 characters. Example: الر.

Example value coffee shops
city_id integer Optional

City id from a city result. With it the query matches the districts of that city.

Example value 1234567890
category_id integer Optional

Category for the district listing counts (default 6, apartments for sale). Only used with city_id.

Example value 1234567890
limit integer Optional

Number of results, 1 to 25 (default 10).

Example value 10

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "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.

422

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"
}
503

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.