Import Mailchimp Data to Google Sheets

In this guide, we’ll walk through how to pull data from the Mailchimp API directly into Google Sheets, using the API Connector add-on for Google Sheets. We’ll first get an API key from Mailchimp, and then set up a request to pull in email campaign details from your Mailchimp account to your spreadsheet.

PART 1: GET YOUR MAILCHIMP API KEY

  1. Log into your Mailchimp account and navigate to the API Keys section (or just click this link: https://us1.admin.mailchimp.com/account/api/)
  1. Click the Create A Key button
    mailchimp-api-img1
  2. You’ll now see your API key listed in a section titled “Your API keys”
    mailchimp-api-img2
  3. Congrats, that’s it! You now have access to the Mailchimp API, and can start pulling Mailchimp data into Google Sheets.

PART 2: CREATE YOUR MAILCHIMP API REQUEST URL

We’re going to follow the Mailchimp API documentation to retrieve information about members in an email list.

Base URL: https://YOUR_DATA_CENTER.api.mailchimp.com/3.0
Endpoint: /lists/YOUR_LIST_ID/members

Putting it all together, we get the full API Request URL:

https://us20.api.mailchimp.com/3.0/lists/32d8e317e4/members

Of course, you’ll need to substitute in your own values for YOUR_DATA_CENTER and YOUR_LIST_ID, which you can find as follows:

  • YOUR_DATA_CENTER: check the URL when you’re logged in to your Mailchimp account
    mailchimp-api-img4
  • YOUR_LIST_ID: navigate to Settings > Audience Name and Defaults. Once you click this, you’ll see your list ID (which they’ve now begun calling an “Audience ID”).
    mailchimp-api-img3

PART 3: PULL MAILCHIMP API DATA INTO SHEETS

We’re now ready to enter all our values into API Connector and import Mailchimp data into Google Sheets.

  1. Open up Google Sheets and click Add-ons > API Connector > Open.
  2. In the Create screen, enter the Request URL we just created
    mailchimp-api-img5
  1. Under Headers, enter “Authorization” as your Key, and “apikey YOUR_API_KEY” as your Value, like this:
    Authorizationapikey YOUR_API_KEY
    It should look like this:

    mailchimp-api-img6

  2. Create a new tab and click ‘Set current’ to use that tab as your data destination.
  3. Name your request and click Run. A moment later you’ll see your Mailchimp data populate the Mailchimp tab in your Google Sheet:
  4. mailchimp-api-img7

PART 4: GET MORE MAILCHIMP DATA

  1. If you want to see other data, like a list of campaigns, you’d just change the endpoint. For example, this URL will produce a list of campaigns:
    https://us20.api.mailchimp.com/3.0/campaigns
  2. The Mailchimp API Playground is a great resource to test out different API calls.

PART 5: HANDLE PAGINATION

Note Mailchimp’s limits on the number of records returned on a response. By default, only 10 records will be returned unless you use the ‘count’ and ‘offset’ parameters as described in their documentation.

mailchimp-api-img8

To get more records, use the ‘count’ and ‘offset’ parameters, like this:

page 1: https://us20.api.mailchimp.com/3.0/campaigns?offset=0&count=1000
page 2: https://us20.api.mailchimp.com/3.0/campaigns?offset=1000&count=1000

With API Connector, you can either set these up as separate requests or loop through them automatically with pagination handling (paid feature).

13 thoughts on “Import Mailchimp Data to Google Sheets”

  1. This is great!

    Is there a more efficient way to retrieve data count with 60,000 + rows rather than running the api request 65 times?

    Reply
    • I didn’t know that, but just checked and confirmed that poll data doesn’t seem to be available in the API. That’s unfortunate. Thanks for letting me know.

      Reply
    • This error means there’s an incorrect value into the Header field. Can you please make sure you haven’t included any typos or extra spaces at the beginning or end? If you’d like me to take a look, please feel free to message me a link to your sheet.

      Reply

Leave a Comment