What is the ordering when we use export api?
Hi Ihsan C., 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
The knowledge sources do not explicitly describe any guaranteed sort order for events returned by the Raw Event Export API.
What is documented:
- You specify a date range with from_date and to_date; the API returns events in that range as JSONL (one JSON object per line). [Export methods; Export OpenAPI]
- You can further filter with event, where, and limit, but there is no mention of ordering (e.g., by time, insert order, etc.). [Export OpenAPI]
Because the docs don’t state an ordering guarantee, you should not rely on any particular order from the API response; if you need a specific order (e.g., by timestamp), plan to sort the exported data yourself after download.
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.
e.g. When I try to get from_date=2025-12-27, to_date=2025-12-27 , I get 3800 records. When I try get from_date=2025-12-27, to_date=2025-12-27 and limit = 3000 I get 3000 records, as intended. and max(time) is 1766878165511 Then when I try to get from_date=2025-12-27, to_date=2025-12-27 and limit = 3000 and where=properties[“$time”] >= datetime(1766878165511) I get only 1 record. I’m doing this test to simulate for a specific date if there are records over 100 thousands - which is an api limit - I should get the other records only by querying with max time. But since the order is not guaranteed then “>= max(time)” may return again only 1 record. kapa.ai
Let me check the knowledge base for you again. One moment! 📚
You’re correct to be cautious here. Based on the docs, you cannot safely implement pagination for the Raw Event Export API using limit + “> = max(time)” because:
1. No ordering guarantee
The Export API docs describe parameters (from_date, to_date, limit, event, where) and the JSONL format, but they do not state that results are ordered by time, ingestion time, or anything else. [Export OpenAPI; Export methods]
Since there is no documented order, your observation (second query with > = max(time) returning only 1 record) is expected and you should not rely on any implicit ordering.
2. limit is just a cap, not a page cursor
limit only restricts the maximum number of events returned; it is not a paging mechanism and there is no cursor/offset parameter in the Raw Export API. [Export OpenAPI]
3. Deduplication is not applied to raw export
Raw export returns events “as ingested”, including duplicates, and you’re expected to deduplicate offline using (event_name, distinct_id, time, $insert_id) if needed. [Event export overview; Event dedupe]
Because of these constraints, the docs do not provide a supported way to “page” through > 100k events for a single day using max(time) logic.
What is documented as the recommended approach instead
For large volumes, the recommended pattern is to split the date range into smaller ranges so that each Export API call stays under the 100k limit, rather than trying to paginate within a single day. Mixpanel’s sample script for “exporting varied length date ranges” shows this pattern: you define multiple date ranges and increments (e.g., 1 day at a time) and loop over them. [Varied date export]
Example from that script:
```
dates_to_export = [ {"start": "2024-01-01","end": "2024-03-31", "increment": 30}, {"start": "2024-04-01","end": "2024-04-30", "increment": 1} ]
LBKSApplied to your case:
- If you suspect a single calendar day might exceed 100k events, the docs don’t give you a time-based pagination mechanism; instead, you’d:
- Narrow the date range further (e.g., split the day into multiple smaller date ranges if your project timezone vs UTC allows it), or
- Use multiple days with smaller increments and accept that a single day with > 100k events cannot be fully exported via a single Raw Export call under the documented constraints.
Since the documentation does not describe any cursor, offset, or guaranteed ordering, there is no officially supported way (in the docs) to reliably “continue” from max(time) for that same day.
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.
Let me check the knowledge base for you again. One moment! 📚
The knowledge sources explicitly state that:
- The Raw Event Export API has a limit parameter whose value “cannot be over 100000.” [Export OpenAPI] - The API itself has rate limits (60 queries/hour, 3 queries/second, 100 concurrent), but there is no mention of returning more than 100,000 events in a single response. [Export OpenAPI; Rate limits]
The docs do not describe any behavior where omitting limit would allow more than 100,000 events to be returned. They only say that if you do use limit, it must be ≤ 100,000; they don’t document the default limit or maximum when limit is omitted.
So, based on the documentation alone:
- It is not documented as “normal” or expected that you can receive 400,000 records in a single call when limit is omitted.
- The knowledge sources do not provide enough information to explain or confirm this behavior; they don’t specify what the default limit is when limit is not provided.
Given this gap, if you are consistently seeing > 100k events returned without limit, that behavior is not covered by the docs, and you should contact Mixpanel Support with your project details and example requests so they can confirm whether this is expected for your project or a bug.
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.
