Skip to main content
Solved

Easiest way to get events per profile using API (for all profiles)?


Forum|alt.badge.img+2

I would like to fetch a list of event types and times per user for all profiles.
I saw I can fetch all profiles and all events. I then have to run a query per event to fetch the profile asociated with the event. I then habe to write some code to save the information I want to be per profile instead of per event. 

is there any simpler/faster way to export this data in bulk? 

Best answer by saulblum

Could you give more of the context and use case? Which events do you want to export? Native events like Clicked Email? E-commerce-specific events like Viewed Product? Do you care about the specific profiles attached to these events or only want a count over a time window?

View original
Did this topic or the replies in the thread help you find an answer to your question?

5 replies

Forum|alt.badge.img+1
  • Contributor I
  • 5 replies
  • February 4, 2024

Hi there,

It sounds like you're dealing with a data extraction challenge. Here's my suggestion

I understand the complexity of fetching event types and times per user for all profiles. Instead of fetching all profiles and all events separately and running multiple queries, consider exploring the following approach:

  1. Batch API Requests: Check if the API you're using supports batch requests. This way, you can fetch information for multiple profiles and events in a single API call, reducing the number of requests and speeding up the process.

  2. Optimize API Queries: Review the API documentation to see if there are parameters or filters that allow you to retrieve the desired data more efficiently. For example, you might be able to filter events based on user IDs to directly get the relevant information.

  3. Use Data Transformation Tools: Consider using data transformation tools like Apache Spark or pandas in Python. These tools can help you process and transform large datasets efficiently, allowing you to reshape the data as needed for your analysis.

  4. Caching and Incremental Updates: If applicable, implement a caching mechanism to store previously fetched data. This way, you only need to retrieve and process new or updated information, saving time and resources.

  5. Parallel Processing: Depending on the scale of your data, explore parallel processing techniques to fetch and process data concurrently. This can significantly speed up the overall data export process.

Remember to consult the API documentation thoroughly and test any changes in a controlled environment before implementing them in a production setting. If you have any specific details about the technology stack you're using, I can provide more targeted advice.

Message me for further discussion

Best regards,

Juan.


Forum|alt.badge.img+7
  • Klaviyo Employee
  • 169 replies
  • Answer
  • February 5, 2024

Could you give more of the context and use case? Which events do you want to export? Native events like Clicked Email? E-commerce-specific events like Viewed Product? Do you care about the specific profiles attached to these events or only want a count over a time window?


  • Contributor I
  • 2 replies
  • September 23, 2024

@saulblum, I am in the same boat as Dan. Where can I find access to a bulk download of all profiles with all their event data? The context is I need to quickly access that data, which Klaviyo’s user interface doesn’t allow for, and whose API documentation doesn’t explain how to access.


Forum|alt.badge.img+7
  • Klaviyo Employee
  • 169 replies
  • September 24, 2024
LGTL wrote:

@saulblum, I am in the same boat as Dan. Where can I find access to a bulk download of all profiles with all their event data? The context is I need to quickly access that data, which Klaviyo’s user interface doesn’t allow for, and whose API documentation doesn’t explain how to access.

There isn’t a UI way to do a bulk export of events. You’d need to call Get Events for each metric you care about: https://developers.klaviyo.com/en/reference/get_events

What’s the use case for doing a bulk export of every event?


  • Contributor I
  • 2 replies
  • September 24, 2024

Thank you for your response. While I understand that the platform’s UI currently doesn’t offer bulk export functionality, the volume of data required makes pulling events metric by metric unmanageable.

Could you advise if there are any alternative solutions or potential API enhancements that would allow for a bulk export? This would significantly improve our ability to work within your platform, so if there are any options or alternative approaches you could suggest to streamline this process, we’d greatly appreciate it.