# Export data to AWS datalake

**URL:** <https://community.hubspot.com/t/export-data-to-aws-datalake/16930>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [October 28, 2019, 8:36am UTC](https://community.hubspot.com/t/export-data-to-aws-datalake/16930 "2019-10-28T08:36:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirko\_ds](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mirko_ds/32/35608_2.png) [@mirko\_ds](https://community.hubspot.com/u/mirko_ds)\
**Post date:** [October 28, 2019, 8:36am UTC](https://community.hubspot.com/t/export-data-to-aws-datalake/16930/1 "2019-10-28T08:36:58Z")

</div>

Hi everyone,

our company has a datalake architecture on AWS with a classic stack lambda + athena + S3.

I’d like to transfer all the Hubspot data related to deals on our datalake during the night. I have considered this cases:

- using deals API that all the nights get all the data

- using deals API to have only the data of the last 24 hours

For rate limit reason, the second way is better but don’t garantee that nothing has been cancelled or updated on deals older than 24 hours.

Do you have some suggestions or use cases already realized for this scenario?

Thanks

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [October 29, 2019, 2:35am UTC](https://community.hubspot.com/t/export-data-to-aws-datalake/16930/2 "2019-10-29T02:35:57Z")

</div>

Hi [@mirko\_ds](https://community.hubspot.com/t5/user/viewprofilepage/user-id/104774),

When looking to retrieved deals that recently got updated/created, you can look into using this endpoint here: [Get Recent Deals | Deals API](https://developers.hubspot.com/docs/methods/deals/get_deals_modified) so that you do not have to use the get all deals endpoint and page through all the deals.

---

<div class="post-metadata">

**Author:** ![mirko\_ds](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mirko_ds/32/35608_2.png) [@mirko\_ds](https://community.hubspot.com/u/mirko_ds)\
**Post date:** [October 29, 2019, 9:30am UTC](https://community.hubspot.com/t/export-data-to-aws-datalake/16930/3 "2019-10-29T09:30:38Z")

</div>

Hi @WendyGoh ,

thanks for your feedback. The endpoint you linked it’s very good to understand the what is changed/created in last x time. How can I understand if something has been cancelled?

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [October 30, 2019, 1:36am UTC](https://community.hubspot.com/t/export-data-to-aws-datalake/16930/4 "2019-10-30T01:36:05Z")

</div>

Hi [@mirko\_ds](https://community.hubspot.com/t5/user/viewprofilepage/user-id/104774),

By cancelled do you mean that when a deal is being deleted? If that’s the case, currently the endpoint doesn’t return deleted deal. Any deal that returned from deals API hasn’t been deleted.

When looking to get notified of deleted deals, you can explore the HubSpot Webhook: [Webhooks API Overview](https://developers.hubspot.com/docs/methods/webhooks/webhooks-overview) and subscribe to the deal deletions events.

---

<div class="post-metadata">

**Author:** ![mirko\_ds](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mirko_ds/32/35608_2.png) [@mirko\_ds](https://community.hubspot.com/u/mirko_ds)\
**Post date:** [October 30, 2019, 8:03am UTC](https://community.hubspot.com/t/export-data-to-aws-datalake/16930/5 "2019-10-30T08:03:02Z")

</div>

Thanks again for your reply @WendyGoh .

Yes for cancelled I mean that a deal is being deleted.

Thanks for your support
