APIs & Integrations

KHami-Eddine
Member

API call fails if "after" value is 10000

Hi everyone!

 

I am having an issue with an API call.

 

I am using the search endpoint to retrieve companies. As my search returns a lot of results (480,006), I loop and use the "after" property to read the data page after page.

 

All works fine until I reach the value after = 10000. I then get a 400 error. 

 

Any idea what may happen?

Here is the payload of the query:

 

{
"filterGroups":
 [{
  "filters":[{
   "propertyName":"hs_lead_status",
   "value":"UNQUALIFIED",
   "operator":"NEQ"}]
 }],
"sorts":["domain"],
"properties":["domain", "potential_tier", "semrush_check", "semrush_visits", "hs_lifecycle_stage", "cms", "industry", "sub_industry", "estimated_aov", "hs_lead_status", "is_sweet_spot_industry", "business_selling_model"],
"limit":100,
"after":10000
}

 

1 Reply 1
Jaycee_Lewis
Community Manager
Community Manager

API call fails if "after" value is 10000

Hi, @KHami-Eddine. This is the expected behaviour — “The search endpoints are limited to 10,000 total results for any given query. Attempting to page beyond 10,000 will result in a 400 error.” Search API —Limitations.

 

Best,

Jaycee

 

 

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot