Dukan icon

Dukan

Interact with the Dukan API

City Or Municipality → Get Many Cities by Location

AI-generated

Summary

Retrieve multiple cities associated with a specific location by providing the location's ID. Supports pagination, filtering, sorting, selecting specific fields, and populating related fields.

Inputs

  • Location ID (required) — The ID of the location to get the cities for.
  • Page Number — Page number of results to retrieve; defaults to 1.
  • Limit — Maximum number of results to return per page; defaults to 50.
  • Offset — Number of records to skip before starting to return results; defaults to 0.
  • Sort — Fields to sort the results by, e.g., "name -createdAt"; defaults to "-createdAt".
  • Filter — A JSON string representing a MongoDB filter query to limit results; defaults to an empty filter ({}).
  • Select Fields — Space separated field names to include in the results.
  • Populate Fields — Space separated related fields to populate in the results.
  • Force Custom Auth Header — Whether to use a custom API key from this node instead of the configured Dukan credentials.
  • Custom API Key — API key to use if Force Custom Auth Header is enabled.
  • Force Custom Base URL — Whether to use a custom Base URL from this node instead of the Base URL in the credentials.
  • Custom Base URL — Base URL to use for API requests, without the /v1/external suffix, if Force Custom Base URL is enabled.

Output shape

a list of city records with fields as specified by select and populate options

Results are paginated according to page, limit, and offset parameters. Filtering, sorting, field selection, and population affect the returned data structure accordingly.

Links

Discussion