Skip to main content
GET
/
api
/
2.0
/
export
Event Export
curl --request GET \
  --url https://data.mixpanel.com/api/2.0/export

Raw Event Export

Export raw event data as JSON for custom processing and analysis.

Base URL

https://data.mixpanel.com/api/2.0/export

Authentication

Use Project Secret with HTTP Basic Auth.

Download Data

Export events within a date range.
project_id
integer
Required when using service account authentication
from_date
string
required
Start date in yyyy-mm-dd format (inclusive)Interpreted as UTC timezone for projects created after January 1, 2023
to_date
string
required
End date in yyyy-mm-dd format (inclusive)
limit
integer
Maximum number of events to return (max: 100,000)
event
string
Event name(s) to export, encoded as JSON arrayExample: ["Signed Up", "Purchase"]
where
string
Expression to filter events
time_in_ms
boolean
Export timestamps with millisecond precisionDefault: false (second precision)
Accept-Encoding
string
Set to gzip to compress the response

Example Request

curl "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"

Response

Returns newline-delimited JSON (JSONL):
{"event":"Signed Up","properties":{"time":1602611311,"$insert_id":"hpuDqcvpltpCjBsebtxwadtEBDnFAdycabFb","mp_processing_time_ms":1602625711874,"distinct_id":"user123","$email":"[email protected]"}}
{"event":"Purchase","properties":{"time":1602787121,"$insert_id":"jajcebutltmvhbbholfhxtCcycwnBjDtndha","mp_processing_time_ms":1602801521561,"distinct_id":"user123","amount":29.99,"currency":"USD"}}

Rate Limits

The Export API has strict rate limits:
  • 60 queries per hour
  • 3 queries per second
  • 100 concurrent queries maximum
Exceeding these limits returns a 429 Too Many Requests error.

Best Practices

Always request gzip compression for large exports:
headers = {'Accept-Encoding': 'gzip'}
Split large exports into smaller chunks:
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
For scheduled exports, use Data Pipelines instead of polling the Export API.

Build docs developers (and LLMs) love