Skip to content

Get All Cities

Get a paginated list of all cities for a specific country. Public endpoint.

Endpoint

GET /v1/accounts/city/?id={country_id}

Authentication

Not required (public endpoint)

Query Parameters

Parameter Type Required Description
id integer Yes Country ID
page integer Yes Page number (starts at 1)
count integer Yes Items per page (max 100)
search string No Search by city name (case-insensitive)

Response

Success (200 OK)

{
  "count": 5,
  "data": [
    {
      "id": 1,
      "name": "Baku",
      "country_id": 1,
      "country": {
        "id": 1,
        "name": "Azerbaijan",
        "created": "2025-01-15T10:30:00Z"
      },
      "created": "2025-01-15T10:30:00Z"
    },
    {
      "id": 2,
      "name": "Ganja",
      "country_id": 1,
      "country": {
        "id": 1,
        "name": "Azerbaijan",
        "created": "2025-01-15T10:30:00Z"
      },
      "created": "2025-01-15T10:30:00Z"
    }
  ]
}

Error Responses

Missing ID Parameter (400)

{
  "message": "Param not send!"
}

Pagination Error (400)

{
  "error": "page cannot be zero or minus"
}

Example Request

curl -X GET "https://api.luxmart.site/v1/accounts/city/?id=1&page=1&count=20&search=baku"

Notes

  • Only returns cities for the specified country
  • Only returns non-deleted cities
  • Search matches against city name
  • Results are ordered by ID descending (newest first)
  • This is a public endpoint, no authentication required