# Fetch records asynchronously

**URL:** <https://community.hubspot.com/t/fetch-records-asynchronously/120659>\
**Category:** APIs & Integrations\
**Tags:** python\
**Created:** [November 15, 2024, 10:05pm UTC](https://community.hubspot.com/t/fetch-records-asynchronously/120659 "2024-11-15T22:05:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JVermunt](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@JVermunt](https://community.hubspot.com/u/JVermunt)\
**Post date:** [November 15, 2024, 10:05pm UTC](https://community.hubspot.com/t/fetch-records-asynchronously/120659/1 "2024-11-15T22:05:14Z")

</div>

Hi there,  
I am building an integration using custom coded action, and in one I need to fetch all product ids to check whether the records should be inserted or updated, for this I can fetch all records using the paging parameter:

```lia-code-sample
{'next': {'after': '31481613535',
 'link': 'https://api.hubapi.com/crm/v3/objects/products?limit=100&properties=ts_product_id&archived=False&after=31481613535'}}
{'next': {'after': '31481615555',
 'link': 'https://api.hubapi.com/crm/v3/objects/products?archived=False&limit=100&after=31481615555&properties=ts_product_id'}}
{'next': {'after': '31485213942',
 'link': 'https://api.hubapi.com/crm/v3/objects/products?archived=False&limit=100&after=31485213942&properties=ts_product_id'}}

```

However, I would like to call the records asynchronously, but there does not seem to be a reliable method to determine beforehand what the ‘after’ parameter should be, making this seemingly impossible.  
Is there a way to make list call in an asynchronous fashion?

---

<div class="post-metadata">

**Author:** ![Bhupendra\_Kumar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bhupendra_kumar/32/67536_2.png) [@Bhupendra\_Kumar](https://community.hubspot.com/u/Bhupendra_Kumar)\
**Post date:** [November 16, 2024, 3:14pm UTC](https://community.hubspot.com/t/fetch-records-asynchronously/120659/2 "2024-11-16T15:14:02Z")

</div>

hi @JVermunt ,

Here’s the curl you can use that will give you products list with ID’s

```lia-code-sample
curl --request GET \
 --url 'https://api.hubapi.com/crm/v3/objects/products?limit=10&archived=false' \
 --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

```

for reference you can check =[Accounts Dashboard | HubSpot](https://developers.hubspot.com/beta-docs/reference/api/crm/objects/products#basic)  
you can define the after parameter also in this reaquest . It will be the last product id you recieved.  
and also limit as well to set number of records to be fetched .  
If it helps you. Then mark it as a solution so that it can help other comunity members .

---

<div class="post-metadata">

**Author:** ![JVermunt](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@JVermunt](https://community.hubspot.com/u/JVermunt)\
**Post date:** [November 28, 2024, 6:55pm UTC](https://community.hubspot.com/t/fetch-records-asynchronously/120659/3 "2024-11-28T18:55:24Z")

</div>

I want make the calls asynchronously, this does not answer my question.
