{"id":8299,"library":"mailchimp3","title":"Mailchimp3 Python Client","description":"mailchimp3 is a Python client library for interacting with version 3 of the Mailchimp API. It provides a straightforward interface to manage contacts, lists, campaigns, and other Mailchimp resources. The library is currently at version 3.0.21 and maintains an active development status with updates for API changes and bug fixes.","status":"active","version":"3.0.21","language":"en","source_language":"en","source_url":"https://github.com/charlesthk/python-mailchimp","tags":["mailchimp","email marketing","api client","marketing automation","python"],"install":[{"cmd":"pip install mailchimp3","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Used for making HTTP requests to the Mailchimp API.","package":"requests","optional":false}],"imports":[{"note":"The primary client class is directly importable from the top-level package.","wrong":"from mailchimp3.mailchimp import MailChimp","symbol":"MailChimp","correct":"from mailchimp3 import MailChimp"}],"quickstart":{"code":"import os\nfrom mailchimp3 import MailChimp\n\n# It's recommended to store API keys and usernames in environment variables\napi_key = os.environ.get('MAILCHIMP_API_KEY', 'YOUR_MAILCHIMP_API_KEY')\nusername = os.environ.get('MAILCHIMP_USERNAME', 'YOUR_MAILCHIMP_USERNAME') # Optional for basic auth\n\n# Initialize the MailChimp client\n# As of v2.1.0, arguments are mc_api and mc_user (username is optional)\nclient = MailChimp(mc_api=api_key, mc_user=username)\n\n# Example: Fetch all lists\ntry:\n    lists = client.lists.all()\n    print(\"Successfully fetched lists:\")\n    for l in lists['lists']:\n        print(f\"  - {l['name']} (ID: {l['id']})\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize the `MailChimp` client using an API key and an optional username, and then how to fetch all audience lists. It's best practice to use environment variables for sensitive credentials."},"warnings":[{"fix":"Update your client initialization to `MailChimp(mc_api='YOUR_API_KEY', mc_user='YOUR_USERNAME')`. If you're using basic authentication, `mc_user` is optional.","message":"The order of arguments for initializing the `MailChimp` client was reversed in version 2.1.0. Additionally, the authentication argument name changed from `mc_secret` to `mc_api`. The `username` argument (`mc_user`) became optional for basic authentication.","severity":"breaking","affected_versions":">=2.1.0"},{"fix":"Consolidate contacts into one master audience and utilize Mailchimp's tagging and grouping features for segmentation and targeted communication.","message":"Mailchimp is designed to work optimally with a single audience. Using multiple audiences can lead to duplicate contacts, inconsistent messaging, and increased costs. Instead, use tags or groups for segmentation within a single audience.","severity":"gotcha","affected_versions":"All"},{"fix":"Implement regular list cleaning processes and ensure all sign-up forms clearly communicate consent, following relevant data privacy regulations.","message":"Maintaining list hygiene is crucial. Regularly remove bounced emails, unsubscribed contacts, and inactive subscribers. Additionally, ensure all contacts have provided explicit consent for marketing, as failing to do so can lead to legal issues (e.g., GDPR, CAN-SPAM fines) and negatively impact email deliverability.","severity":"gotcha","affected_versions":"All"},{"fix":"Review your Mailchimp usage and consider upgrading to a paid plan or exploring alternative services if your needs exceed the new free plan limits and features.","message":"Mailchimp's free plan has significant reductions starting in 2026. The contact limit will drop to 250, monthly sends to 500, and features like automations, A/B testing, and email scheduling will be removed. This may necessitate upgrading to a paid plan for many users.","severity":"breaking","affected_versions":">=2026-01-01"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"When initializing the `MailChimp` client, use `mc_api='YOUR_API_KEY'` instead of `mc_secret='YOUR_API_KEY'`.","cause":"The authentication argument name changed from `mc_secret` to `mc_api` in `mailchimp3` v2.1.0 and later.","error":"TypeError: __init__() got an unexpected keyword argument 'mc_secret'"},{"fix":"Verify that the IDs (list ID, member ID, campaign ID, etc.) and template names used in your API calls are accurate and correspond to existing resources in your Mailchimp account.","cause":"Attempting to access a Mailchimp resource (e.g., a list, member, or campaign) with an incorrect or non-existent ID, or an invalid template name.","error":"mailchimp3.exceptions.MailChimpError: HTTP 404 Not Found (details: Resource Not Found)"},{"fix":"Ensure all required merge fields (e.g., FNAME, LNAME) are provided in the payload for member creation/updates, and that their names precisely match the case and type defined in your Mailchimp list settings.","cause":"Mailchimp list merge fields are often required and are case-sensitive. This error occurs if required merge fields are missing or if their names/values do not match the exact configuration in Mailchimp.","error":"mailchimp3.exceptions.MailChimpError: HTTP 400 Bad Request (details: Your merge fields were invalid.)"}]}