I want to export date from Mix Panel by Api with Python. How could i do it?
Hi Olga Z., 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
You can export data from Mixpanel using the Mixpanel Python module. Here's an example of how you can do it:LBKSimport mputilsLBKSmputils.export_events('event_export.txt',{'from_date':'2016-01-01','to_date':'2016-01-01','event':'["App Install"]'})LBKS
In this example, export_events
is a function that exports raw events and writes them to a file using the export endpoint. You must specify the file, the export params (see here for full list of parameters) and the format (default is JSON). Current supported formats are json or csv. You may also add a timezone_offset which should be the offset from UTC the project is in. This modifies the time property so it is in unix time. You can also specify that you wish to receive the files as gzip from our servers using the add_gzip_header option. This is recommended if you believe the export will be large as it can significantly improve transfer time. You may also specify whether you wish to gzip the data after receiving it using the compress option.You can find more details about this in the Mixpanel Python module documentation.Please note that you need to replace 'event_export.txt'
with the name of the file where you want to store the exported data, and replace '2016-01-01'
with the date range for which you want to export the data. The '["App Install"]'
is the event you want to export, replace it with your desired event.Also, make sure to install the Mixpanel Python module using pip:LBKSpip install mixpanelLBKS
Please let me know if you need further assistance!
kapa.ai is still learning and improving, please let me know how I did by reacting below.
⤵️ Hint: Mention @kapa.ai in the thread for follow-ups.
Let me check the knowledge base for you again. One moment! đź“š
Yes, there are certain limits when it comes to exporting data from Mixpanel:1. Cohort Syncs: Each project is limited to 60 dynamic (recurring) cohort syncs across all destinations. When exporting, each cohort is limited to 10 million users. The exported user data is limited to the following properties: $distinct_id
, $first_name
, $last_name
, $partner_user_id
, $email
, $phone
. If these properties are not present in your project, users might not be matched in the systems (source).2. Data Pipelines: For event export pipelines in each Mixpanel project, Mixpanel supports at most two recurring pipelines and one non-recurring pipeline. Also, from_date
must be no more than 6 months from the date the pipeline is created (source).3. API Rate Limits: The rate limits for different APIs are as follows:
- Ingestion API: 2GB of uncompressed JSON/minute or ~30k events per second, measured on a rolling 1 minute basis.
- Query API: A maximum of 5 concurrent queries and 60 queries per hour.
- Raw Data Export API: A maximum of 100 concurrent queries, 60 queries per hour, and 3 queries per second.
- Lexicon Schemas API: The Lexicon Schemas API imposes an 8mb body size limit and the request cannot take longer than two minutes (source).4. Event Export API: The raw export API has 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 (source).Please ensure to stay within these limits to avoid any disruptions in your data export process.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
⤵️ Hint: Mention @kapa.ai in the thread for follow-ups.