Klaviyo is a popular all-in-one email marketing, SMS marketing, web, and push notifications platform.

In this tutorial, I’ll show you how to connect the Klaviyo REST API to Google Sheets in 5 steps:

  1. Install the Apipheny Add-on
  2. Create a Private Klaviyo API Key
  3. Choose a Klaviyo API Endpoint URL
  4. Enter Your Klaviyo API Request into the Apipheny add-on
  5. Run the Klaviyo API request

Step 1.) Install and open the Apipheny Add-on in Google Sheets

To pull data from the Klaviyo API into Google Sheets, first install and open the Apipheny Google Sheets add-on.

Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs, save API requests, schedule API requests, and more. There’s a free trial included.

1. Install Apipheny by opening the following link on desktop and then clicking the Install button on the page: https://gsuite.google.com/marketplace/app/apipheny/966163326746

Install Apipheny to connect the Klaviyo API

2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons option in the top menu. In the add-ons menu, you should see Apipheny.

Click Apipheny > Import API to open the Apipheny add-on in your Google Sheet:

Opening the Apipheny add-on in Google Sheets
Opening the Apipheny add-on in Google Sheets

Step 2.) Create a Private Klaviyo API Key

First, log in to your Kalviyo account.

In the Dashboard section, click on your company name. Then, in the drop-down menu, click Account:

Go to your Account in your Klaviyo account
Go to your Account in your Klaviyo account

In the Account page, click the Settings menu, then click the API Keys option:

Click the API Keys option in your Klaviyo account settings
Click the API Keys option in your Klaviyo account settings

In the API Keys section, you will find your public API key and the private keys, if you have any.

To create a private API key, click the Create API Key button:

Create an API Key in your Klaviyo account
Create an API Key in your Klaviyo account

After your API key has been created, rename it by clicking the pencil button next to the No label text:

Rename your API key after creating it
Rename your API key after creating it

Complete the label field and then click the Save API Key button:

Don't forget to save your Klaviyo API key label
Don’t forget to save your Klaviyo API key label

Your API Key should now be labeled:

Labeled Klaviyo API key
Labeled Klaviyo API key

Now the important part of the step: copy and paste your Klaviyo API key somewhere safe, because you’ll need it in the next steps.

Step 3.) Choose a Klaviyo API Endpoint URL

In this section, I’ll show you how to browse the Klaviyo API documentation to find a Klaviyo API endpoint URL that retrieves the specific information you need from your Klaviyo account.

If you already know your Klaviyo API URL, or you want to use the same example URL as us, just skip to Step 4.

First, open the Klaviyo API documentation page: https://www.klaviyo.com/docs

In the menu on the left, in the API References section, you’ll see a list of available APIs:

Klaviyo API reference/documentation
Klaviyo API reference

For example, if you click the Profiles API, you’ll see a page containing the API authentication method and endpoints for that specific API:

Example Klaviyo API documentation
Example Klaviyo API documentation

An example endpoint for the Profiles API is the Retrieving a Person’s Attributes endpoint, which retrieves all the data attributes for a person (based on their Klaviyo Person ID). The corresponding API URL for this endpoint is:

https://a.klaviyo.com/api/v1/person/

where <PERSON_ID> is the Klaviyo Person ID.

Each endpoint’s documentation contains a descriptive title, a paragraph describing the endpoint’s purpose, the list of arguments it takes and a description of the expected response.

On a separate panel on the right, you should see the HTTP method (GET) and the URL, followed by an example request and its response:

Example Klaviyo endpoint documentation
Example Klaviyo endpoint documentation

Step 4.) Enter Your Klaviyo API Request Into the Apipheny add-on

Okay, now we’re in the home stretch. Now we need to enter the Klaviyo API request into the Apipheny add-on.

To do this, go back to your Google Sheet and make sure that the Apipheny add-on is open on the “Import” tab. With the Import Tab open, enter these details into the add-on:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) as required by your Klaviyo API endpoint. For this example, we are using the GET method.

API URL: In Step 3, I explained how you can find the Klaviyo API endpoint that you need. Now copy the complete API URL into the Apipheny add-on, where it says API URL Path (JSON / CSV), followed by any GET parameters required for your query.

For this example, we are using the Get Lists endpoint that displays a listing of all of the lists in an account. The corresponding URL for this endpoint is:

https://a.klaviyo.com/api/v2/lists?api_key=<your_api_key>

If you’re following the same example as us, just copy and paste the URL into the Apipheny add-on. But don’t forget to replace<your_api_key> with the same API key you previously obtained in Step 2. Do not include the carrots “<>”.

Headers are not required for this API request, so you can leave those fields blank in Apipheny.

Here’s what your API request will look like in Apipheny if you’re following the same example as us:

Klaviyo API request entered into the Apipheny add-on in Google Sheets
Klaviyo API request entered into the Apipheny add-on in Google Sheets

Step 5.) Run the Klaviyo API Request in your Google Sheet

The last step to get data from Klaviyo into Google Sheets is to click the Run button at the bottom of the Apipheny add-on, and then wait for your Klaviyo API data to be imported into your Google Sheet:

Klaviyo API data imported into Google Sheets using Apipheny
Klaviyo API data imported into Google Sheets using Apipheny

After making a successful request to the Klaviyo API, try querying a different Klaviyo API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:

  • Save and schedule your Klaviyo API request
  • Make a POST request to the Klaviyo API (if available)
  • Use the custom =APIPHENY() function to call the Klaviyo API request inside your spreadsheet
  • Create an API request by referencing the value of a cell in your Klaviyo API URL with three curly braces eg. {{{Sheet1!A1}}}

Related articles:

Related Posts