How do I export my Mixpanel raw data?
Hi Brieuc P., 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 your Mixpanel raw data, you have a few options:1. Event Export API: You can use the Raw Event Export API to download your event data as JSON. This method is recommended for high volume exports. Here's an example request:LBKScurl --request GET \ --url '[https://data.mixpanel.com/api/2.0/export?from_date=2024-07-23&to_date=2024-07-24&limit=100&event=sample_event](https://data.mixpanel.com/api/2.0/export?from_date=2024-07-23&to_date=2024-07-24&limit=100&event=sample_event)' \ --header 'accept: text/plain' \ --header 'authorization: Basic YOUR_TOKEN'LBKS
The response will be in JSONL format, with each line representing a valid JSON object for an event Export Methods.2. CSV Events Export: For smaller batches of events, you can export as a CSV directly from the Mixpanel UI. Navigate to the Events tab, query the events you're interested in, and click the "Export" button in the top right corner Export Methods.3. Data Pipelines: If you need continuous export of your raw data, you can set up Data Pipelines. This feature allows you to export data to cloud storage services like AWS S3, Google Cloud Storage, or Azure Blob Storage. You'll need to configure your destination and then create a pipeline using the Data Pipelines API Data Pipelines Overview.4. Python Utility: For programmatic access, you can use the MixpanelUtils
Python module. Here's an example of how to export events:LBKSmputils = MixpanelUtils( 'ServiceAccountSecretHere', token='ProjectTokenHere', service_account_username='my-user.12345.mp-service-account', project_id=1695321, )LBKSmputils.export_events('event_export.txt', {'from_date':'2016-01-01','to_date':'2016-01-01','event':'["App Install"]'})LBKS
Mixpanel-utils ModuleChoose the method that best fits your needs based on the volume of data you're exporting and how frequently you need to perform the export.
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 data from Mixpanel, you need to have the appropriate level of access. Based on the information provided in the knowledge sources, here are the key points regarding access levels for data export:1. Authentication Methods: - For the Event Export API, you can use either Service Account authentication or Project Secret authentication Raw Data Export API Authentication.2. Service Account Authentication: - This is the preferred method for the Raw Data Export API. - You must specify the project_id as a query parameter when using this method. - For projects with classified data, the Service Account must have permission to access classified data Raw Data Export API Authentication.3. Project Secret Authentication: - This method is being deprecated but is still available Raw Data Export API Authentication.4. User Roles: - Only organization owners and admins can access or submit end user export or deletion requests End User Data Management.5. OAuth Token: - For certain requests, you need to generate a GDPR OAuth token from your Personal Settings. - Users are eligible to generate an OAuth token if they are the Project Owner, or if they are a Project Owner or Admin of a project that supports team member roles End User Data Management.If you're encountering a 400: authentication error, it could be due to one of the following reasons:1. You're not using the correct authentication method (Service Account or Project Secret). 2. You don't have the necessary permissions (you need to be an organization owner or admin). 3. Your authentication token or credentials are incorrect or have expired.To resolve this issue, I recommend:1. Verify that you're using the correct authentication method and credentials. 2. Ensure that you have the necessary permissions in your Mixpanel project. 3. If using Service Account authentication, make sure you're including the project_id in your request. 4. If the issue persists, you may need to contact your Mixpanel project administrator to verify your access levels or regenerate your authentication credentials.
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! đ
I understand you're encountering an issue with the Mixpanel Export API where you're receiving a file containing only "terminated early". This is not a typical response from the API, and it suggests there might be a problem with your export request or the data being exported. Let's explore some possible reasons and solutions:1. Rate Limiting:
The Raw Export API has specific rate limits. According to the Export API documentation, there's "a rate limit of 60 queries per hour, 3 queries per second, and a maximum of 100 concurrent queries. If you exceed the rate limit, a 429 error will be returned." While this doesn't directly explain the "terminated early" message, it's possible that repeated rate limit violations could lead to early termination.2. Export Size:
If you're trying to export a very large amount of data, it's possible that the export is timing out or being terminated due to size constraints. The Export API documentation mentions a limit
parameter that can be used to restrict the number of events returned. You might try setting this to a lower value to see if it resolves the issue.3. Date Range:
Ensure that your from_date
and to_date
parameters are correctly set and don't span an excessively large time range. The Export Methods documentation notes that for projects created before 1 January 2023, these parameters are interpreted using your current project timezone, while for newer projects, they use UTC.4. Event Selection:
If you're specifying particular events to export, make sure these events exist in your project for the time range you've specified.5. API Endpoint:
Verify that you're using the correct API endpoint for your project's data residency. The Mixpanel APIs Overview lists different endpoints for Standard, EU, and India residency servers.To troubleshoot this issue, I recommend:1. Try exporting a smaller date range or limiting the number of events.
2. Double-check your authentication and ensure you have the correct permissions.
3. Verify that you're not exceeding the rate limits.
4. If possible, try the export through the Mixpanel UI to see if you encounter the same issue.If the problem persists after trying these steps, it would be best to contact Mixpanel support directly, as the "terminated early" message is not a standard API response documented in the knowledge sources provided. They would be able to investigate your specific account and export request to determine the root cause of this unusual behavior.
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.