Analytics
Bearer Token
Mixpanel REST API
Product analytics API for tracking user behavior
Mixpanel provides product analytics that help teams understand user behavior and make data-driven decisions. The REST API allows developers to track events, update user profiles, query analytics data, and manage cohorts programmatically. Used by thousands of companies to build better products through behavioral analytics and experimentation.
Base URL
https://api.mixpanel.com
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /track | Track a single event for a user or anonymous visitor |
| POST | /import | Import historical events with custom timestamps |
| POST | /engage | Set or update properties on a user profile |
| POST | /groups | Create or update group profiles for group analytics |
| GET | /query/insights | Query insights report data including trends and funnels |
| GET | /query/events | Retrieve raw event data with filters and date ranges |
| GET | /query/funnels | Get funnel conversion data for specified event sequences |
| GET | /query/retention | Query retention cohort data for user segments |
| POST | /cohorts | Create a new cohort based on user properties or behaviors |
| GET | /cohorts/list | List all cohorts in the project with metadata |
| GET | /engage/properties | Retrieve user profile properties for specific users |
| DELETE | /events/delete | Delete events matching specified criteria |
| GET | /query/segmentation | Get segmentation report data with breakdowns |
| POST | /lookup-tables | Upload or update lookup table data for enrichment |
| GET | /events/properties/top | Get top property values for a specific event |
Code Examples
# Track an event
curl -X POST https://api.mixpanel.com/track \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-d '{
"event": "Page Viewed",
"properties": {
"distinct_id": "user_12345",
"page_name": "Dashboard",
"time": 1704067200,
"$insert_id": "evt_abc123"
}
}'
# Query insights data
curl -X GET 'https://api.mixpanel.com/query/insights?project_id=YOUR_PROJECT_ID&from_date=2024-01-01&to_date=2024-01-31' \
-H 'Authorization: Bearer YOUR_API_TOKEN'
Connect Mixpanel to AI
Deploy a Mixpanel MCP server on IOX Cloud and connect it to Claude, ChatGPT, Cursor, or any AI client. Your AI assistant gets direct access to Mixpanel through these tools:
track_user_event
Track custom events for users with properties and metadata for behavioral analysis
update_user_profile
Set or increment user profile properties including demographics and custom attributes
query_analytics_insights
Retrieve analytics insights including trends, funnels, and retention data for specified date ranges
manage_cohorts
Create, update, or retrieve user cohorts based on behavioral criteria and property filters
export_event_data
Export raw event data with filters for analysis or integration with other systems
Deploy in 60 seconds
Describe what you need, AI generates the code, and IOX deploys it globally.
Deploy Mixpanel MCP Server →