<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: offset / search api / more than 10000 results in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/offset-search-api-more-than-10000-results/m-p/1030670#M76045</link>
    <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/525639"&gt;@stheo&lt;/a&gt;&amp;nbsp;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.e after the first 100, add in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;"filterGroups": [
    {
      "filters": [
        {
          "propertyName": "hs_id",
          "operator": "NEQ",
          "values": [1, 2, 3, 4, 5]
        }
      ]
    }
]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then keep adding to the values array every loop. Would that work?&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2024 06:56:47 GMT</pubDate>
    <dc:creator>dannio</dc:creator>
    <dc:date>2024-08-22T06:56:47Z</dc:date>
    <item>
      <title>offset / search api / more than 10000 results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/offset-search-api-more-than-10000-results/m-p/925390#M71187</link>
      <description>&lt;P&gt;Hello HubSpot Community,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;URL: &lt;A href="https://api.hubapi.com/crm/v3/objects/deals/search" target="_new"&gt;https://api.hubapi.com/crm/v3/objects/deals/search&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt; &lt;SPAN class=""&gt;"limit"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;100&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;"after"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;10000&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;"sorts"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;""&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;"properties"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;[&lt;/SPAN&gt; &lt;SPAN class=""&gt;"manual_delivery_ticket"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;"hs_pipeline"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;"erp_contract_type"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;"actual_delivery_date"&lt;/SPAN&gt; &lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;"filterGroups"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;[&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt; &lt;SPAN class=""&gt;"filters"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt; &lt;SPAN class=""&gt;}&lt;/SPAN&gt; &lt;SPAN class=""&gt;]&lt;/SPAN&gt; &lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;However, this approach doesn't resolve the issue as it exceeds the 10,000 limitation.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Are we overlooking any existing solutions to address this issue?&lt;/LI&gt;&lt;LI&gt;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.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 20 Feb 2024 08:21:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/offset-search-api-more-than-10000-results/m-p/925390#M71187</guid>
      <dc:creator>stheo</dc:creator>
      <dc:date>2024-02-20T08:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: offset / search api / more than 10000 results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/offset-search-api-more-than-10000-results/m-p/925904#M71212</link>
      <description>&lt;P&gt;Hi, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/525639"&gt;@stheo&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; You raise a valid point.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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&lt;/P&gt;
&lt;P&gt;2. Adding your suggestion to the &lt;A href="https://community.hubspot.com/t5/HubSpot-Ideas/idb-p/HubSpot_Ideas" target="_blank"&gt;Ideas Community&lt;/A&gt; 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&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Jaycee&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 20:51:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/offset-search-api-more-than-10000-results/m-p/925904#M71212</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-02-20T20:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: offset / search api / more than 10000 results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/offset-search-api-more-than-10000-results/m-p/926189#M71234</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074"&gt;@Jaycee_Lewis&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thanks so much for the reply and your suggestion.&lt;/P&gt;&lt;P&gt;I just posted in ideas community &lt;A href="https://community.hubspot.com/t5/HubSpot-Ideas/Introduce-Offset-Parameter-in-HubSpot-API-for-Accessing-More/idi-p/926187#M169463" target="_blank" rel="noopener"&gt;here&lt;/A&gt; you will find the link.&lt;BR /&gt;&lt;BR /&gt;BR,&lt;/P&gt;&lt;P&gt;Spyros&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 09:39:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/offset-search-api-more-than-10000-results/m-p/926189#M71234</guid>
      <dc:creator>stheo</dc:creator>
      <dc:date>2024-02-21T09:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: offset / search api / more than 10000 results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/offset-search-api-more-than-10000-results/m-p/1030670#M76045</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/525639"&gt;@stheo&lt;/a&gt;&amp;nbsp;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.e after the first 100, add in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;"filterGroups": [
    {
      "filters": [
        {
          "propertyName": "hs_id",
          "operator": "NEQ",
          "values": [1, 2, 3, 4, 5]
        }
      ]
    }
]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then keep adding to the values array every loop. Would that work?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 06:56:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/offset-search-api-more-than-10000-results/m-p/1030670#M76045</guid>
      <dc:creator>dannio</dc:creator>
      <dc:date>2024-08-22T06:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: offset / search api / more than 10000 results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/offset-search-api-more-than-10000-results/m-p/1030752#M76050</link>
      <description>&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did however run into this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.hubspot.com/t5/APIs-Integrations/How-to-fetch-more-than-10-000-records-using-Hubspot-API/m-p/571539#:~:text=Once%20the%20after%20value%20reaches,need%20to%20restart%20your%20loop" target="_blank"&gt;https://community.hubspot.com/t5/APIs-Integrations/How-to-fetch-more-than-10-000-records-using-Hubspot-API/m-p/571539#:~:text=Once%20the%20after%20value%20reaches,need%20to%20restart%20your%20loop&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the idea is to use the object ID as a marker&lt;/P&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;{&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "propertyName": "hs_object_id",&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "operator": "GT",&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "{last id stored value (default to 0)}"&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;and grab the next set of 10000 from that (assuming you're grabbing in ascending order of ID rather than any other search)&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Aug 2024 10:29:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/offset-search-api-more-than-10000-results/m-p/1030752#M76050</guid>
      <dc:creator>dannio</dc:creator>
      <dc:date>2024-08-22T10:29:56Z</dc:date>
    </item>
  </channel>
</rss>

