---
title: "Export data from Klaviyo"
description: "Learn and understand how to export data objects from Klaviyo, including how to integrate Klaviyo with a data warehouse."
url: "https://developers.klaviyo.com/en/docs/export_data_from_klaviyo"
category: "Build with Klaviyo"
lastUpdated: "2026-11-06"
related: ["https://developers.klaviyo.com/en/docs/llms.txt"]
---

# Export data from Klaviyo

> This is the Markdown version of https://developers.klaviyo.com/en/docs/export_data_from_klaviyo

Learn and understand how to export data objects from Klaviyo, including how to integrate Klaviyo with a data warehouse.

## Data objects

When understanding how to export data from Klaviyo and sync it into another system, it helps to first understand Klaviyo’s [data model](https://developers.klaviyo.com/en/docs/introduction_to_klaviyos_data_model.md) (i.e., what data Klaviyo collects and how it’s organized). 

Metrics, as the key data object representing a given person’s activity and engagement with your brand and messaging, are the most commonly requested data objects to export from Klaviyo. Metrics are actions represented as timestamped records that include JSON-formatted payloads that can contain an unlimited quantity of key-value pairs, including arrays and further-nested JSON. Klaviyo automatically records Metrics for email, push, and SMS-related activity such as "Received Email", "Opened Email", "Clicked Email", and more. Some other common objects that may be exported include Profiles, Lists, and Unsubscribes.

## Exporting data

You can find a complete list of our available APIs for exporting Klaviyo data on our API docs. Here are some of our more frequently used export APIs:

- [**Get Metrics**](https://developers.klaviyo.com/en/reference/get_metrics.md)  
  Returns a list of all the metrics in your account.

- [**Get Events**](https://developers.klaviyo.com/en/reference/get_events.md)  
  Returns a batched timeline of all events in your account.

- [**Get Events and filter by metric_id**](https://developers.klaviyo.com/en/reference/get_events.md)  
  Returns a batched timeline for one specific metric.

- [**Query Metric Aggregates**](https://developers.klaviyo.com/en/reference/query_metric_aggregates.md)  
  Exports aggregate counts of event data from Klaviyo, optionally filtering and segmenting on available event properties.

- [**Get Profile**](https://developers.klaviyo.com/en/reference/get_profile.md)  
  Retrieves all the profile properties for a profile, using the `profile_id`. Can also request specific fields using sparse field-sets.

- [**Get Profile’s Events for All Metrics**](https://developers.klaviyo.com/en/reference/get_events.md)  
  Returns a batched timeline of all events for a person when you pass in the `profile_id` as a filter. 

- [**Get Profile’s Events for a Specific Metric**](https://developers.klaviyo.com/en/reference/get_events.md)  
  Returns a batched timeline of all events for one specific Metric for a given person when you pass the `profile_id` and `metric_id` as filters.

- [**Get Lists**](https://developers.klaviyo.com/en/reference/get_lists.md)  
  Returns a listing of all of the lists in an account.

- [**Get List Info**](https://developers.klaviyo.com/en/reference/get_list.md)  
  Returns information about a list.

- [**Get List Members**](https://developers.klaviyo.com/en/reference/get_profiles_for_list.md)  
  Gets all profiles in a given list.

- [**Get Segment Members**](https://developers.klaviyo.com/en/reference/get_profiles_for_segment.md)  
  Gets all profiles in a given segment.

- [**Get Campaigns**](https://developers.klaviyo.com/en/reference/get_campaigns.md)  
  Returns a list of all the campaigns you've created.

- [**Get Campaign Info**](https://developers.klaviyo.com/en/reference/get_campaign.md)  
  Returns summary information for the campaign specified.

- [**Get Campaign Recipient Estimation**](https://developers.klaviyo.com/en/reference/get_campaign_recipient_estimation.md)  
  Returns summary information about email recipients for the campaign specified.

- [**Get All Templates**](https://developers.klaviyo.com/en/reference/get_templates.md)  
  Returns a list of all the email templates you've created.

## Example: how to export data

Klaviyo exposes data for export through REST APIs associated with these data objects. You can use these to extract information, optionally using parameters to refine the information returned. As an example, a simple curl request to retrieve a list of each unique metric observed in the account via the Klaviyo Metrics API would look like this:

```curl
curl --location 'https://a.klaviyo.com/api/metrics/' \
--header 'revision: {latest revision header}' \
--header 'Accept: application/json' \
--header 'Authorization: Klaviyo-API-Key your-private-api-key'
```

The GET call returns a JSON object with all the fields of the specified dataset as a reply. In this illustrative example, the account has three unique metrics. The resulting JSON would look like:

```json
{
    "data": [
        {
            "type": "metric",
            "id": "KxhW33",
            "attributes": {
                "name": "Clicked Email",
                "created": "2020-01-28T13:33:15+00:00",
                "updated": "2020-01-28T13:33:15+00:00",
                "integration": {
                    "object": "integration",
                    "id": "0rG4eQ",
                    "name": "Klaviyo",
                    "category": "Internal"
                }
            },
            "links": {
                "self": "https://a.klaviyo.com/api/metrics/KxhW33/"
            }
        },
        {
            "type": "metric",
            "id": "JUzjai",
            "attributes": {
                "name": "Added to Cart",
                "created": "2020-01-29T13:19:30+00:00",
                "updated": "2021-08-27T08:41:10+00:00",
                "integration": {
                    "object": "integration",
                    "id": "7FtS4J",
                    "name": "API",
                    "category": "API"
                }
            },
            "links": {
                "self": "https://a.klaviyo.com/api/metrics/JUzjai/"
            }
        },
        {
            "type": "metric",
            "id": "XNJ6uB",
            "attributes": {
                "name": "Placed Order",
                "created": "2023-04-19T03:01:44+00:00",
                "updated": "2023-04-19T03:01:44+00:00",
                "integration": {
                    "object": "integration",
                    "id": "7FtS4J",
                    "name": "Shopify",
                    "category": "eCommerce"
                }
            },
            "links": {
                "self": "https://a.klaviyo.com/api/metrics/XNJ6uB/"
            }
        }
      ]
```

## Use case: integrating Klaviyo with a data warehouse

```prompt Sync Klaviyo data into another system
Build a job that exports data from my Klaviyo account and loads it into another system, such as a data warehouse.

First read https://developers.klaviyo.com/en/docs/export_data_from_klaviyo.md.

Ask me for these before you change anything, unless I've already given them:
- A Klaviyo private API key. Read it from an environment variable, and keep it out of source control and logs.
- Which data objects to export (for example, metrics and their events, profiles, lists or campaigns), and any filtering criteria, such as only metrics whose `integration.name` is "Klaviyo".
- Where the data should go, and the format or tables it expects.

Then, following this codebase's language, framework and conventions:
1. If a pre-built connector (such as Segment, Stitch Data or Fivetran) or the Singer tap at https://github.com/singer-io/tap-klaviyo would cover what I've asked for, tell me before writing custom code.
2. Test each request before automating it. Send GET requests to endpoints under https://a.klaviyo.com/api/, such as `metrics/` and `events/`, with `Authorization: Klaviyo-API-Key <key>`, `Accept: application/json` and a `revision` header set to the latest revision in the API reference.
3. To get metrics from one integration, add `?filter=equals(integration.name,"<integration name>")`. Then get the events for each `metric_id` I care about. Take the filter syntax for events, profiles and lists from each endpoint's API reference, linked from the guide.
4. Collect every batch of results, not only the first.
5. Map Klaviyo's JSON responses to what the destination expects, then write the extract, transform and load code.

This job only reads from Klaviyo. Don't create, change or delete anything in the Klaviyo account.

When you're done, run it once and compare a few counts, such as the number of metrics, with what Klaviyo shows. Tell me what you changed and how to run the job.
```

If you’d like to extract data from Klaviyo to a data warehouse or internal system, the general integration process is as follows: 

| Step | Description |
| --- | --- |
| **Specify data to extract** | Document the data objects and any filtering criteria that you want to apply when extracting the data. For example, if you are interested in syncing Klaviyo-originated metrics into another system, it would look like:<br />_Data objects_: Metrics<br />_Filtering criteria_: All Metrics where “attributes.integration.name” equals “Klaviyo” |
| **Test and validate API requests** | After documenting the data to extract, we recommend identifying the Klaviyo API endpoints that return the desired data and using the [Get Metrics](https://developers.klaviyo.com/en/reference/get_metrics.md) to fetch and validate the data, then define the logical steps for automation. Using the example above, it might look like this:<br />_Step 1_: GET request to `https://a.klaviyo.com/api/metrics/` in order to get a list of all unique metrics. If you wanted to go a step further and just get metrics from a specific integration, you could with a GET request that looks like this `https://a.klaviyo.com/api/metrics/?filter=equals(integration.name,"insert integration name here")`<br />_Step 2_: GET request to `https://a.klaviyo.com/api/events/` for each `metric_id` of interest |
| **Map source data to destination** | Once you know the data that you want to extract and how to extract it, you must map Klaviyo’s data structure into your data warehouse or other internal system. Klaviyo’s APIs return JSON formatted data, so if your warehouse or other business system requires another format, you may need to manipulate the output to conform to destination expectations. |
| **Build ETL (or use a pre-built connector)** | Once you have the specifications for extracting data and mapping it to your target destination, the next step is to author the code that will automate the extract, transfer, and load (ETL) logic. You may benefit from using an open-source tool such as a [Singer-Tap](https://github.com/singer-io/tap-klaviyo) to achieve this.<br />If you prefer to avoid this step, you may opt for a tool with a [pre-built Klaviyo integration](https://marketplace.klaviyo.com/en-us) such as Segment.com, Stitch Data, or Fivetran. |
| **Perform QA** | After automating the ETL, you will want to validate that data flows through as expected. |

## Additional resources

- [Use data in Klaviyo](https://developers.klaviyo.com/en/docs/using_data_in_klaviyo.md)
- [Custom integration FAQs](https://developers.klaviyo.com/en/docs/custom_integration_faqs.md)
