What’s wrong with Mixpanel Raw data export API query parameter where the to-date and from_date does not allow us filter for a time period instead it just pulls the first 100000 events and when we say 100000 events are we saying distinct events or 100000 records or rows of events kapa.ai
The Mixpanel Raw Data Export API allows you to specify a date range using the from_date and to_date parameters, which are inclusive and interpreted in UTC (or project timezone for older projects). However, the API also has a limit parameter, which restricts the maximum number of events returned in a single request to 100,000. If your query matches more than 100,000 events, only the first 100,000 events (records/rows) are returned, not 100,000 distinct event types. Each "event" here refers to a single event record (i.e., a row in the export), not a unique event name. This means if your date range contains more than 100,000 events, you will not get the full set for that period unless you paginate your requests or narrow your date range.To summarize: - The API returns up to 100,000 event records per request, not 100,000 unique event types. - If your date range contains more than 100,000 events, only the first 100,000 are returned, and you must adjust your query (e.g., by reducing the date range) to retrieve additional records. - The from_date and to_date parameters do filter by time period, but the limit parameter may truncate your results if the number of matching events exceeds 100,000.This behavior is documented in the API reference: > Use this parameter if you want to limit the max number of events to be returned. Value cannot be over 100000.
... The returned format is one event per line where each line is a valid JSON object, but the full return itself is JSONL. Event Export API - ExportAnd further clarified in the documentation: > The exported payloads are raw events, containing timestamps as they are stored in your project. Export Methods: Export raw data and reports from MixpanelSo, "100,000 events" means 100,000 individual event records (rows), not unique event names. If you need to export more, you should break your export into smaller date ranges or use pagination techniques as suggested in Mixpanel's sample scripts and documentation.
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.
I’ve tried using a smaller time window with the to_date and from_date so that it captures in chunk and allows us not to hit the 100000 rows of events but it does not work. It ignores this filter parameter why? Is this this is for both pulling data to a power bi and even a data platform. What of your WHERE parameter how do we use it? kapa.ai
Let me check the knowledge base for you again. One moment! 📚
Based on the knowledge sources, the Mixpanel Raw Data Export API does allow you to filter by time period using the from_date and to_date parameters. These parameters are required and should restrict the export to the specified date range. However, if you are finding that the API ignores these parameters and returns more data than expected, there may be a few reasons: 1. Date Range Interpretation: - For projects created after 1 January 2023, from_date and to_date are interpreted as UTC. - For projects created before 1 January 2023, they are interpreted using your current project timezone. If your project timezone is not set as you expect, this could cause confusion about which events are included in the export. Docs: Export Methods Managing Project Timezones2. Limit Parameter: The API will return up to 100,000 events per request, regardless of the date range. If your date range contains more than 100,000 events, only the first 100,000 are returned. Event Export API - Export3. WHERE Parameter: The where parameter allows you to further filter events by properties. For example, you can use it to export only events where a certain property matches a value. The where parameter uses an expression syntax. Example usage:
```LBKS This would export only events where the $browser property is "Chrome".
[Event Export API - Export](https://raw.githubusercontent.com/mixpanel/docs/main/openapi/src/export.openapi.yaml)LBKS**Summary of Usage:**
- Use from_date and to_date to set your time window.
- Use limit to control the number of events returned (max 100,000).
- Use where to filter by event properties.LBKS**If the API is ignoring your from_date and to_date filters:**
- Double-check your project’s timezone settings and ensure you are using the correct date format and timezone.
- Make sure your date range actually contains fewer than 100,000 events.
- If you continue to see issues, it may be a bug or a misunderstanding of the project’s timezone, as the API is designed to respect these parameters.LBKS**This applies whether you are pulling data into Power BI, a data platform, or any other destination.**LBKSFor more details on the where parameter and examples, see the [API documentation](https://raw.githubusercontent.com/mixpanel/docs/main/openapi/src/export.openapi.yaml).
If you need to export large volumes, consider using scripts to automate chunked exports, as described in Mixpanel’s sample scripts.
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.
event for my python script that I wrote to export, I included this
START_DATE = datetime.strptime('2025-07-12', '%Y-%m-%d')
END_DATE = datetime.strptime('2025-07-23','%Y-%m-%d')
…
current_start = START_DATE
while current_start <= END_DATE:
if requests_this_hour >= 60:
elapsed = time.time() - hour_window_start
if elapsed < 3600:
wait_time = 3600 - elapsed
print(f'Hourly limit hit. Sleeping {int(wait_time)} seconds.')
time.sleep(wait_time)
requests_this_hour = 0
hour_window_start = time.time()
# Define 7-day range
current_end = min(current_start + timedelta(days=6), END_DATE)
from_str = current_start.strftime('%Y-%m-%d')
to_str = current_end.strftime('%Y-%m-%d')
result = fetch_range_data(from_str, to_str)
…
url = f'{BASE_URL}?project_id={PROJECT_ID}&from_date={from_date}&to_date={to_date}'