# Get newly added contacts automatically using hubspot api

**URL:** <https://community.hubspot.com/t/get-newly-added-contacts-automatically-using-hubspot-api/15435>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [July 23, 2019, 10:05am UTC](https://community.hubspot.com/t/get-newly-added-contacts-automatically-using-hubspot-api/15435 "2019-07-23T10:05:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanskar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sanskar/32/68963_2.png) [@Sanskar](https://community.hubspot.com/u/Sanskar)\
**Post date:** [July 23, 2019, 10:05am UTC](https://community.hubspot.com/t/get-newly-added-contacts-automatically-using-hubspot-api/15435/1 "2019-07-23T10:05:58Z")

</div>

I want to get the contacts from hubspot database to my database using an api key everytime the user adds the new contact .

Howcan I retrieve this ? what will be the query?

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [July 23, 2019, 10:31am UTC](https://community.hubspot.com/t/get-newly-added-contacts-automatically-using-hubspot-api/15435/2 "2019-07-23T10:31:35Z")

</div>

Hello @Sanskar

For pulling new recently created contacts from HubSpot, you can make use of [Get recently created contacts](https://developers.hubspot.com/docs/methods/contacts/get_recently_created_contacts). It works well for both : API Key connection or oauth 2.0

Thanks
