Search code examples
mailchimp-api-v3.0

How do I search Mailchimp for all members with a specific command using their API


Some of my members share a specific tag I have assigned them - ie: tag123

What api command can I use to retrieve all members who have this tag assigned to them?


Solution

  • You can try using the search-members GET API call with the specific tag set in the query field. (More on https://developer.mailchimp.com/documentation/mailchimp/reference/search-members/#read-get_search_members)

    e.g.

    curl --request GET \
    --url 'https://usX.api.mailchimp.com/3.0/search-members?query=tag123' \
    --user 'anystring:apikey' \
    --include