Skip to navigation

🏙️ Get All Cities

Retrieve all cities with optional filters and pagination

Returns a list of cities from the database. Supports filtering by active status, country name, country code, and pagination.

Query Parameters

  • active (optional): Filter by active status - “true” or “false”
  • country (optional): Filter by country name (partial match, case-insensitive)
  • countryCode (optional): Filter by ISO country code (e.g., “AE”, “US”)
  • limit (optional): Maximum number of results to return (default: 100)
  • offset (optional): Number of results to skip for pagination (default: 0)

Response

Returns an object with:

  • success: Boolean indicating success
  • data: Array of city objects
  • count: Number of cities returned

Examples

GET /cities?active=true
GET /cities?country=United%20Arab%20Emirates
GET /cities?countryCode=AE&limit=10&offset=0

Query parameters

activestring or booleanOptional

Filter by active status (true/false)

countrystringOptional
Filter by country name
countryCodestringOptional

Filter by ISO country code (e.g., ‘AE’, ‘US’)

limitstringOptional
Limit number of results
offsetstringOptional
Offset for pagination

Response

This endpoint returns an object.