// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/histogram-aggregation.asciidoc:164

[source, python]
----
resp = client.search(
    index="sales",
    size="0",
    query={
        "constant_score": {
            "filter": {
                "range": {
                    "price": {
                        "lte": "500"
                    }
                }
            }
        }
    },
    aggs={
        "prices": {
            "histogram": {
                "field": "price",
                "interval": 50,
                "extended_bounds": {
                    "min": 0,
                    "max": 500
                }
            }
        }
    },
)
print(resp)
----
