APIs & Integrations

stheo
Participant

offset / search api / more than 10000 results

Résolue

Hello HubSpot Community,

In our business case, we encounter a need to access more than 10,000 results in our search API calls. Presently, we generate reports based on the last modified date of deals, updating our database daily with changed deals.

The challenge arises when the number of updated deals exceeds 10,000 on certain days, causing us to miss updates for more than 10,000 deals.

We propose introducing an offset parameter in the API call, where the limit and after parameters currently work only up to 10,000 results. Below is an example of the API call we envision:

URL: https://api.hubapi.com/crm/v3/objects/deals/search

 

{ "limit": 100, "after": 10000, "sorts": [""], "properties": [ "manual_delivery_ticket", "hs_pipeline", "erp_contract_type", "actual_delivery_date" ], "filterGroups": [ { "filters": [] } ] }

However, this approach doesn't resolve the issue as it exceeds the 10,000 limitation.

  1. Are we overlooking any existing solutions to address this issue?
  2. If not, is there a possibility of adding an offset feature to the API? We understand the need for limitations but seek the ability to iterate through multiple calls to access all updated results effectively.
0 Votes
1 Solution acceptée
dannio
Solution
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

offset / search api / more than 10000 results

Résolue

Actually, sorry nevermind. There's a limit to how many you can have in a NOT_IN filter and also the initial request would be too long to process anyway.

 

I did however run into this:

https://community.hubspot.com/t5/APIs-Integrations/How-to-fetch-more-than-10-000-records-using-Hubsp....

 

So the idea is to use the object ID as a marker

 {
          "propertyName": "hs_object_id",
          "operator": "GT",
          "value": "{last id stored value (default to 0)}"
        }
 
and grab the next set of 10000 from that (assuming you're grabbing in ascending order of ID rather than any other search)

Voir la solution dans l'envoi d'origine

0 Votes
4 Réponses
dannio
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

offset / search api / more than 10000 results

Résolue

@stheo bit late to the party, but my idea to get around this is to do an initial search, then every time the intial 100 has been processed, take the IDs of those 100 and make a filter to not include them in the next search.

 

i.e after the first 100, add in:

 

"filterGroups": [
    {
      "filters": [
        {
          "propertyName": "hs_id",
          "operator": "NEQ",
          "values": [1, 2, 3, 4, 5]
        }
      ]
    }
]

 

Then keep adding to the values array every loop. Would that work?

0 Votes
dannio
Solution
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

offset / search api / more than 10000 results

Résolue

Actually, sorry nevermind. There's a limit to how many you can have in a NOT_IN filter and also the initial request would be too long to process anyway.

 

I did however run into this:

https://community.hubspot.com/t5/APIs-Integrations/How-to-fetch-more-than-10-000-records-using-Hubsp....

 

So the idea is to use the object ID as a marker

 {
          "propertyName": "hs_object_id",
          "operator": "GT",
          "value": "{last id stored value (default to 0)}"
        }
 
and grab the next set of 10000 from that (assuming you're grabbing in ascending order of ID rather than any other search)
0 Votes
Jaycee_Lewis
Gestionnaire de communauté
Gestionnaire de communauté

offset / search api / more than 10000 results

Résolue

Hi, @stheo 👋 You raise a valid point. 

 

1. You are not missing an option. The documentation states the limit (as you noted) but there is not a workaround or current way to extend this limit

2. Adding your suggestion to the Ideas Community and getting some upvotes is our best move for getting your suggestion in front of the Product team. If you add a link back to your Idea post, I'll give it an upvote to help get the ball rolling

 

Best,

Jaycee


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Votes
stheo
Participant

offset / search api / more than 10000 results

Résolue

Hi @Jaycee_Lewis ,

Thanks so much for the reply and your suggestion.

I just posted in ideas community here you will find the link.

BR,

Spyros

0 Votes