Skip to content

Get distinct business cities

Request

Get the distinct list of cities that have at least one business, for populating city filter options. Project API key users get cities of active, approved businesses only. Admin users get full access with query parameters.

Security
authJWT or projectKey
Query
activestring

Filter by active status (admin only for inactive)

countryCodestring

Filter by country code (ISO 3166-1 alpha-2, e.g., QA, US)

countrystring

Filter by country name (case-insensitive)

businessTypeIdnumber

Filter by business type ID

approvalStatusstring

Filter by approval status (admin only)

Enum:"pending_approval""approved""rejected"
curl -i -X GET \
  'https://docs.pers.ninja/_mock/swagger/businesses/cities?active=string&countryCode=string&country=string&businessTypeId=0&approvalStatus=pending_approval' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Cities found

Bodyapplication/json
Array [
citystringrequired

City name

countrystring or nullrequired

Country name

countryCodestring or nullrequired

ISO 3166-1 alpha-2 country code (e.g., QA, US)

]
Response
[ { "city": "string", "country": "string", "countryCode": "string" } ]