---
title: "Paginated patients or operators per city"
method: GET
path: "/api/analytics/map"
tags: ["analytics"]
---

# Paginated patients or operators per city

`GET /api/analytics/map`

Returns paginated counts per city from view_cities_patients (type=patients) or view_cities_operators (type=operators).

## Query parameters

- `type` 'patients' | 'operators', required — Analytics cities view type: which view to query (patients or operators per city).
- `per_page` integer — Page size.
- `page` integer — Page number (1-based).

## Response `200`

Successful Response

- CitiesAggregateResponse — Paginated cities aggregate response model.
  - `items` CityRow[], required — Paginated city rows, ordered by count descending
    - `city` string, required — City name (from cities table or user/operator free text)
    - `latitude` string, nullable — Latitude when city matches cities table
    - `longitude` string, nullable — Longitude when city matches cities table
    - `count` integer, required — Number of patients or operators in this city
  - `total` integer, required — Total number of city rows before pagination
  - `per_page` integer, required — Page size
  - `page` integer, required — Page number (1-based)

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/corabea/apis/corabea-api.md) · [All operations](https://skmtc.dev/corabea/apis/corabea-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/corabea/corabea-api/revisions/13c1bce1bdc4/schema)
