API_LIMIT error and no documentation to set parameters.

Hello,
I am using n8n.io to make some API calls to the Company search endpoint and am getting an API_LIMIT error:

The body is the following:

```

{
“filterGroups”: [
{
“filters”: [
{
“propertyName”: “school_id”,
“operator”: “HAS_PROPERTY”
}
]
}

],
“properties”:[“school_id”,“name”],
“limit”: 200,
“after”: 0

}

```

n8n has a pagination feature that allows you to page through results and I have it set to the following:

I have 16000+ total records that I need to search through for this request. My guess is that I need to make multiple requests that both stay under the 10000 limit, which I am fine doing, but I don’t see where to set that in the body parameters and HubSpot API does not seem to be responding to the n8n’s default parameters.

Grateful for any help!

Hi @JLoomis, I hope that you are well!
Thanks for asking the HubSpot Community!
I’d love to put you in touch with our Top Experts: Hi @sylvain_tirreau, @GLanker and @SteveHTM do you have suggestions to help @JLoomis, please?
Have a lovely day and thanks so much in advance for your help!
Bérangère, HubSpot Community Manager

Hi @JLoomis

As you are using the HubSpot Company search API, you just have to see the after value in the response if it is there, then there are more search results, and then you can use that in the parameter to get more results. Also, in the HubSpot bulk API, there is a limit of 100, not 200.

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!

Hi @JLoomis I’ve run into this before.

HubSpot’s Search API enforces two key constraints:

Each request can only return up to 100 records, not 200.

Each query is capped at 10,000 total results. Once you hit that ceiling, you’ll need to break your pull into smaller segments (for example, by filtering on createdate ranges).

To paginate, you’ll want to read the paging.next.after value from each response and pass that back into your next request. n8n’s pagination can work here, but HubSpot only respects the after parameter, not generic limit/offset paging. Docs here: (Accounts Dashboard | HubSpot)

So for your 16k+ records, you’ll need to loop:

Use limit: 100.

Capture the after value returned.

Keep iterating until the response no longer includes a paging.next.after.

If you still need beyond 10k records, add filters (like date windows) and run multiple searches.

HubSpot’s own guidance on record caps: Accounts Dashboard | HubSpot

For what it’s worth, one of the reasons we built Stacksync was exactly this: handling pagination, retries, and large dataset syncs automatically. Instead of coding around API caps or splitting queries yourself, Stacksync guarantees full coverage in real time and avoids the 10k wall by chunking intelligently in the background

Saves a lot of engineering hours when you’ve got big datasets.

Hope this clears it up, let me know if you need a concrete n8n setup example.

Hi Ruben @RubenBurdin,

This is very helpful; thank you. Just so that I make sure I understand, when you say add different filtering parameters, are you proposing a hack to essentially start a new search that would reset the total results returned? I am not sure I fully understand.
If that is the case, why wouldn’t I split the search into 3 searches that stop at increments of 900, or some equivalent number below 10000?
Thanks for your help!

Hi @JLoomis, I hope that you are well!
I just wanted to check, did the reply from @GRajput help or do you need additional assistance, please?
Also, @RubenBurdin do you have more context to share, please, to help @JLoomis?
Thanks and have a great day!
Bérangère