Import Klaviyo Data to Google Sheets

In this article, we’ll walk through how to pull API data from Klaviyo into Google Sheets, using the API Connector add-on for Sheets. Klaviyo is an email and SMS marketing solution that allows you to collect and analyze customer data. Additionally, it integrates with other tools like BigCommerce, Shopify, WooCommerce, and others.

To get started, head over to Klaviyo and sign up for an account. Once you’re plugged in, let’s dive into the API docs to figure out what data we can grab!

PART 1: GET YOUR KLAVIYO API KEY

From the dashboard, go to your account.

klaviyo-img1

In the top right corner, go to Settings -> API Keys.

klaviyo-img2

Go ahead and create a new API key.

klaviyo-img3

You’ll now see your API key. Klaviyo’s API docs actually conveniently save and display your API key in the docs, so you don’t necessarily need to save this anywhere.

klaviyo-img4

PART 2: CREATE YOUR API REQUEST API URL TO GET LISTS

Let’s start by viewing all of our memberships and subscriptions. First, let’s grab all of our lists to figure out which one we want to view.

  • Base URL: https://a.klaviyo.com
  • Endpoint: /api/v2/lists
  • Query string: api_key=YOUR_API_KEY

PART 3: PULL KLAVIYO LIST DATA INTO SHEETS

  1. Open up Google Sheets and click Add-ons > API Connector > Create New API Request.
  2. In the Create Request interface, enter the Request URL we just created:
klaviyo-img5

Run the request, and you will get back a table showing all of your lists and their respective IDs.

klaviyo-img6

You can now put those list IDs in a different API request to get all of the contacts in that list. Let’s go do that now!

PART 4: CREATE YOUR API REQUEST API URL TO GET SUBSCRIBERS

Now that we have a list of our lists, let’s make a new sheet to send our data to and call it something like “List Contents”.

klaviyo-img7

Now let’s go ahead and grab the list_id of one of them. In this example, I’ll grab one of my list IDs, S9YQHL. Now we need to setup our new API URL request. Following similar steps from before, we combine the base URL with our Endpoint:

  • Base URL: https://a.klaviyo.com
  • Endpoint: /api/v2/group/YOUR_LIST_ID/members/all
  • Query string: api_key=YOUR_API_KEY

Don’t forget to change YOUR_LIST_ID with your unique list ID!

PART 5: PULL SUBSCRIBER DATA INTO SHEETS

Now take our URL path and API key and fill in a new Request similar to part 3. You should end up with something that looks like this:

klaviyo-img8

And now you have a spreadsheet of all contacts from that particular list!

PART 6: MORE EXAMPLE API URLS

Go head over to the documentation for a more detailed list of possible endpoints. Otherwise, try messing around with the ones I’ve dug up below:

  • https://a.klaviyo.com/api/v1/metrics?api_key=YOUR_API_KEY
  • https://a.klaviyo.com/api/v1/person/PERSON_ID?api_key=YOUR_API_KEY
  • https://a.klaviyo.com/api/v1/campaigns?api_key=YOUR_API_KEY
  • https://a.klaviyo.com/api/v1/email-templates?api_key=YOUR_API_KEY

Leave a Comment