Where can I retrieve the total number of contacts


Is there a way to get the total number of contacts from the get all contacts API?


@codebuster we don’t have a way to just get the current contact total for a portal, so if you’re running a sync job you’d need to page through the contacts until you received a response with "has-more" : false can count the contacts as you go.

Is there anything specific that you’d just want the count for?


When displaying all contacts from the api to our portal internally, I would like to incorporate a percentage loading indicator. To do that I’ll need to know ahead of time how many contacts are in the database.


Hi @dadams. Is this functionality still not available? I, like @codebuster, am trying to build a loading screen while downloading contacts/companies/etc and without knowing in advance how many there are I would have to download objects twice to be able to implement a loading screen.
Thank you for your help!


Hey y’all, look what I found: http://www.marinamele.com/2014/02/how-to-use-hubspot-api-with-python.html

I’m trying to do the same as others on the thread (offer a “progress bar” while importing contacts from HubSpot). It seems from the above post that HubSpot has (had?) a legacy API giving the total number of contacts in the portal: https://api.hubapi.com/contacts/v1/contacts/statistics. Didn’t try it yet (hopefully it still works - fingers crossed!), but I wanted to throw the information out there to help others.


Does anyone know if the legacy statistics endpoint still works? This would be SUPER helpful for tons of HubSpot integrations. I mean, it helps everyone improve their UX for syncing. I find most customers are surprised it takes a long time to sync their contacts. A progress bar would give a realistic expectation and allow us to give time estimates based on both total contacts and api request time, an easy calculation.

Please please please add/revive this!!!


We need the "total number of objects" too for the same reason (i.e., displaying a percentage progress indicator). We need it for contacts, deals, and hopefully other objects too. For large data set, paging through and loading many pages of data could take a while (especially with the usage cap like 10 API calls per second). Being able to display a percentage progress indicator dramatically improves the end user experience. Please add "total number"! It will be very helpful!! Thanks!