Skip to main content
Contributor I
Dec 12, 2022 9:52 AM UTC
Solved

Calculating unique opens

I’ve been using the endpoint and requesting the “unique” number of opens (weekly unit)

https://a.klaviyo.com/api/v1/metric/OPENED_EMAIL_METRIC_ID/export

However, the sum of this is much larger than what’s displayed within Klaviyo’s reporting interface.

I’m gathering that with each week in the API export, it’s displaying the unique opens occuring each week, rather than unique opens that have occured over all time like the report. Is there a way to output this instead via the API?

    This topic has been closed for replies.
    Dov
    DovAnswer
    Klaviyo Alum
    Dec 12, 2022 9:55 PM UTC

    Hi @Wei Tan,

    Thanks for sharing this question with our community.

    You will need to use either the day, week or month parameter in the request:

    curl https://a.klaviyo.com/api/v1/metric/OPENED_EMAIL_METRIC_ID/export -G \
    -d api_key=API_KEY \
    -d unit='week' \
    -d measurement='unique' \
    -d where='[["$message","=",'MESSAGE_ID']]'

    Thanks for being a community member.

    DD

    1 reply

    Dov
    DovAnswer
    Klaviyo Alum
    Dec 12, 2022 9:55 PM UTC

    Hi @Wei Tan,

    Thanks for sharing this question with our community.

    You will need to use either the day, week or month parameter in the request:

    curl https://a.klaviyo.com/api/v1/metric/OPENED_EMAIL_METRIC_ID/export -G \
    -d api_key=API_KEY \
    -d unit='week' \
    -d measurement='unique' \
    -d where='[["$message","=",'MESSAGE_ID']]'

    Thanks for being a community member.

    DD