Re: API- How to get the count of Leads in the List

Anonymous
Not applicable

API- How to get the count of Leads in the List

Hi,

I have a requirement, where I want to know the count of leads in  List.

I see API methods which can give me batch of Leads, but what I am interested in the total count in the list.

Thanks,

Siraj

5 REPLIES 5
Jim_Thao7
Level 9

Re: API- How to get the count of Leads in the List

When you pull the leads from the list using Get Multiple Leads by List Id » Marketo Developers just do a count on the returned arrays (arrays = leads) using whichever language you choose to use. 

Anonymous
Not applicable

Re: API- How to get the count of Leads in the List

Thank you for the response.

Assume if I have 1M leads in a List.

And Marketo API call will give me only 300 leads per call… so I need to make ~ 333 calls to get the total lead counts.

But what I am interested over here is to just know the count in the list.

Thanks,

Siraj

SanfordWhiteman
Level 10 - Community Moderator

Re: API- How to get the count of Leads in the List

Can't AFAIK.

A way to simulate this, if you are very thorough in making sure to catch both adds and deletes, is to create a special "resource lead" that holds metadata for the list.  Then you can have a score field on the resource lead that stores, as closely as possible, the number of leads currently in the list.  Update the resource lead itself via webhook.

Anonymous
Not applicable

Re: API- How to get the count of Leads in the List

No, I don't want to do that.

Should be there some simple way of doing this.

I just need to know the count in my static lists.

Thanks,

Siraj

SanfordWhiteman
Level 10 - Community Moderator

Re: API- How to get the count of Leads in the List

You should open an Idea.

The API is really lacking in aggregate actions (such as the count you want here).  As the API consumer, you essentially are limited to following cursors/checkpoints, from which (in your own separate database) you can create tables on which you can perform aggregate actions.