I'm using mailchimp to display all my email address from an audience, to do so, I'm using this code:
const client = require("@mailchimp/mailchimp_marketing");
client.setConfig({
apiKey: "MY API KEY",
server: "MY SERVER",
});
const run = async () => {
const response = await client.lists.getListMembersInfo("LIST MEMBERS CODE");
i = 0
while (i < response.members.length){
finalObject = Object.values(response.members[i]);
console.log(finalObject[1]);
i++
}
};
run();
"MY API KEY", "MY SERVER" and "LIST MEMBERS CODE" are fake one here, I have the real ones in my code.
My problem is that the terminal only display 10 items, and I have 1058 total_items
.
I know that the problem is count
that is 10 by default but I don't know how to change it because I don't have any URL to call the API.
Is there any other way to display all items by changing the number of count
?
I also know that the maximum items to display is 1000 so I have to do it twice to display all 1058 items.