How can I export my people profiles into a CSV?

People profiles currently cannot be exported via the Mixpanel UI; however, you can easily export your people profiles either:

  1. Within Mixpanel using one simple query in JQL.
  2. In three simple steps with a Python script.

Export people profiles with JQL

Note that exports using JQL are limited to 2GB, so if you run into issues exporting, try the steps below for the Python script instead, which can handle any size export.

In your Mixpanel project, click on Applications > JQL > Build your own, and remove any pre-populated code that appears.

Then, enter the following query > RUN QUERY, then Export to CSV*:

function main() {
  return People()
}

Learn more about the power of JQL.

*Limited by plan type

The ability to export to CSV is available only to customers on an Enterprise plan - visit the pricing page for more information or to upgrade.

Export people profiles with a Python script

Use the Mixpanel_api to create a simple python script.

Go to the Export People section of the Mixpanel_api, and use a text editor such as Sublime Text to create this script.

You will need to enter your API credentials, which can be found in the "Account" section of your project:

accountinfo

If you are exporting all of your users, you can ignore Selector and Behaviors. However, if you want to export a subset of users, you'll want grab these two parameters. To grab your (1) selector and (2) behaviors , go into the "Explore" tab of your Mixpanel project. From the "Explore" tab, select the subset of users you would like to export using people properties and/or events, and refresh the page.

Next, open Developer Tools and bring focus to the console (On Chrome for Mac: command + option + "J" & on Chrome Windows: control + shift + "J"). Once in the console, you'll need to locate and copy your "engage" selector - this is what tells Mixpanel which people profiles to export. Here's how you can grab your selector:

selector

Once you have the selector, copy and paste it into the script under 'selector'. If you are selecting users based off of events that they've fired, you'll then need to also paste in your 'behaviors'. If you do not have a behaviors parameter you can leave this value blank (as is). Finally, save the document:

python

Execute the script to pull these people profiles into a new JSON file. If you would like this in CSV format, you will want to add the parameter "format = 'CSV'". On a PC, simply open up the script with Python 2.7 to execute it. On a Mac, open up your Terminal and follow the steps below:

run script

That's it! The exported file will now be in the same location as the python script, and will include the epoch time stamp for when the export was performed.

We can help

If you are having trouble exporting your people profiles to CSV via either JQL or the Python script, email support@mixpanel.com - our legendary support team is standing by to help.

Let us know exactly which profiles you'd like to export by providing links, and we'll execute it for you - as a bonus, if you include why you want to export (what you'd like to do with the data) our consultative Support Engineers might come up with a more nifty solution than just an export!