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

Mubawab Autocomplete API Documentation

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

Mubawab Autocomplete API finds city slugs by name. Pass the slug to the location filter of the search route. Names that start with your text come first. The answer comes from a list of cities that was checked against the site, so it costs no upstream request and does not list every district. A query with no match returns an empty list. Failed requests are not billed.

Mubawab Autocomplete API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/mubawab/autocomplete
Auth header
x-api-key
Cost
1 credit/request
query = coffee shops
Response preview
200 OK
{
    "data": {
        "items": [
            {
                "kind": "city",
                "name": "Rabat",
                "slug": "rabat",
                "country": "ma"
            }
        ],
        "query": "rab"
    },
    "meta": {
        "country": 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.

2 optional filters available.

query string Required

Search text, 2 to 60 characters. Example: rab.

Example value coffee shops
country string Optional

ma or tn. Default: both.

Example value US
limit integer Optional

Maximum 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": {
        "items": [
            {
                "kind": "city",
                "name": "Rabat",
                "slug": "rabat",
                "country": "ma"
            }
        ],
        "query": "rab"
    },
    "meta": {
        "country": null,
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

A parameter is missing or invalid. This response is not billable.

{
    "errors": {
        "query": [
            "The query field is required."
        ]
    },
    "message": "The request validation failed"
}
503

Upstream Unavailable

Mubawab 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": "Mubawab 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.