Mixpanel Community Icon

What is the recommend way to paginate the raw export API?

·
·

What is the recommend way to paginate the raw export API?

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Hi Andrew S., 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

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Based on the knowledge sources provided, there isn't specific information about pagination for the Raw Event Export API. The Raw Event Export API documentation doesn't mention a pagination mechanism like the one described for the Engage API (which uses session_id and page parameters).The Raw Event Export API does have some parameters that can help manage large data exports: - You can use the limit parameter to control the number of events returned (up to 100,000) - You can break up your requests by date ranges using the from_date and to_date parametersFor handling large exports, there's a sample script mentioned that helps with exporting varied length date ranges: LBKSdates_to_export = [ {"start": "2024-01-01","end": "2024-03-31", "increment": 30}, {"start": "2024-04-01","end": "2024-04-30", "increment": 1} ]LBKSThis approach allows you to export larger date ranges in a single request when there's relatively low data volume, while using smaller date ranges (down to one day at a time) when data volumes are higher. The documentation suggests keeping each request under 1-2 million events as a guideline for manageability.Keep in mind that the Raw Export API has rate limits of: - 60 queries per hour - 3 queries per second - Maximum of 100 concurrent queriesMixpanel Utils Sample Scripts provides more details on this approach.

    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.

  • Avatar of Abhishek C.
    Abhishek C.
    ·
    ·

    kapa.ai how can i paginate per day level

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Let me check the knowledge base for you again. One moment! 📚

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    To paginate Mixpanel's Raw Event Export API at the day level, the recommended approach is to make separate API requests for each day by setting the from_date and to_date parameters to the same value for each desired day. This effectively "paginates" your export by day, ensuring each request only returns data for a single day.For example, to export data for July 1, 2024: LBKSGET /export?from_date=2024-07-01&amp;to_date=2024-07-01LBKSYou would repeat this for each day in your desired range.This method is also demonstrated in Mixpanel's sample scripts, where you can define date ranges and increments (e.g., 1 day at a time): LBKSdates_to_export = [ {"start": "2024-04-01", "end": "2024-04-30", "increment": 1} ]LBKSThis approach helps manage large data volumes and keeps each export manageable, as recommended by Mixpanel. There is no built-in pagination parameter for the Raw Export API; splitting by day is the standard practice for paginating large exports at the day level Exporting varied length date ranges 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.