How to query users via api
Hi Felix O., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
To query users via the Mixpanel API, you can use the Engage API endpoint. Here's how you can do it:1. Use the /engage
endpoint with a POST request.
2. Provide the necessary parameters to filter and retrieve the desired user profiles.Here's a sample request using curl:LBKScurl --request POST \ --url '[https://mixpanel.com/api/query/engage?project_id=1234567](https://mixpanel.com/api/query/engage?project_id=1234567)' \ --header 'accept: application/json' \ --header 'authorization: Basic YOUR _TOKEN \ --header 'content-type: application/x-www-form-urlencoded'LBKS
This request will return all user profiles in the specified project. You can add additional parameters to filter the results or specify which properties to return.For example, to return specific profile properties, you can use the output_properties
parameter:LBKSoutput_properties=["$last_name", "$email", "Total Spent"]LBKS
The response will be a JSON object containing an array of user profiles, each with their properties.For more detailed information on using the Engage API, including additional parameters and response format, you can refer to the Mixpanel Developer Reference.Remember that the Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.Mixpanel Docs: Export Methods provides additional context on exporting user profiles via API.Markdown formatted answer:To query users via the Mixpanel API, you can use the Engage API endpoint. Here's how you can do it:1. Use the /engage
endpoint with a POST request.
2. Provide the necessary parameters to filter and retrieve the desired user profiles.Here's a sample request using curl:LBKScurl --request POST \ --url '[https://mixpanel.com/api/query/engage?project_id=1234567](https://mixpanel.com/api/query/engage?project_id=1234567)' \ --header 'accept: application/json' \ --header 'authorization: Basic YOUR _TOKEN \ --header 'content-type: application/x-www-form-urlencoded'LBKS
This request will return all user profiles in the specified project. You can add additional parameters to filter the results or specify which properties to return.For example, to return specific profile properties, you can use the output_properties
parameter:LBKSoutput_properties=["$last_name", "$email", "Total Spent"]LBKS
The response will be a JSON object containing an array of user profiles, each with their properties.For more detailed information on using the Engage API, including additional parameters and response format, you can refer to the Mixpanel Developer Reference.Remember that the Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.Mixpanel Docs: Export Methods provides additional context on exporting user profiles via API.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
How long does session_id last?