# Very slow API response (property creation)

**URL:** <https://community.hubspot.com/t/very-slow-api-response-property-creation/62123>\
**Category:** APIs & Integrations\
**Tags:** companies, developer-tools, contacts\
**Created:** [August 2, 2022, 4:29am UTC](https://community.hubspot.com/t/very-slow-api-response-property-creation/62123 "2022-08-02T04:29:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YChen63](https://avatars.discourse-cdn.com/v4/letter/y/3d9bf3/32.png) [@YChen63](https://community.hubspot.com/u/YChen63)\
**Post date:** [August 2, 2022, 4:29am UTC](https://community.hubspot.com/t/very-slow-api-response-property-creation/62123/1 "2022-08-02T04:29:01Z")

</div>

Hi all,

I am writing a Python script for automating the process of creating a lot of properties in Hubspot. My code looks something like (taken from the tutorial shown in [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/crm/properties)

```lia-code-sample
client = hubspot.Client.create(api_key=API_KEY)

for program in programs:

 for month in range(1,13):

 property_create = PropertyCreate(name=f'name_{program}_{month}', label=f'name_{program}_{month}', type='number', field_type='number', group_name=GROUP_NAME, display_order=2, has_unique_values=False, hidden=False, form_field=True)

 try:
 api_response = client.crm.properties.core_api.create(object_type="Company", property_create=property_create)
 except ApiException as e:
 print("Exception when calling core_api->create: %s\n" % e)
 ......
 ......
 ... repetitive code for property create ...

```

when I checked the call log of my API key, the response time was very inconsistent. Sometimes it makes 3 calls within the same minute, sometimes it took up to 9-10 minutes just to make one call. Any idea why this might be happening and how I might be able to speed up the response time from the API call?

Please note that the above is a simplified version of my code (functionally the same, but I put some dummy names in the parameters).

---

<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:** [August 2, 2022, 4:56pm UTC](https://community.hubspot.com/t/very-slow-api-response-property-creation/62123/2 "2022-08-02T16:56:37Z")

</div>

Hi, @YChen63 👋 Thanks for reaching out. Let’s see if the community has any suggestions. Hey @JBeatty @KMurray @taran42 @MichaelC do you have any thoughts on how @YChen63 can optimize things?

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![KMurray](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kmurray/32/81360_2.png) [@KMurray](https://community.hubspot.com/u/KMurray)\
**Post date:** [August 2, 2022, 5:32pm UTC](https://community.hubspot.com/t/very-slow-api-response-property-creation/62123/3 "2022-08-02T17:32:31Z")

</div>

I have been in similar situations and typically HusSpot is not the issue based on the returns I am getting. If this were me, I would have another app with a simple call that I could loop N number of times to have a sample for a psuedo stress test. If all is well there I would move on to the next troubleshooting step. Given HubSpot is rarely the issue when it comes to performance, I would consider debugging, stepping through the code while including the libraries (I use VSCode - change the json for justmycode)…outside of that…not a lot to go on here.
