Loop through all contact list via API is very slow.

MarkN767
Occasional Participant

Loop through all contact list via API is very slow.

 First I am using .Net library. I understand that every API returns 50 contacts, and I need to click the link  rel="next" to get next 50 records. So I wrote a process to loop through all contacts, so it would return all contacts on one pageload. basically what  I did is programmatically jumping to next page when I get current page of 50 records. My process actually worked. I have about 70000 contacts, and the process did return me the right number of contacts. And now the only problem is that it took almost half an hour to load the page, I wonder if that is normal, is it really necessary to take such a long time to loop through 70000 records? 

1 REPLY 1
Elijah_G
Member

Hello,

 

With the Constant Contact API, it currently on fetches email addresses 50 at a time and there's not a way to change that number with the version 1 API. In addition, it does not sound incorrect that it would take that long to process 70,000 contacts as that is 1,400 GET requests that need to be processed by both of our systems.

 

We are currently working on a new version for our API that will enable you to collect up to 500 contacts per page. More information about this update should be available in the very near future.

 

In the meantime, one option I might suggest is to create a cached storage of your contact list locally that is refreshed once or twice a day by an automated script. This would allow you access to your 70,000 contacts on demand without needing to transmit them fresh from our servers every time you need to use the list.

 

If you have any questions for me, please fee free to reply to this post!

 

Sincerely,

Elijah G.

Tier 2 Support

Elijah G.
API Support Engineer
Developer Portal

View API documentation, code samples, get your API key.

Visit Page