> ## Documentation Index
> Fetch the complete documentation index at: https://docs.melo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Cities

> This endpoint returns cities matching the given criteria.

### Query parameters

<ParamField query="excludeGroupedCities" type="boolean" default="false">
  Set to true to exclude cities that have grouped cities under them.
  Example: `excludeGroupedCities=true`
</ParamField>

<ParamField query="insee" type="string">
  Filter by INSEE code.
</ParamField>

<ParamField query="insee[]" type="array of strings">
  Filter by multiple INSEE codes.
</ParamField>

<ParamField query="polygon" type="string">
  Filter by cities inside a given polygon defined by GPS coordinates.
  Example: `polygon=polygon[0][lat]=43.12&polygon[0][lon]=5.93&polygon[1][lat]=43.12&polygon[1][lon]=6.01&polygon[2][lat]=43.07&polygon[2][lon]=6.01&polygon[3][lat]=43.07&polygon[3][lon]=5.93`
</ParamField>

<ParamField query="libelle" type="string">
  Filter by city label/display name.
</ParamField>

<ParamField query="name" type="string">
  Filter by city name.
</ParamField>

<ParamField query="order[name]" type="string" default="asc">
  Sort by name.
  Enum: `"asc"` `"desc"`
</ParamField>

<ParamField query="page" type="integer" default="1">
  The collection page number.
</ParamField>

<ParamField query="slug" type="string">
  Filter by city slug.
</ParamField>

<ParamField query="zipcode" type="string">
  Filter by zipcode.
</ParamField>

<ParamField query="zipcode[]" type="array of strings">
  Filter by multiple zipcodes.
</ParamField>

<RequestExample>
  ```bash Example Request theme={null}
  curl --location -g --request GET 'https://api.stream.estate/cities' \
  --header 'Content-Type: application/json'
  --header 'X-API-KEY:'
  ```
</RequestExample>

<ResponseExample>
  ```json Example Response theme={null}
  {
    "hydra:member": [
      {
              "@id": "/cities/1",
              "@type": "City",
              "zipcode": "01500",
              "insee": "01004",
              "article": "",
              "name": "Ambérieu-en-Bugey",
              "libelle": "AMBERIEU EN BUGEY",
              "department": "/departments/1",
              "cityParent": {
                  "@id": "/cities/37152",
                  "@type": "City",
                  "zipcode": "01500",
                  "insee": "01004",
                  "article": "",
                  "name": null,
                  "libelle": null
              },
              "originalName": "Ambérieu-en-Bugey"
          },
          {
              "@id": "/cities/2",
              "@type": "City",
              "zipcode": "01330",
              "insee": "01005",
              "article": "",
              "name": "Ambérieux-en-Dombes",
              "libelle": "AMBERIEUX EN DOMBES",
              "department": "/departments/1",
              "cityParent": {
                  "@id": "/cities/37153",
                  "@type": "City",
                  "zipcode": "01330",
                  "insee": "01005",
                  "article": "",
                  "name": null,
                  "libelle": null
              },
              "originalName": "Ambérieux-en-Dombes"
          }
    ]
  }
  ```
</ResponseExample>
