Skip to content

Mailchimp

Mailchimp is an all-in-one marketing platform that helps businesses manage and talk to their clients, customers, and other interested parties through email marketing campaigns, automated messages, and targeted ads.

ingestr supports Mailchimp as a source.

URI format

The URI format for Mailchimp is as follows:

plaintext
mailchimp://?api_key=<api-key>&server=<server-prefix>

URI parameters:

  • api_key: The API key used for authentication with the Mailchimp API
  • server: The server prefix for your Mailchimp account (e.g., us10, us19)

The URI is used to connect to the Mailchimp API for extracting data.

Setting up a Mailchimp Integration

To get your Mailchimp API credentials:

  1. Log in to your Mailchimp account
  2. Navigate to AccountExtrasAPI keys
  3. Create a new API key or use an existing one
  4. Note your server prefix from your API key (the part after the dash, e.g., us10 from xxxxx-us10)

Once you have your credentials, here's a sample command that will copy the data from Mailchimp into a DuckDB database:

sh
ingestr ingest --source-uri 'mailchimp://?api_key=your_api_key&server=us10' --source-table 'campaigns' --dest-uri duckdb:///mailchimp.duckdb --dest-table 'mailchimp.campaigns'

The result of this command will be a table in the mailchimp.duckdb database.

Tables

Mailchimp source allows ingesting the following sources into separate tables:

TablePKInc KeyInc StrategyDetails
account--replaceRetrieves account information including company details, account tier, and contact information.
account_exports--replaceRetrieves account export information.
audiencesiddate_createdmergeRetrieves audience (list) information including subscriber counts and list settings.
authorized_appsid-replaceRetrieves third-party applications authorized to access your account.
automationsidcreate_timemergeRetrieves automated email workflows and their configurations.
batches--replaceRetrieves batch operation status and results.
campaign_foldersid-replaceRetrieves folders used to organize campaigns.
campaignsidcreate_timemergeRetrieves email campaigns including their content, settings, and metadata.
chimp_chatter--replaceRetrieves recent activity feed from your Mailchimp account.
connected_sitesidupdated_atmergeRetrieves websites connected to your Mailchimp account.
conversationsidlast_message.timestampmergeRetrieves conversation threads from connected channels.
ecommerce_storesidupdated_atmergeRetrieves e-commerce store information including products and orders.
facebook_adsidupdated_atmergeRetrieves Facebook ad campaigns managed through Mailchimp.
landing_pagesidupdated_atmergeRetrieves landing pages created in Mailchimp.
lists_activity--replaceRetrieves recent activity for list members. Includes audiences_id reference.
lists_clients--replaceRetrieves email clients used by list members. Includes audiences_id reference.
lists_growth_history--replaceRetrieves historical growth data for the list. Includes audiences_id reference.
lists_interest_categories--replaceRetrieves interest categories (groups) for the list. Includes audiences_id reference.
lists_locations--replaceRetrieves geographic locations of list members. Includes audiences_id reference.
lists_merge_fields--replaceRetrieves custom merge fields defined for the list. Includes audiences_id reference.
lists_segments--replaceRetrieves segments (filtered subsets) of the list. Includes audiences_id reference.
reportsidsend_timemergeRetrieves campaign performance reports and analytics.
reports_advice--replaceRetrieves feedback and suggestions for improving campaign performance. Includes reports_id reference.
reports_domain_performance--replaceRetrieves email performance broken down by email domain. Includes reports_id reference.
reports_locations--replaceRetrieves geographic location data for campaign opens. Includes reports_id reference.
reports_sent_to--replaceRetrieves list of recipients who were sent the campaign. Includes reports_id reference.
reports_sub_reports--replaceRetrieves sub-reports for A/B test campaigns. Includes reports_id reference.
reports_unsubscribed--replaceRetrieves list of members who unsubscribed from the campaign. Includes reports_id reference.

Use these as --source-table parameter in the ingestr ingest command.

Examples

Ingesting Campaign Data

sh
ingestr ingest \
  --source-uri 'mailchimp://?api_key=your_api_key&server=us10' \
  --source-table 'campaigns' \
  --dest-uri duckdb:///mailchimp.duckdb \
  --dest-table 'mailchimp.campaigns'

The reports_advice table will include a reports_id column that references the parent campaign report.

The lists_segments table will include an audiences_id column that references the parent audience/list.

Notes

NOTE

Nested resources (e.g., reports_advice, lists_segments) automatically include a reference to their parent resource through an ID column (reports_id or audiences_id).