get all events as per user

  • 17 October 2019
  • 1 reply
  • 114 views

Badge

i want to get all events as per user, can you please help me with this




1 reply

Userlevel 5
Badge +4

@farhan 

To export the event data, you can use Mixpanel's export API (https://developer.mixpanel.com/docs/exporting-raw-data#section-export-api-reference).

You can export all events connected to a user by passing their distinct_id as part of the “where” parameter. The following snippit is an example curl request that achieves this. 

 

You need to update your API secret, date range, and distinct id of user. 

curl https://data.mixpanel.com/api/2.0/export/ \
-u <API_SECRET_HERE>: \
-d from_date="2019-05-01" \
-d to_date="2020-02-04" \
-d where='properties["$distinct_id"]=="<DISTINCT_ID_OF_USER>"'

Reply