# API call Performance problem

**URL:** <https://community.hubspot.com/t/api-call-performance-problem/101830>\
**Category:** APIs & Integrations\
**Tags:** object\
**Created:** [March 6, 2024, 10:47am UTC](https://community.hubspot.com/t/api-call-performance-problem/101830 "2024-03-06T10:47:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RajeshSV](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@RajeshSV](https://community.hubspot.com/u/RajeshSV)\
**Post date:** [March 6, 2024, 10:47am UTC](https://community.hubspot.com/t/api-call-performance-problem/101830/1 "2024-03-06T10:47:36Z")

</div>

Dea HubSpot community,

I am experiencing a considerable delay in retrieving a high number of Deals from HubSpot. The requirement is to fetch all the deals if the property ‘archived’ is False. Along with Deal properties, I like to merge more related properties such as customers, Framework agreements associated with the deal, and application status for the deals.  
1. First I am retrieving all the Deal IDs using v4/association/FA\_accepted\_ids/deal

2. With returned Deal IDs (count is 1400), adding filters, sorts, and properties.

3. Along with that adding limits (100) to call PublicObjectSearchRequest

4. Once the deal’s object is returned, to add further data to the same object, make separate batch API calls to fetch associated customers to the deal (by ID), Framework agreement, and application status. The final object is the desired result.

Steps 3 and 4 are repeated in the loop for every 100 data until the total size of 1400 is reached, so in this case it repeats 14 times.

I like to get a suggestion to improve these steps to achieve the results with less delay than what I am experiencing. Also wondering if HubSpot API has a similar method as SQL join and where clause so that instead of having multiple calls, with one call the desired object can be fetched.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [March 6, 2024, 9:57pm UTC](https://community.hubspot.com/t/api-call-performance-problem/101830/2 "2024-03-06T21:57:37Z")

</div>

Hey, @RajeshSV 👋 Thanks for the question. You’re on the right track with batching and multiple calls, since HubSpot’s API lacks SQL-like join capabilities, requiring multiple requests to gather related data.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![RajeshSV](https://avatars.discourse-cdn.com/v4/letter/r/77aa72/32.png) [@RajeshSV](https://community.hubspot.com/u/RajeshSV)\
**Post date:** [March 13, 2024, 7:14am UTC](https://community.hubspot.com/t/api-call-performance-problem/101830/3 "2024-03-13T07:14:25Z")

</div>

Thanks for the reply [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074)

Currently fetching the above-mentioned amount of data takes around 15 seconds and as the size of the data increases, so does the time. Is there no opportunity for further optimization of the aforementioned steps to achieve results more quickly?  
/ Rajesh
