I am looking into cleaning up duplicate profiles we currently have in MixPanel and I know this is possible with the $merge tool https://developer.mixpanel.com/reference/identities#identity-merge for event history and with the API module https://github.com/mixpanel/mixpanel_api#deduplicate-people-profiles for user profile data.
However, I could not find an API endpoint where I can retrieve user profiles which have duplicate data so I can then merge them. I checked the query API but that is mainly focused on reports and the raw export API has a lot of event data that is not necessary for this purpose (the resulting data would be too big to handle).
Can you please point me in the right direction to see how I can retrieve duplicate profiles so I can then execute the merge process?
Best answer by cherise
If you wanted to query for user profile information in a project, the engage endpoint would be the one to use. With that endpoint it should be possible to query profiles based on their properties so you can identify duplicates and get their respective distinct_id's so they can merged together.
Just a heads up if you use, the deduplicate_people() method from the python API the profiles that have the same value for the prop_to_match used will automatically be combined into a single profile. You would not necessarily also have to send in a $merge event unless you wanted to merge the distinct_id's from each profile so that they would both point to the same user in the future.