Error on contacts search over 10,000 when using pagination

Started to get the following error when trying to fetch all contacts via empty search.

An error has occurred while calling a HubSpot service. Unknown Contacts Search API failure: [400] {“status”:“error”,“message”:“Result window is too large, count + offset must be less than or equal to: 10000 but was 10100. See the scroll api for a more efficient way to request large data sets.”}

It seems there’s a limit on the number of row we can fetch even through pagination. But I am not sure how and where to look for the scroll api. I couldnt find information regarding that in Hubspot documentation. Though ElasticSearch do provide some scroll features on fetch.

So can I use the Elastic search properties on Hubspot API?.

Other than that If I use get all contacts API of hubspot would this problem still exist?

Hi @musman , yes this API isn’t designed to fetch all contacts, and will return either 10,000 contacts or however many objects match your query - whichever comes first. The best way to fix this would just be to use the get all contacts endpoint, which will not throw this error - you can get as many contacts as you want with it.

As for your elasticsearch question, it appears this endpoint does support this, and the scroll api can be found here: Scroll | Elasticsearch Reference [5.4] | Elastic, but I’ll have to doublecheck that

Yes I have used the get all contacts endpoint and its working find. Thanks

Hey Connor,

I too need to search more than 10,000 contacts

The problem with using get all contacts endpoint is it does not allow filtering the data. Is there a solution?

I want get more than 10000 contact from api,and there accociate company id as well
Is there any solution

I also would like to fetch more that 10,000 contacts using the search API. By limiting the results of the API, I’ll have to double my develpment efforts by first pulling all contacts, then filtering out the contacts that would not fit my search criteria, then finally use the search to pull recently modified contacts that meet my search criteria. Please consider removing the 10000 limit on the API. Also the version 3 tells me there was a proboem with the request, but I had to search here to confirm that there was a limit as I did not find the 10000 limit documented on the V3 contact search endpoint.

Hello,
Shawn here from Hubspot -- posting on behalf of a customer to increase the bandwidth of this API limit. There is also currently nowhere in the developer documentation that shows this limit and what the specific message customers should expect to see with regards to the offset error.
For your consideration please.

Requiring us to use the list API to pull the entire contents every time is a strain on both of our ends. I would like to second the comment that asks to remove this limit.