Search API rate limits

The Search API documentation says that it has a limit of 4 requests per second per authentication token:

The Search API endpoints are rate limited to four requests per second per authentication token.

In my application, I use this API to search for contacts based on certain criteria. It so happens that the application needs to perform a lot of such requests and I am faced with the fact that I exceed the established limit.

In order to get around this limitation, I tried to implement a pool of access tokens, which are used with the round robin approach. However, even with this implementation I get a 429 error. Moreover, as it turned out, the error occurs even when a completely new token is used for the request. For example, if I execute 5 requests in 1 second, each of which uses its own separate access token, then the 5th request will still fail with the error: You have reached your secondly limit.

Perhaps I misunderstood the description from the documentation and an authentication token is not the same as an access token?

I would put some form of sleep() function in your code to wait a few milliseconds between your api calls to adhere to the rate limit.

Sorry @dsmarion but I think that is a bad solution. HubSpot needs to understand that we need e.g. 10 calls or 100 calls per second for search.

https://www.linkedin.com/posts/cbjerre_dear-hubspot-thanks-for-loosing-inbound-activity-7184077683075551233-Jqje

In my experience every API that I have ever used has some form of rate limits and your code must deal with them in my opinion. I mean HS can raise the limits in some calls, I get that. But you may think 10 is good while others think 100 is minimum and still others want unlimited. In the end I will craft my code to deal with them as best I can. It works for me, I don’t get rate limit errors any more.

Agree completely about limitations in most APIs @dsmarion

The search limitation here is not realistic to basic use cases for HubSpot. So an artificial limitation if you ask me.

You cannot find a contact without two searches as you need to search twice for an email in order to find a contact. Then you check if the contact has a deal etc.

That’s three searches for a simple item. And sometimes we have parallel calls from multiple free trials. Which make the search API be called more than 4 times in a second.

I agree the SearchCRM limit of 4 is too low. The other bad thing is that the SearchCRM does not return associations which I think if it did it would help solve the other issues of having to make so many calls. In SearchCRM results, everything I do after that are always batch calls if I can. I batch call for the associations and then batch the main calls.

Yes. And good point about the batch calls. That does add to my code’s complexity that I would like to keep as simple as possible.

So let us see if there will an update here.

I have the option to check on my end and reconcile as I have the original records, which then miss the contact and deal ids.

Hey @kronst

In HubSpot, an authentication token and an access token serve different purposes in the authentication process:

  1. Authentication Token: This is typically used during the OAuth authentication flow to obtain an access token. The authentication token is used as part of the initial request to authenticate and authorize the user or application. It’s like presenting your credentials at the entrance of a secure building. Once the authentication token is validated, it’s exchanged for an access token.
  2. Access Token: Once the authentication process is successful, an access token is issued. This token acts as a key that grants access to specific resources or data within the HubSpot platform on behalf of the user or application. It’s like receiving a passkey to enter different rooms within the secure building after your credentials are verified.

In summary, the authentication token is used initially to prove identity and gain authorization, while the access token is then provided as a secure means to access specific resources within the system once authentication is established.

Maybe this post can help with the error you are getting

https://community.hubspot.com/t5/APIs-Integrations/Daily-Rate-Limit/m-p/332148#M32182

Hope this helps

Hello, @Lucila-Andimol!

Thanks for the fulfilled answer. Now it’s more clear for me.

Well, then I’ll try to find any other ways to implement integration with HubSpot API from my application without hitting the rate limits.

I am loosing business DEAR HUBSPOT!!!

Message

Error: Uncaught (in promise): Object: {“responseStatus”:{“errorCode”:“HubSpotException”,“message”:“Error from HubSpot, Response = {\“status\”:\“error\”,\“message\”:\“You have reached your secondly limit.\”,\“errorType\”:\“RATE_LIMIT\”,\“correlationId\”:\”

Yesterday we had an influx of new free trials on our video learning platform uQualio (https://uqualio.com). A number of the accounts did not make it to HubSpot and our inbound marketing.
When will this limit be removed or at least increase to 10 or 100 per second???

https://community.hubspot.com/t5/APIs-Integrations/CRM-Search-API-Rate-Limit-Increase/m-p/765892