# Sreality Price Histogram API

Return price-distribution buckets for one Sreality listing category.

## Required category

Provide both property type and deal type. Supplying only one can produce an empty answer, so both are required for a meaningful histogram.

## Response

`data.result.histogram` contains the available price buckets and their listing counts. Use listing search for individual properties.

- **Documentation:** [https://scrappa.co/docs/sreality-api/sreality_histogram](https://scrappa.co/docs/sreality-api/sreality_histogram)
- **API group:** Sreality API
- **Endpoint:** `GET https://scrappa.co/api/sreality/histogram`

## 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 |
| --- | --- | --- | --- |
| `property_type` | integer | Yes | Property category identifier from 1 to 5. |
| `deal_type` | integer | Yes | Transaction category identifier from 1 to 4. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/sreality/histogram?property_type=1&deal_type=1"
```

## Example response

```json
{
    "success": true,
    "data": {
        "result": {
            "histogram": [
                {
                    "advert_count": 132,
                    "price_from": 3000000,
                    "price_to": 4000000
                },
                {
                    "advert_count": 97,
                    "price_from": 4000000,
                    "price_to": 5000000
                }
            ]
        }
    },
    "meta": {
        "endpoint_family": "facets",
        "billable": true,
        "retryable": false
    }
}
```

## 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)
