Export Raw Data

Contents: [ Authentication , Client Libraries , API Details , Export API Reference ]
[Required Parameter, Authorization Steps, Example, Example Usage, NOTE , Return Format:]

Visit the Dev Docs

A better version of this page exists at https://developer.mixpanel.com/docs/exporting-raw-data.

Every data point sent to Mixpanel is stored as JSON in our data store. The raw export API allows you to download your event data as it is received and stored within Mixpanel, complete with all event properties (including distinct_id) and the exact timestamp the event was fired.

Mixpanel timestamps stores are formatted like unix timestamps, but are actually the result of offsetting the unix timestamp based on project timezone at time of ingestion.


In order to ensure the security of your data, the Mixpanel API requires authentication.

Required Parameter

api_secret - This can be found by clicking on the settings gear in the upper righthand corner and selecting Project Settings.

Authorization Steps

The Data Export API accepts basic access authentication over HTTPS as an authorization method.

To make an authorized request, put your project's API Secret in the "username" field of the Basic access authentication header. Make sure you use HTTPS and not HTTP - as our API rejects requests made over HTTP. Sending over HTTP can expose your API Secret.


#Replace API_SECRET with your projects API secret
curl https://data.mixpanel.com/api/2.0/export/ \
    -u API_SECRET: \
    #Additional Parameters

Client Libraries

Install the mixpanel-api module to easily accomplish common tasks such as event and user profile exports.

You can utilize the same client libraries that are in the formatted data export API documentation, but you will have to change the endpoint to data.mixpanel.com instead of just mixpanel.com.

API Details

  • Due to client-side queueing, offline iOS and Android data may take up to 5 days to enter the raw data store.

  • For this API, returned timestamps are expressed in seconds since January 1, 1970 in your project's timezone, not UTC. This means that converting the raw exported timestamps using many epoch converters will result in incorrect offsets, as generally epoch timestamps are assumed to be in UTC.
    You must add back the offset between project time and UTC before storing or processing the data. For example, if your project is set to Pacific time, you would need to add 7 hours (or 8 hours if not in daylights savings time) (60 min 60 secs 7 hours) to the timestamp in order to convert this timestamp into UTC.

  • This endpoint uses gzip to compress the transfer; as a result, raw exports should not be processed until the file is received in its entirety. While this process is normally quick and results in a smaller file size, some large exports can take a few minutes to generate. Ensure the timeout set on the receiving client is large enough to account for this process (e.g. larger than 60 seconds).

  • Data returned from this endpoint is JSONL (newline-delimited JSON). Most receiving client libraries will accept JSON formatted requests. The Mixpanel Export API does not return valid JSON in aggregate, but each row is valid JSON within the API's output. Raw exports, once received in full, should be parsed line-by-line instead of as an array of JSON objects.

Example Usage

  • If you receive a spike of 10K events but notice that only a few users contributed to it and would like to compare the data to another source.

  • If you are exporting events from one project and importing them into another.

  • If you are doing some very custom analysis Mixpanel cannot currently do. If this is the case, please contact support so we can either improve our product or possibly show you how you can perform this analysis within Mixpanel.

Export API Reference

Returns a "raw data dump" of tracked events over a time period.

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


The URI is data.mixpanel.com and not just mixpanel.com.




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



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



The event or events that you wish to get data for, encoded as a JSON array. Example format: '["play song", "log in", "add playlist"]'



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

#Replace API_SECRET with your projects API secret
curl https://data.mixpanel.com/api/2.0/export/ \
    -u API_SECRET: \
    -d from_date="2018-02-11" \
    -d to_date="2018-02-11" \
    -d event='["Viewed report"]' \
    -d where="properties["$os"]=="Linux""
// Expected Return
  "event": "Viewed report",
    "properties": {
        "distinct_id": "foo",
        "time": 1518314400,
        "$os": "Linux",
        "$browser": "Chrome",
        "Project ID": "3",
        "mp_country_code": "US"

Return Format:

The return format is one event per line. Each line is a valid JSON object, but the full return itself is JSONL.

Did this answer your question?



Please sign in to leave a comment.