// This file is autogenerated, DO NOT EDIT
// aggregations/pipeline/percentiles-bucket-aggregation.asciidoc:43

[source, python]
----
resp = client.search(
    index="sales",
    size=0,
    aggs={
        "sales_per_month": {
            "date_histogram": {
                "field": "date",
                "calendar_interval": "month"
            },
            "aggs": {
                "sales": {
                    "sum": {
                        "field": "price"
                    }
                }
            }
        },
        "percentiles_monthly_sales": {
            "percentiles_bucket": {
                "buckets_path": "sales_per_month>sales",
                "percents": [
                    25,
                    50,
                    75
                ]
            }
        }
    },
)
print(resp)
----
