kapa.ai in mixpanel raw export api how can apply where attribute ? i want to fetch evets past perticular timesampt
Please stand by Abhishek C. as I search the knowledge base. I normally take about 15 seconds or so. đź‘‹
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
To use the Mixpanel Raw Event Export API and filter events based on a specific timestamp, you can use the where parameter. The where parameter allows you to specify a segmentation expression to filter events, including by event properties such as time.For example, to fetch events that occurred after a particular Unix timestamp (in seconds), you can use a where clause like this: LBKSwhere=properties["time"] > 1700000000LBKS
Here’s how you might structure your API request: LBKScurl --request GET \ --url '[https://data.mixpanel.com/api/2.0/export?from_date=2024-07-01&to_date=2024-07-10&where=properties["time"]%20%3E%201700000000](https://data.mixpanel.com/api/2.0/export?from_date=2024-07-01&to_date=2024-07-10&where=properties[%22time%22]%20%3E%201700000000)' \ --header 'accept: text/plain' \ --header 'authorization: Basic YOUR_TOKEN'LBKS
- Replace 1700000000 with your desired Unix timestamp (in seconds).
- The where parameter must be URL-encoded (e.g., > becomes %3E, spaces become %20).The time property in the exported data is in seconds since the Unix epoch. If you want millisecond precision, you can add the time_in_ms=true parameter to your request.For more details on the where parameter and the export API, see the official documentation: Event Export API - Export and Export Methods.
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.
when doing it via a script or postman do i need to include the spaces ?
when doing it via a script or postman do i need to include the spaces ? kapa.ai
Let me check the knowledge base for you again. One moment! 📚
When using the where parameter in the Mixpanel Raw Event Export API, you do need to include spaces in the expression (e.g., properties["time"] > 1700000000
). However, when making the request via a script or Postman, these spaces (and other special characters) must be URL-encoded. For example, a space becomes %20
, and >
becomes %3E
.So, your where clause in the URL should look like this: LBKSwhere=properties["time"]%20%3E%201700000000LBKS
If you use Postman, it will often handle URL encoding for you if you enter the value in the query parameters section. If you are building the URL manually in a script, you must ensure the parameter is properly URL-encoded.This requirement is confirmed in the API documentation, which describes the use of the where parameter and notes that it should be URL-encoded when included in the request URLÂ Event Export API - Export.
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.
as soon as i specify the where query i get nothing in response kapa.ai here is is value properties["time"] > 1715449195830
Let me check the knowledge base for you again. One moment! 📚
If you are not getting any results when using a where query like properties["time"] > 1715449195830
, there are a few important things to check based on the Mixpanel documentation: 1. Time Format (Seconds vs. Milliseconds):
- The time
property in Mixpanel's raw export is typically in seconds since the Unix epoch, not milliseconds. If you use a value like 1715449195830
(which is in milliseconds), it will not match any events, since event times are much smaller numbers (e.g., 1715449195
).
- Try dividing your timestamp by 1000 to convert milliseconds to seconds. For example:
```LBKSLBKS2. **Parameter Encoding:**
- Ensure your where clause is URL-encoded. For example:
```LBKS where=properties["time"]%20%3E%201715449195
```LBKSLBKS3. **Date Range:**
- Make sure your `from_date` and `to_date` parameters cover the range you expect. The where clause only filters events within the date range specified by these parameters.LBKS4. **Project Timezone:**
- For projects created before 1 Jan 2023, the `from_date` and `to_date` parameters are interpreted in your project’s timezone, not UTC. For newer projects, they are in UTC. This can affect which events are included in your export [Manage Timezones for Projects](https://docs.mixpanel.com/docs/orgs-and-projects/managing-projects#manage-timezones-for-projects).LBKS**Summary:**
You are likely not seeing results because you are filtering on a millisecond timestamp, but Mixpanel stores and filters on seconds by default in the raw export API. Adjust your query to use seconds, and you should see results if events exist in that range.LBKSReferences:
- [Export Methods](https://docs.mixpanel.com/docs/export-methods)
- [Event Export API - Export](https://github.com/mixpanel/docs/blob/main/openapi/src/export.openapi.yaml)
- [Manage Timezones for Projects](https://docs.mixpanel.com/docs/orgs-and-projects/managing-projects#manage-timezones-for-projects)
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.
kapa.ai didn't work I tried with properties["time"] < 1715449195 properties["time"] > 1715449195
Let me check the knowledge base for you again. One moment! 📚
If you are not getting any results when using the where parameter with queries like properties["time"] < 1715449195
or properties["time"] > 1715449195
, here are the key points from the official Mixpanel documentation to consider: 1. Time Property Format:
The time
property in the raw export API is in seconds since the Unix epoch by default. If you want to filter using milliseconds, you must set the time_in_ms=true
parameter in your request. Otherwise, your filter should use seconds (Export Methods).2. Date Range Parameters:
The from_date
and to_date
parameters define the window of events returned. The where filter only applies to events within this window. If your date range does not include any events that match your where clause, you will get an empty response (Export Methods).3. URL Encoding:
The where clause must be URL-encoded. For example, a space is %20
and >
is %3E
 (Event Export API - Export).4. Project Timezone:
For projects created before 1 Jan 2023, the from_date
and to_date
parameters are interpreted in your project’s timezone. For newer projects, they are in UTC (Manage Timezones for Projects).Troubleshooting Steps:
- Double-check that your from_date
and to_date
cover the period you expect.
- Make sure your where clause matches the time format (seconds or milliseconds) used in your export.
- Try running the export without the where clause to confirm that events exist in the date range.
- If you want to use milliseconds, add time_in_ms=true
to your request and use a millisecond timestamp in your where clause.**Example Request (seconds):curl --request GET \ --url '[https://data.mixpanel.com/api/2.0/export?from_date=2024-05-01&to_date=2024-05-10&where=properties["time"]%20%3E%201715449195](https://data.mixpanel.com/api/2.0/export?from_date=2024-05-01&to_date=2024-05-10&where=properties[%22time%22]%20%3E%201715449195)' \ --header 'accept: text/plain' \ --header 'authorization: Basic YOUR_TOKEN'Example Request (milliseconds):**LBKScurl --request GET \ --url '[https://data.mixpanel.com/api/2.0/export?from_date=2024-05-01&to_date=2024-05-10&time_in_ms=true&where=properties["time"]%20%3E%201715449195000](https://data.mixpanel.com/api/2.0/export?from_date=2024-05-01&to_date=2024-05-10&time_in_ms=true&where=properties[%22time%22]%20%3E%201715449195000)' \ --header 'accept: text/plain' \ --header 'authorization: Basic YOUR_TOKEN'LBKS
If you have confirmed all of the above and still receive no results, the knowledge sources do not provide further troubleshooting steps for this specific issue. You may want to verify that events actually exist in the specified time range and that your project settings (such as timezone) are correct (Export Methods; Event Export API - Export).
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.
NO the where query doesn't work at all
kapa.ai NO the where query doesn't work at all
Let me check the knowledge base for you again. One moment! 📚
Thank you for your feedback. Based on the knowledge sources provided, the Mixpanel Raw Event Export API does support a where parameter for filtering events, and the documentation gives examples of its usage. However, the sources do not provide a detailed, working example specifically confirming that filtering on the time property using where (e.g., properties["time"] > 1715449195
) is guaranteed to work as expected in all cases.The documentation states:
The where parameter allows you to specify a segmentation expression to filter events, including by event properties such as time. The where parameter must be URL-encoded when included in the request URLÂ Event Export API - Export.It also shows that the time property in the exported data is in seconds by default, unless you set time_in_ms=true
 Export Methods.However, there is no explicit example in the knowledge sources that demonstrates a successful export using a where filter on the time property. If you are finding that the where query does not work at all, the knowledge sources do not provide enough information to explain or resolve this issue.If you have confirmed that your syntax, encoding, and date ranges are correct and still receive no results, it may be a limitation or undocumented behavior of the API. The documentation does not provide further troubleshooting steps for this specific scenario.
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.
give examle other than time kapa.ai
Let me check the knowledge base for you again. One moment! 📚
Certainly! Here is an example of using the where
parameter in the Mixpanel Raw Event Export API to filter by an event property other than time
.Suppose you want to export only events where the property country
is "US"
. Your where
clause would look like this: LBKSwhere=properties["country"]=="US"LBKS
When URL-encoded, it becomes: LBKSwhere=properties%5B%22country%22%5D%3D%3D%22US%22LBKS
**Example API request:**LBKScurl --request GET \ --url '[https://data.mixpanel.com/api/2.0/export?from_date=2024-07-01&to_date=2024-07-10&where=properties%5B%22country%22%5D%3D%3D%22US%22](https://data.mixpanel.com/api/2.0/export?from_date=2024-07-01&to_date=2024-07-10&where=properties%5B%22country%22%5D%3D%3D%22US%22)' \ --header 'accept: text/plain' \ --header 'authorization: Basic YOUR_TOKEN'LBKS
This will return only those events where the country
property is "US"
.This usage is consistent with the example in the JQL documentation, which filters events by the country
property (JQL Builtins). The same property-based filtering logic applies to the Raw Event Export API's where
parameter as described in the API documentation (Event Export API - Export).
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.