If you ever need help, please email us at support@mixpanel.com
Back to topics

Exporting raw data you inserted into Mixpanel

Updated May 21, 2015

What is this API?

Every time a user does an action or event you log that event to us. This export API will allow you to download a complete stream of that information in nearly the precise way you inserted it. This is a dump of your data in its aggregate form and much more fine grained down to the specific user and the second they did an action. Note: the Raw Data Export API is not real-time, every day at midnight (according to your project's time zone) the export for the previous day starts to become available. Generally, the complete data set for the previous day will be available around 6am project time.

Requirements before using this API

Note: The specific end point for /export differs from that of our main API. This means all the same API authentication is the same. You can also utilize the same client libraries but you will, for the time being, have to change the end point to data.mixpanel.com instead of just mixpanel.com. Most libraries will automatically assume it gets a JSON string back and attempt to decode it. This specific API does not provide valid JSON in aggregate but does per row so be aware if you receive a decoding error.

Useful examples of using this API

  • If you receive a spike of 10K events but notice that only a few users contributed to it and would like to dive deeper into the data.
  • If you are buying mobile ads and would like to dive deeper into the exact UDIDs and see who you really can attribute to the install.
  • If your boss does not believe Mixpanel and wants absolute proof!
  • If you are doing some very custom analysis Mixpanel cannot currently do. If this is the case, please email support@mixpanel.com so we can either improve our product or possibly show you how you can do it with us.

Method: export

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

Please note: The URI is data.mixpanel.com and not just mixpanel.com


Get a "raw dump" of tracked events over a time period.


Required Name Type Description
required from_date string

The date in yyyy-mm-dd format from which to begin querying for the event from. This date is inclusive.

required to_date string

The date in yyyy-mm-dd format from which to stop querying for the event from. This date is inclusive.

optional event array

The event or events that you wish to get data for, encoded as a JSON array.

Example format: '["play song", "log in", "add playlist"]'

optional where string

An expression to filter events by. See the expression section on the main data export API page.

optional bucket string

[Platform] - the specific data bucket you would like to query.

Example URL


Return format

{"event":"Viewed report","properties":{"distinct_id":"foo","time":1329263748,"origin":"invite",
"$browser":"Chrome","Project ID":"3","mp_country_code":"US"}}

One event per line, sorted by increasing timestamp. Each line is a JSON dict, but the file itself is not valid JSON because there is no enclosing object. Timestamps are in project time but expressed as Unix time codes (though from_date and to_date need to be in UTC).

For any non-UTC timezone project, exports will return partial data for a given date as explained here due to the offset between your project timezone and UTC. It is recommended that, if you plan to use the raw data dump as an integral part of your workflow, you set your project times to UTC. This has been found useful by users who display exported events in various time zones. If you prefer to keep a project in a non-UTC timezone then be aware that (as previously mentioned) from_date and to_date must be expressed in UTC.

Please let us know if you are interested in other return formats.