// aggregations/bucket/datehistogram-aggregation.asciidoc:214

[source, php]
----
$params = [
    'index' => 'sales',
    'body' => [
        'aggs' => [
            'sales_over_time' => [
                'date_histogram' => [
                    'field' => 'date',
                    'fixed_interval' => '30d',
                ],
            ],
        ],
    ],
];
$response = $client->search($params);
----
