Print

Import MailerLite Data to Google Sheets

In this guide, we’ll walk through how to pull data from the MailerLite API directly into Google Sheets, using the API Connector add-on.

We'll first get an API token from MailerLite, and then set up a request to pull in metrics to your spreadsheet.

Contents

Before You Begin

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

Part 1: Get Your MailerLite API Key

  1. Log in to MailerLite
  2. Navigate to Integrations
  3. Choose MailerLite API
  4. Click "Generate new token"
  5. Give it a name and save
  6. Your key will now be displayed. Copy it and keep it safe; we'll use it shortly.

Part 2: Pull MailerLite API Data into Sheets

You can access any of the endpoints and parameters listed in the API documentation.  Here's an example request setup showing how to fetch campaign stats from your account. Substitute in your API key where it says your_key.

  1. Open up Google Sheets and click Extensions > API Connector > Open > Create request.
  2. In the request form enter the following:
    • ApplicationCustom
    • MethodGET
    • Request URLhttps://connect.mailerlite.com/api/campaigns?filter[status]=sent&limit=100
    • OAuth: None
    • Headers:
      • AuthorizationBearer your_key
  3. Create a new tab and click Set current to use that tab as your data destination.
  4. Name your request and click Run. A moment later you’ll see MailerLite data populate your sheet.
    mailerlite-response
  5. (Optional) By default, MailerLite returns a lot of fields you likely don't need. To simplify, open the field editor and filter out any fields you don't need in your report.

Part 3: Handle Pagination

By default, MailerLite limits the numbers of records per page, usually to 25. To get more, set the limit parameter to 100. To get more than that, cycle through records using pagination handling:

  • Pagination: page parameter
  • Page parameter: page
  • Run until: choose when to stop fetching data

Part 4: API Documentation

Official API documentation: https://developers.mailerlite.com/docs/

Leave a Comment

Jump To