SOLVED

programmatically get smart list total people count

Subscribe
Go to solution
dtavangar
Level 2

programmatically get smart list total people count

Hello all, I understand there are no API endpoints available to get the total people to count for Smart-lists. I was wondering if anyone has found a workaround for this. I am more looking for a programmatic approach. Would it be possible to create a batch campaign to add the Smart-list members to a list (list name would be predefined) and then query the list by name to get the total member count? any other approaches? 

 

Thank you In advanced. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: programmatically get smart list total people count

You could have a nightly batch that passes all members of the Smart List through a webhook-compatible service. The service would merely increment a counter variable for every call. (And of course you’d want to zero out the counter each day.) Then you’d query the service instead of Marketo. It’s pretty easy to set up but obviously is outside of Marketo proper.

 

Then again, depending on the typical size of your Smart List, you could just enqueue the SL each day using the Bulk Export API + smartListId filter and poll the status. The status.json endpoint returns a numberOfRecords value. The issue with this is large SLs take a long time to export. Since you don’t ever need the file itself, that’s a lot of wasted time/resources, especially if you’re running other export jobs.

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: programmatically get smart list total people count

You could have a nightly batch that passes all members of the Smart List through a webhook-compatible service. The service would merely increment a counter variable for every call. (And of course you’d want to zero out the counter each day.) Then you’d query the service instead of Marketo. It’s pretty easy to set up but obviously is outside of Marketo proper.

 

Then again, depending on the typical size of your Smart List, you could just enqueue the SL each day using the Bulk Export API + smartListId filter and poll the status. The status.json endpoint returns a numberOfRecords value. The issue with this is large SLs take a long time to export. Since you don’t ever need the file itself, that’s a lot of wasted time/resources, especially if you’re running other export jobs.