# Using API to pull email data by contact

**URL:** <https://community.hubspot.com/t/using-api-to-pull-email-data-by-contact/82402>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [May 31, 2023, 8:41pm UTC](https://community.hubspot.com/t/using-api-to-pull-email-data-by-contact/82402 "2023-05-31T20:41:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Assoc-Sacto](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@Assoc-Sacto](https://community.hubspot.com/u/Assoc-Sacto)\
**Post date:** [May 31, 2023, 8:41pm UTC](https://community.hubspot.com/t/using-api-to-pull-email-data-by-contact/82402/1 "2023-05-31T20:41:04Z")

</div>

Hello,

I am looking for a way to pull marketing email data (opens, clicks, etc) by contact and by email.

The “email events overview” (/email/public/v1/events) only ties to campaign, not to individual email.

---

<div class="post-metadata">

**Author:** ![TomM2](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tomm2/32/70887_2.png) [@TomM2](https://community.hubspot.com/u/TomM2)\
**Post date:** [June 1, 2023, 12:09pm UTC](https://community.hubspot.com/t/using-api-to-pull-email-data-by-contact/82402/2 "2023-06-01T12:09:10Z")

</div>

Hey @Assoc-Sacto the endpoint you’ve mentioned should do this, I think the wording is confusing here as “campaigns” doesn’t mean a campaign set in the UI, it means a specific email that has been sent. You could do a [get all campaign IDs](https://legacydocs.hubspot.com/docs/methods/email/get_campaigns_by_id) for example to get the campaign IDs for each email sent. Then use those, or the recipient email through the events api to get events for the specific email by campaign ID or by the recipient email.
