Search API Connector Documentation
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.
There are 2 ways to connect to the Mailchimp API:
- Preset “Connect” button (OAuth) premium
- Personal API key. Please check the appendix for detailed instructions to retrieve your key.
Contents
- Before You Begin
- Part 1: Connect to the Mailchimp API
- Part 2: Create your API Request URL
- Part 3: Pull Mailchimp API Data into Sheets
- Part 4: Get More Mailchimp Data
- Part 5: Handle Pagination
- Part 6: API Documentation
- Appendix: Connect with a Mailchimp API Key
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Connect to the Mailchimp API
If you haven’t connected API Connector to Mailchimp before, you’ll first need to initiate the connection as follows:
- Open up Google Sheets and click Extensions > API Connector > Manage Connections.
- In the list of available connections, find Mailchimp and click Connect.
- You will be asked to authorize the connection. Click Allow.
- You’ll then be returned to your Google Sheet, and can verify that your connection is active in the Connections screen.
Part 2: Create Your Mailchimp API Request URL
We’ll first 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
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 accountYOUR_LIST_ID
: navigate to Audience > Preferences Center > Settings > Audience Name and Defaults. Once you click this, you’ll see your list ID (which they’ve now begun calling an “Audience ID”).
Part 3: Pull Mailchimp API Data into Sheets
Now let’s add our URL into API Connector.
- Open up Google Sheets and click Extensions > API Connector > Open.
- In the Create screen, enter the Request URL we just created
- Under OAuth, choose Mailchimp
- We don’t need any headers so just leave that section blank.
- Create a new tab and click Set current to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see your Mailchimp data populate the Mailchimp tab in your Google Sheet:
Part 4: Get More Mailchimp Data
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
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.

With API Connector, you can either set these up as separate requests or loop through them automatically with pagination handling (paid feature):
Offset parameter: offset
Limit parameter: count
Limit value: 1000
Run until: choose when to stop fetching data
Part 6: API Documentation
Official API documentation: https://mailchimp.com/developer/marketing/api/
To view/remove the connection, follow the instructions here: https://mailchimp.com/help/remove-an-application-from-your-account/
Appendix: Connect with an API Key
- As a free alternative to using the preset OAuth integration, you can connect with an API key. Log into your Mailchimp account and navigate to the API Keys section (or just click this link: https://us1.admin.mailchimp.com/account/api/)
- Click the Create A Key button
- You’ll now see your API key listed in a section titled “Your API keys”
- To use, under Headers, enter “Authorization” as your Key, and “apikey YOUR_API_KEY” as your Value, like this. Keep OAuth set to None as you’re authorizing with an API key.
why me just get 10 data from mailchimp?
The Mailchimp API documentation says:
Paginate your API requests to limit response results and make them easier to work with. We use offset and count in the URL query string to paginate because it provides greater control over how you view your data.
Offset defaults to 0, so if you use offset=1, you will miss the first element in the dataset. Count defaults to 10. For example, this URL includes query string parameters for pagination: https://usX.api.mailchimp.com/3.0/campaigns?offset=0&count=10
What this means is that by default, Mailchimp only provides 10 records at a time. To get more, change the parameters at the end of your URL, e.g.:
https://us20.api.mailchimp.com/3.0/campaigns?count=50
Then to get the next 50 results, you’d enter:
https://us20.api.mailchimp.com/3.0/campaigns?offset=50&count=50
Super product, kudos! Is there a possibility to work with arrays such as are provided through e.g. this (in emails >> activity):
https://usXX.api.mailchimp.com/3.0/reports/[campaign_id]/email-activity?count=500&fields=emails.campaign_id,emails.list_id,emails.email_address,emails.activity.timestamp,emails.activity.action,emails.activity.url,emails.activity.type
Thank you so much! I am working on an update now that will provide more options for displaying arrays and nested data. You can see more info here: https://mixedanalytics.com/knowledge-base/report-styles/
Will that work for you?
Oh yes! Looking forward to it!
This is now live : )
This is great! Thank you!
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?
Nope, Mailchimp only returns 1000 rows in a single call so you need to run multiple calls to retrieve all your records. API Connector automates this with pagination handling.
A pity that exporting poll results currently isn’t possible…
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.
Facing the following error:
Request failed: Attribute provided with invalid value: Header:HeaderKey
although I have followed this (https://mixedanalytics.com/knowledge-base/access-mailchimp-data-in-google-sheets/) article step by step and have double checked but still the error persists: Need help ASAP
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.
Hi,
How to get survey results?
Regards,
Michel.
Are survey results the same as poll results? If so, someone in the comments noted that this isn’t available via the API (you can see some more info on this here).
Thanks Ana.
Thanks for your quick reply 🙂
I already saw this info, but as it dated from 2018, I had hoped that Mailchimp had evolved in the meantime. So, it is not the case 🙁
From my point of view, a poll is inside emails and his results are values 0-10. The survey is done via a separate form, with others questions than having a answer 0-10: it could be radio-buttons, check-boxes…
Kind regards,
Michel.
Great product – haven’t looked yet – but hoping the upgrade extended usage time is not too much.
FYI The MailChimp playground link is dead. They have moved it and their logic: https://mailchimp.com/developer/release-notes/sunsetting-the-mailchimp-api-playground/
Thank you for letting me know! That’s a shame, it was a useful tool. I’ve just updated the article to remove the link.
Can you advice query url for getting a total number of subscribers currently in a specific list?
When you run a query like
https://us20.api.mailchimp.com/3.0/lists/32d8e317e4/members
, it returns a field called “total_items” that contains the number of subscribers in the list.Hey its returning contacts but not subscribers
I’m not totally clear on the difference, but I’d just check some of their lists endpoints, one of them should have what you’re looking for. For example their description for the
/lists/{list_id}
endpoint says “Get information about a specific list in your Mailchimp account. Results include list members who have signed up but haven’t confirmed their subscription yet and unsubscribed or cleaned.” Maybe that’s what you’re looking for?