Export raw event data
curl --request GET \
--url https://data.mixpanel.com/api/2.0/exportDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mixpanel/docs/llms.txt
Use this file to discover all available pages before exploring further.
https://data.mixpanel.com/api/2.0/export
yyyy-mm-dd format (inclusive)Interpreted as UTC timezone for projects created after January 1, 2023yyyy-mm-dd format (inclusive)["Signed Up", "Purchase"]false (second precision)gzip to compress the responsecurl "https://data.mixpanel.com/api/2.0/export?from_date=2024-01-01&to_date=2024-01-31" \
-u YOUR_PROJECT_SECRET: \
-H "Accept-Encoding: gzip"
{"event":"Signed Up","properties":{"time":1602611311,"$insert_id":"hpuDqcvpltpCjBsebtxwadtEBDnFAdycabFb","mp_processing_time_ms":1602625711874,"distinct_id":"user123","$email":"user@example.com"}}
{"event":"Purchase","properties":{"time":1602787121,"$insert_id":"jajcebutltmvhbbholfhxtCcycwnBjDtndha","mp_processing_time_ms":1602801521561,"distinct_id":"user123","amount":29.99,"currency":"USD"}}
429 Too Many Requests error.Use compression
headers = {'Accept-Encoding': 'gzip'}
Export in reasonable date ranges
from datetime import datetime, timedelta
start = datetime(2024, 1, 1)
end = datetime(2024, 12, 31)
# Export one month at a time
current = start
while current < end:
next_date = min(current + timedelta(days=30), end)
export_data(current, next_date)
current = next_date
Use Data Pipelines for regular exports
curl --request GET \
--url https://data.mixpanel.com/api/2.0/export