I am trying to achieve a count of contacts created between two dates, similar to the Contacts Statistics API but with a date range input. No contact data is needed, just the number of contacts created.
Is there an API suitable please? Some API’s seem adequate, although anything with more than just statistical data is limited to 100 contacts which will obviously be an issue.
Contacts Statistics Info from the legacy docs:-
Hi @Knight-Digital 
You’ll likely want to use the CRM Search API. Your request might look something like this:
{
"limit": 0,
"filterGroups": [
{
"filters": [
{
"propertyName": "createdate",
"operator": "GTE",
"value": "2022-07-01"
},
{
"propertyName": "createdate",
"operator": "LTE",
"value": "2023-09-13"
}
]
}
]
}
Where your time window “start date” is the first filter
(“GTE” is greater than or equal to)
and your “end date” is the second filter
(“LTE” is less than or equal to)
. As per your described case, specifying “limit”: 0 makes it so that no Contact data is returned, while still giving you a count of the Contacts that fit the criteria. An example response will look like:
{
"total": 9,
"results": [],
"paging": {
"next": {
"after": "0"
}
}
}
Where the number of Contacts that meet my search criteria is 9.
I hope this proves useful. Please let me know if you have any follow-up questions.
Hey, @zach_threadint
I was thinking about the Search API too. And using the BETWEEN filter.
My gut feeling is this user only needs “count of contacts created” within a specific range, not the contact details.
I can think of at least one hacky workaround, but it’s not programmatic. And it may not be scaleable, depending on their expected polling frequency and volume.
- Create an Active List
- Set two filters – ID is known + create date is between X and Y
- Make a request to the Lists API which will return a count
I’d love to hear how others would approach this.
Best,
Jaycee
Hi @Jaycee_Lewis 
Yes absolutely, the BETWEEN operator on the CRM Search API call would work too. And interesting idea on using the Lists API, that could also work 
As previously mentioned, setting “limit” to “0” on a CRM Search API request results in no Contact records being returned. In this case, it only returns the “total” number of records that fit the search criteria.
Hey, @zach_threadint! You are 100% correct. And I didn’t slow down and fully read your answer. That’s 100% on me.
Thanks for the solution, I’ll definitely keep it in my back pocket.
Best,
Jaycee
Thank you Zach, this worked perfectly for my initial requirements. Although there are some sites/locations which contacts are categorised into, I am waiting for a reply to find out how this is handled - I wonder if there is another filter or similar method that could be set on any field? I notice that it appears that the contacts filters are limited to ‘firstname,lastname,email,lastmodifieddate,hs_object_id, createdate’
Hi @Knight-Digital 
The CRM Search API allows you to filter on
(practically)
any property of the specified object-type. As per the documentation, you can combine filters/filter groups to achieve “AND” and/or “OR” logic using multiple search criteria.
If you have any follow-up questions, please let me know.
Hi there,
I have seen alot of coding suggestions for this problem however i have just discovered an intergration called Tick Tock Today create by Happily that might be able to solve this problem!
(I have been searching for a non coding solution to this problem as having a similar issue!)
Hope it helps!