This document walks you through making a basic request to the Places Aggregate API
and understanding the response, which includes a count of matching places.

[Try it!](https://developers.google.com/maps/documentation/places-aggregate/make-your-first-request.md.txt#try-it)

To use Places Aggregate API, send an HTTP POST request to the `computeInsights`
endpoint as follows:

```bash
https://areainsights.googleapis.com/v1:computeInsights
```

Refine your [request](https://developers.google.com/maps/documentation/places-aggregate/reference/rest/v1/TopLevel/computeInsights.md.txt#request-body) by providing region and type parameters in the JSON
body. This example shows a request to return the count of restaurants in San
Francisco that are operational, moderately priced, and rated between 4 and 5
stars.

```bash
curl --location 'https://areainsights.googleapis.com/v1:computeInsights' \
--header 'X-Goog-Api-Key: API_KEY' \
--header 'Content-Type: application/json' \
--data '{
   "insights":[
      "INSIGHT_COUNT"
   ],
   "filter":{
      "locationFilter":{
         "region":{
            "place":"places/ChIJIQBpAG2ahYAR_6128GcTUEo"
         }
      },
      "typeFilter":{
         "includedTypes":[
            "restaurant"
         ]
      },
      "operatingStatus":[
         "OPERATING_STATUS_OPERATIONAL"
      ],
      "priceLevels":[
         "PRICE_LEVEL_INEXPENSIVE"
      ],
      "ratingFilter":{
         "minRating":4.0,
         "maxRating":5.0
      }
   }
}'
```

## Places Aggregate API response

The following response from the example request above shows the count
of restaurants that match the criteria.

```json
{
  "count": "850"
}
```

## Try it!

The API Explorer lets you make sample requests so
that you can get familiar with the API and the API options.

1. Select the API icon, ![Expand the API Explorer.](https://developers.google.com/static/maps/documentation/images/api-explorer-icon.png), on the right side of the page.
2. Optionally expand **Show standard parameters** to set any parameters.
3. Optionally edit the **Request body**.
4. Select **Execute** button. In the dialog, choose the account that you want to use to make the request.
5. In the API Explorer panel, select the expand icon,
   ![Expand the API Explorer.](https://developers.google.com/static/maps/documentation/images/api-explorer-expand.png), to expand the API Explorer window.

## What's next

- Explore more [examples](https://developers.google.com/maps/documentation/places-aggregate/example-requests.md.txt) of what you can achieve with Places Aggregate API.
- Look at the [request parameters](https://developers.google.com/maps/documentation/places-aggregate/request-parameters.md.txt) in more detail.
- View the full [API documentation](https://developers.google.com/maps/documentation/places-aggregate/reference/rest.md.txt).