# Get all deals using API in python

**URL:** <https://community.hubspot.com/t/get-all-deals-using-api-in-python/48639>\
**Category:** APIs & Integrations\
**Tags:** python, object\
**Created:** [December 16, 2021, 1:43am UTC](https://community.hubspot.com/t/get-all-deals-using-api-in-python/48639 "2021-12-16T01:43:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ppat12](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@ppat12](https://community.hubspot.com/u/ppat12)\
**Post date:** [December 16, 2021, 1:43am UTC](https://community.hubspot.com/t/get-all-deals-using-api-in-python/48639/1 "2021-12-16T01:43:17Z")

</div>

Hi I am a beginner in HubSpot.

I have few doubts.

I currently have a google app script that fetches all deals data from HubSpot using api.

I want to recreate the same output using python.

# GS

var response = UrlFetchApp.fetch(‘[https://api.hubapi.com/crm/v3/objects/deals/search?hapikey=my\_apli\_key](https://api.hubapi.com/crm/v3/objects/deals/search?hapikey=my_apli_key)’, options);

Problems:

1. I went through API doc on Hubspot, I could only get limited help.

I used the template to fetch some deals but these deals have only 6-7.

2 . Paging association, how to use that? I am only able to get 100 deals at a time. But I have more than 1000 deals.

If anyone could help with resources for the same, that would be great.

 ![API get call.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/a/a/aad39548348bd927cff738a2a212b4f3ae67cacd.png)  
# python GET code  
 ![properties.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/e/e2bc5812eba34a41aacf0a8b41bfc44aad24e054.png)  
# properties in Deals API response

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [December 17, 2021, 6:34pm UTC](https://community.hubspot.com/t/get-all-deals-using-api-in-python/48639/2 "2021-12-17T18:34:49Z")

</div>

@JBeatty , @Venky1 , either of you all able to help here? 😀

---

<div class="post-metadata">

**Author:** ![HedgeDolph](https://avatars.discourse-cdn.com/v4/letter/h/b9e5f3/32.png) [@HedgeDolph](https://community.hubspot.com/u/HedgeDolph)\
**Post date:** [March 31, 2022, 5:22pm UTC](https://community.hubspot.com/t/get-all-deals-using-api-in-python/48639/3 "2022-03-31T17:22:52Z")

</div>

A few things, can you not just change the limit amount in your params? also your commented out print statment should be

print(response.json())

if you cant do more then 100 at a time, do a while loop and change the index each time
