How to get the number of users belonging to a cohort at a given date ?
There are a couple of approaches to get the number of users in a cohort at a given date in Mixpanel:
1. Visualize Cohort Size Over Time in Insights
In the Insights report, you can select a cohort from the Events and Cohorts menu. This generates a line chart showing the size of the cohort over time, where each point represents the cohort size at the end of that time interval. [Cohorts in Analysis]
2. Use the /cohorts/list API to Get Current Count
The POST /cohorts/list endpoint returns all cohorts in a project, including the count of users currently in each cohort. However, this reflects the current count, not a historical one. [List Saved Cohorts]
3. Use the /engage API to Query Users in a Cohort
To retrieve the actual list of users belonging to a specific cohort, use the POST /engage endpoint with the filter_by_cohort parameter:
filter_by_cohort='{"id": <cohort_id>}'This returns the profiles of users currently in the cohort. [Query Profiles]
Important Caveat on Historical Dates
It's important to note that cohorts are computed dynamically at query time — they reflect who is currently in the cohort, not who was in it at a past date. [How Cohorts are Computed] If you need the cohort size at a specific historical date, the Insights report (option 1 above) is the most practical approach, as it charts cohort size over time and lets you inspect past data points visually.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
