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

Batdongsan Autocomplete API Documentation

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

Batdongsan Autocomplete API turns a place name into locations. Each result names the province, district, ward, street and project it covers. The fields location_id and location_type feed the search route directly. The most specific part wins: project, then street, ward, district.

Good to know:

  • Results use the ward system that the search filters honour, so every returned id filters.
  • Type the name with or without accents.
Batdongsan Autocomplete API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/batdongsan/autocomplete
Auth header
x-api-key
Cost
1 credit/request
query = coffee shops
Response preview
200 OK
{
    "data": {
        "query": "cau giay",
        "results": [
            {
                "kind": "place",
                "ward_id": null,
                "latitude": null,
                "city_code": "HN",
                "city_name": "H\u00e0 N\u1ed9i",
                "longitude": null,
                "street_id": null,
                "ward_name": null,
                "project_id": 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.

1 optional filter available.

query string Required

Place name, 2 to 100 characters. Example: cau giay.

Example value coffee shops
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": "cau giay",
        "results": [
            {
                "kind": "place",
                "ward_id": null,
                "latitude": null,
                "city_code": "HN",
                "city_name": "H\u00e0 N\u1ed9i",
                "longitude": null,
                "street_id": null,
                "ward_name": null,
                "project_id": null,
                "suggestion": "Qu\u1eadn C\u1ea7u Gi\u1ea5y, H\u00e0 N\u1ed9i",
                "district_id": 7,
                "location_id": "7",
                "street_name": null,
                "project_name": null,
                "district_name": "C\u1ea7u Gi\u1ea5y",
                "location_type": "district",
                "address_version": 0
            },
            {
                "kind": "place",
                "ward_id": null,
                "latitude": null,
                "city_code": "HN",
                "city_name": "H\u00e0 N\u1ed9i",
                "longitude": null,
                "street_id": 3981,
                "ward_name": null,
                "project_id": null,
                "suggestion": "\u0110\u01b0\u1eddng C\u1ea7u Gi\u1ea5y, Qu\u1eadn \u0110\u1ed1ng \u0110a, H\u00e0 N\u1ed9i",
                "district_id": 3,
                "location_id": "3981",
                "street_name": "C\u1ea7u Gi\u1ea5y",
                "project_name": null,
                "district_name": "\u0110\u1ed1ng \u0110a",
                "location_type": "street",
                "address_version": 0
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "success": true
}

Errors

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

422

Validation Error

A value is missing, unknown or out of range. Examples: an unknown province code, a category that does not exist for the listing type, or a reversed range. This response is not billed.

{
    "errors": {
        "city": [
            "The selected city is invalid."
        ]
    },
    "message": "The request validation failed"
}
503

Upstream Unavailable

Batdongsan could not be reached or returned data that does not match the request. Retry shortly. This response is not billed.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "autocomplete"
    },
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "Batdongsan 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.