Mixpanel is an analytics-as-a-service application, so it requires data to offer its analytics features. Mixpanel collects huge amounts of data related to how your customers use your product, and in the case where you would like to do anything that also involves data from other sources you really have two choices. The first one is to enrich the data of Mixpanel with data coming from other sources and the second one is to extract the data Mixpanel holds for you and load it on a data warehousing repository for further analysis. This post will consider the second case.
Along with the analytics services, Mixpanel also enables you to build applications integrated with it. In this post, we will work only with the Export API to export our data from Mixpanel.
As a web API, you can access it using tools like CURL or Postman or your favorite HTTP client for the language or framework of your choice. You can choose from the options given below:
You can also use the libraries/SDKs that Mixpanel offers for the following languages:
As a RESTful API, it offers the following resources that you can interact with:
Annotations
- annotations– list the annotations for a specified date range.
- create– create an annotation
- update– update an annotation
- delete– delete an annotation
Export
- export– get a “raw dump” of tracked events over a time period
Events
- events– get total, unique, or average data for a set of events over a time period
- top– get the top events from the last day
- names– get the top event names for a time period
Event Properties
- properties– get total, unique, or average data from a single event property
- top– get the top properties for an event
- values– get the top values for a single event property
Funnels
- funnels– get data for a set of funnels over a time period
- list– get a list of the names of all the funnels
Segmentation
- segmentation– get data for an event, segmented and filtered by properties over a time period
- numeric– get numeric data, divided up into buckets for an event segmented and filtered by properties over a period of time
- sum– get the sum of a segment’s values per time unit
- average– get the average of a segment’s values per time unit
- Segmentation Expressions– a detailed overview of what a segmentation expression consists of
Retention
- retention– get data about how often people are coming back (cohort analysis)
- addiction– get data about how frequently people are performing events
People Analytics
- engage– get data from People Analytics
Let’s assume we want to export our raw data from Mixpanel. To do so, we’ll need to execute requests to the export endpoint. An example request to get raw events from Mixpanel is as follows: