Search API Connector Documentation

Print

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.

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Get Your Klaviyo API Key

  1. From the dashboard, open the account menu in the top right and click Account.
    klaviyo-apikey-img1
  2. In the account menu, click Settings > API Keys
    klaviyo-apikey-img2
  3. Click Create Private API Key
    klaviyo-apikey-img3
  4. You’ll now see your API key. Copy that down as we’ll use it in all our requests.
    klaviyo-apikey-img4

Part 2: Create Your API Request API URL

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

The full request URL should look like this:

https://a.klaviyo.com/api/v2/lists?api_key=YOUR_API_KEY

Part 3: Pull Klaviyo API Data into Sheets

Now let’s copy that URL into API Connector.

  1. Open up Google Sheets and click Extensions > API Connector > Open.
  2. In the Create screen, enter the Request URL we just created:
    klaviyo-img5
  3. Run the request, and you will get back a table showing all of your lists and their respective IDs.
    klaviyo-img6
  4. You can now put those list IDs in a different API request to get all of the contacts in that list. Let’s do that now.

Part 4: 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/S9YQHL/members/all
  • Query string: api_key=YOUR_API_KEY

The full request URL should look like this:

https://a.klaviyo.com/api/v2/group/S9YQHL/members/all?api_key=YOUR_API_KEY

Just substitute in your own list ID.

Part 5: Pull Subscribers into Google 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

Part 7: API Documentation

Official API documentation: https://www.klaviyo.com/docs

Previous Import Jira Data to Google Sheets
Next Import KoBoToolbox Data to Google Sheets

3 thoughts on “Import Klaviyo Data to Google Sheets”

  1. I’d like the query to pick up parameters fromt he spreadsheet.

    At the moment I have to edit the query to to change the data range. I’d like to be able to get the query from a cell in the spreadsheet whenever it’s run, so that the date ranges int he query are different every time it’s run.

    Reply

Leave a Comment

Table of Contents