Get all lists, subscribers for list, subscribersInfo

968 views
Skip to first unread message

Igor

unread,
Feb 17, 2012, 7:59:57 AM2/17/12
to MailChimp API Discuss
Hello! My account have 30000+ subscribers. I have some scripts that
work with mailchimp. They require the full structure of all the lists
and subscribers. How can most quickly get the full structure of the
sheets and subscribers by API?
Now i use "getLists + for each list use listMembers + for each membe
use listMemberInfo" in all my scripts, but sometimes MailChimp return
me error 502 Bad Gateway.
Any thinks for optimize my requests?

jesse

unread,
Feb 17, 2012, 8:14:30 AM2/17/12
to MailChimp API Discuss
Really what you should be doing is syncing changes back and forth
rather than pulling down the full list every time you want it. See
write-ups #3 and #4 here:

http://apidocs.mailchimp.com/api/how-to/

For an initial sync, use lists() to pull all of your lists like you
are now, then use the Export API's list() method to dump everything:

http://apidocs.mailchimp.com/export/1.0/list.func.php

That doesn't mean you won't run into an API error like a 502 at some
point, so your code should be able to recover from any errors.


jesse

Igor

unread,
Feb 20, 2012, 5:26:16 AM2/20/12
to MailChimp API Discuss
Thanks! Now it works really faster.
Now i have only one long runs place of code. There i get lists for all
suscribers(api's method listsForEmail) in all lists. Maybe there's
some way to use another method to increase the execution and reduce
the number of requests to mailchimp?

jesse

unread,
Feb 20, 2012, 5:35:15 AM2/20/12
to MailChimp API Discuss
Don't do that? If you are exporting everything (you really should have
setup a sync) you already have that data and making a call to us is a
waste.


jesse
Reply all
Reply to author
Forward
0 new messages