Query API
The Query API allows you to retrieve data from your Mixpanel reports programmatically. Query the same data you see in the Mixpanel UI to build custom dashboards, exports, and integrations.Base URL
https://eu.mixpanel.com/api/query
For India data residency: https://in.mixpanel.com/api/query
Authentication
Use Service Account credentials with HTTP Basic Auth:Rate Limits
Available Endpoints
Insights
Query saved Insights reports to get event counts and trends. View Insights Documentation →Funnels
Retrieve funnel analysis data including conversion rates and drop-off points. View Funnels Documentation →Retention
Query retention data for cohort and frequency analysis. View Retention Documentation →Cohorts
List cohorts and retrieve cohort membership information. View Cohorts Documentation →Common Parameters
Most Query API endpoints accept these common parameters:integer
required
Your Mixpanel project ID
integer
The workspace ID (optional, for workspace-specific queries)
string
Start date in
YYYY-MM-DD formatstring
End date in
YYYY-MM-DD formatResponse Format
All Query API responses follow a consistent structure:Best Practices
Cache query results
Cache query results
Since the Query API has low rate limits, cache results on your side:
Use saved reports
Use saved reports
Query saved reports (Insights, Funnels) rather than building queries from scratch. This ensures consistency with the UI and better performance.
Query during off-peak hours
Query during off-peak hours
For large exports or heavy queries, schedule them during off-peak hours to minimize impact on rate limits.
Monitor your query quota
Monitor your query quota
Track your query usage to avoid hitting rate limits:
Error Handling
Finding Report IDs
Insights Report ID (bookmark_id)
- Open your Insights report in Mixpanel
- Look at the URL:
- The
BOOKMARK_IDis the number afterreport-
Funnel ID
- Open your Funnel report
- Use the List Funnels endpoint to get all funnel IDs:
Workspace ID
- Open any report in your workspace
- Check the URL for the workspace ID:
Common Use Cases
Custom Dashboard
Automated Reports
Next Steps
Insights
Query event trends and metrics
Funnels
Analyze conversion funnels
Retention
Measure user retention
Cohorts
Work with user cohorts