# Batdongsan Map Markers API Documentation

<p><strong>Batdongsan Map Markers API</strong> lists what the site draws on its map inside a box: single listings with a price label and project clusters with the number of listings. Use it for map views and for counts per project.</p><p>Good to know:</p><ul><li>The north-east corner must lie north and east of the south-west corner, or the request returns 422.</li><li>Marker types: 2 is a project cluster, 1 and 3 are single listings with <code>listing_id</code>.</li><li>Search the listings of a project with the search route and <code>location_type=project</code>.</li></ul>

- **Documentation:** [https://scrappa.co/docs/batdongsan-api/batdongsan_map_markers](https://scrappa.co/docs/batdongsan-api/batdongsan_map_markers)
- **API group:** Batdongsan API
- **Endpoint:** `GET https://scrappa.co/api/batdongsan/map-markers`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `city` | string | Yes | Province code. Examples: HN (Hà Nội), SG (Hồ Chí Minh), DDN (Đà Nẵng), HP (Hải Phòng), CT (Cần Thơ), BD (Bình Dương), DNA (Đồng Nai), KH (Khánh Hòa). All 63 provinces work; the full list is under the table. |
| `listing_type` | string | No | sale (default) or rent. |
| `north_east_lat` | number | Yes | Latitude of the north-east corner. |
| `north_east_lng` | number | Yes | Longitude of the north-east corner. |
| `south_west_lat` | number | Yes | Latitude of the south-west corner. |
| `south_west_lng` | number | Yes | Longitude of the south-west corner. |

## Example response

```json
{
    "data": {
        "city": "HN",
        "bounds": {
            "north_east": {
                "lat": 21.05,
                "lng": 105.87
            },
            "south_west": {
                "lat": 21,
                "lng": 105.8
            }
        },
        "markers": [
            {
                "count": 86,
                "latitude": 21.00580596923828,
                "longitude": 105.79437255859376,
                "listing_id": null,
                "project_id": 2191,
                "marker_type": 2,
                "vip_type_id": null,
                "price_display": null
            },
            {
                "count": 49,
                "latitude": 21.004484176635746,
                "longitude": 105.7986297607422,
                "listing_id": null,
                "project_id": 612,
                "marker_type": 2,
                "vip_type_id": null,
                "price_display": null
            }
        ],
        "listing_type": "sale",
        "total_markers": 6
    },
    "meta": {
        "billable": true,
        "endpoint_family": "map_markers"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 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. |
| 503 | Upstream Unavailable | Batdongsan could not be reached or returned data that does not match the request. Retry shortly. This response is not billed. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
