# realestate.co.nz Facets API Documentation

Count listings for sale or rent by property type, district, category and price range, optionally inside a region, district or suburb. Use it to build filters or market overviews without paging through results.

- **Documentation:** [https://scrappa.co/docs/realestate-co-nz-api/realestate_co_nz_facets](https://scrappa.co/docs/realestate-co-nz-api/realestate_co_nz_facets)
- **API group:** realestate.co.nz API
- **Endpoint:** `GET https://scrappa.co/api/realestate-co-nz/facets`

## 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 |
| --- | --- | --- | --- |
| `type` | string | Yes | sale or rent. |
| `region` | string | No | Region ids separated by commas, e.g. 35. |
| `district` | string | No | District ids separated by commas. |
| `suburb` | string | No | Suburb ids separated by commas. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/realestate-co-nz/facets?type=sale&region=35"
```

## Example response

```json
{
    "success": true,
    "data": {
        "total_count": 16708,
        "property_types": [
            {
                "key": "House",
                "count": 9704
            },
            {
                "key": "Townhouse",
                "count": 2638
            }
        ],
        "districts": [
            {
                "key": "Manukau City",
                "count": 3532
            },
            {
                "key": "Auckland City",
                "count": 3525
            }
        ],
        "categories": [
            {
                "key": "res_sale",
                "count": 16494
            },
            {
                "key": "rural_sale",
                "count": 214
            }
        ],
        "price_ranges": [
            {
                "min": 0,
                "max": 49999,
                "count": 11
            },
            {
                "min": 50000,
                "max": 99999,
                "count": 41
            }
        ]
    },
    "meta": {
        "endpoint_family": "facets",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
|  | Error | page times rows is above 10000. Narrow the search. Not billed. |
|  | Error | The listing, agent or office does not exist. Not billed. |
|  | Error | realestate.co.nz could not be reached. Not billed. |
|  | Error | realestate.co.nz refused the request. Not billed. |
|  | Error | The upstream service is temporarily unavailable. Please retry shortly. |
|  | Error | realestate.co.nz returned an unexpected payload shape. Not billed. |
|  | Error | realestate.co.nz rejected the request parameters. 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)
