mixpanel-python icon indicating copy to clipboard operation
mixpanel-python copied to clipboard

Add support for strict query parameter on /import and /engage endpoints

Open benjy44 opened this issue 2 months ago • 0 comments

Description:

The Mixpanel API supports a strict query parameter on /import and /engage endpoints for better validation and error reporting. The SDK currently doesn't support passing query parameters to these endpoints.

Attempted Workaround:

consumer = BufferedConsumer(
    import_url="https://api-eu.mixpanel.com/import?strict=1"
)

Error:

mixpanel.MixpanelException: Mixpanel error: illegal base64 data at input byte 0

This fails because the SDK sends application/x-www-form-urlencoded data, and the strict parameter in the URL causes Mixpanel to misinterpret the request format.

Proposed Solution:

Add a way to pass query parameters to endpoints, such as:

consumer = BufferedConsumer(
    api_host="api-eu.mixpanel.com",
    query_params={'strict': '1'}  # or import_query_params={'strict': '1'}
)

Alternative: Add a specific strict=True/False parameter to the Consumer constructor.

benjy44 avatar Oct 15 '25 09:10 benjy44