How can I export thousands of events?
Hi Elise S., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> 👋
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
To export thousands (or more) events from Mixpanel, use one of the high‑volume export options rather than UI CSV export:
1. Raw Event Export API (all plans, no extra cost) Use the Raw Event Export API, which returns events as JSONL (one JSON object per line) and is designed for large volumes. [Export methods; Export API spec]
Basic example:
curl --request GET \
--url '[https://data.mixpanel.com/api/2.0/export?from_date=2024-07-23&to_date=2024-07-24&limit=100000](https://data.mixpanel.com/api/2.0/export?from_date=2024-07-23&to_date=2024-07-24&limit=100000)' \
--header 'accept: text/plain' \
--header 'authorization: Basic YOUR_TOKEN'
Key points:
- from_date / to_date are required (YYYY-MM-DD).
- Optional filters: event (JSON array of event names), where (expression), limit (max 100,000). [Export API spec]
- Response is JSONL, suitable for streaming/processing large files. [Export methods]
- Rate limits: 60 queries/hour, 3 queries/second, max 100 concurrent queries. [Export API spec]
2. Mixpanel-utils helper (Python)
The open-source mixpanel-utils module wraps the Export API and can write large exports directly to a file. [mixpanel-utils README]
Example:
from mixpanel_utils import MixpanelUtils
mputils = MixpanelUtils(
'ServiceAccountSecretHere',
token='ProjectTokenHere',
service_account_username='my-user.12345.mp-service-account',
project_id=1695321,
)
mputils.export_events(
'event_export.json',
{'from_date': '2024-01-01', 'to_date': '2024-01-31'}
)
This uses the raw export endpoint and handles writing to disk, gzip options, etc. [mixpanel-utils README]
3. Data Pipelines (Growth/Enterprise add‑on) If you need continuous, automated export of all events (not just a one‑off), enable Data Pipelines to send data to cloud storage (S3, GCS, Azure Blob) or a warehouse (BigQuery, Snowflake, Redshift). [Data Pipelines overview] - JSON Pipelines export events as JSON files to storage, partitioned by date. [Data Pipelines overview] - Best if you want ongoing sync rather than manual pulls.
4. UI CSV export (for smaller slices)
From the Events tab you can export visible events as CSV, but this is intended for smaller batches and is limited by what’s loaded in the table, not ideal for “thousands+” across long ranges. [Export methods]
If you describe your volume (e.g., date range and approximate event count) and destination (file vs warehouse), I can suggest the most appropriate of these and a more specific call.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! 📚
To export ~10k events into a file, the most straightforward options are:
1. Use the Raw Event Export API (all plans)
This API is designed for high‑volume exports and returns JSONL (one JSON object per line). [Export methods; Raw export spec]
Basic cURL example (writes to a file):
```
curl --request GET --url 'https://data.mixpanel.com/api/2.0/export?from_date=2024-01-01&to_date=2024-01-02&limit=10000' --header 'accept: text/plain' --header 'authorization: Basic YOUR_AUTH' -o events.jsonl
LBKSKey points: [[Raw export spec](https://github.com/mixpanel/docs/blob/main/openapi/src/export.openapi.yaml); [Export methods](https://docs.mixpanel.com/docs/export-methods)]
- `from_date` and `to_date` are required (`YYYY-MM-DD`).
- `limit` can be up to 100,000; 10,000 is fine.
- Optional filters:
- `event` (JSON array of event names).
- `where` (expression filter).
- Response format: JSONL (newline‑delimited JSON).
- Rate limits: 60 queries/hour, 3 queries/second, 100 concurrent queries.
Example without filters (all events in range): [[Project migration guide](https://docs.mixpanel.com/guides/strategic-playbooks/project-migration#step-3-export-existing-data)]
LBKS```
curl --request GET \
--url '[https://data.mixpanel.com/api/2.0/export?project_id=<YOUR_PROJECT_ID](https://data.mixpanel.com/api/2.0/export?project_id=<YOUR_PROJECT_ID) &from_date=2024-01-01&to_date=2024-01-02>' \
--header 'accept: text/plain' \
--header 'authorization: Basic YOUR_AUTH' \
-o events.jsonl
---
2. Use the Mixpanel-utils Python helper (wraps the same API)
If you prefer Python, mixpanel-utils can call the Export API and write directly to a file. [mixpanel-utils README]
```
from mixpanel_utils import MixpanelUtils
mputils = MixpanelUtils( 'ServiceAccountSecretHere', token='ProjectTokenHere', service_account_username='my-user.12345.mp-service-account', project_id=123456, )
mputils.export_events( 'events_10k.json', {'from_date': '2024-01-01', 'to_date': '2024-01-02', 'limit': 10000} )
LBKSThis will export raw events and write them to `events_10k.json`. [[mixpanel-utils README](https://github.com/mixpanel/mixpanel-utils/blob/master/README.md)]
---
If you tell me your desired date range and whether you want specific event names or all events, I can give you the exact URL/command you should run.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
