# Differences in gmail data when using hubspot api

**URL:** <https://community.hubspot.com/t/differences-in-gmail-data-when-using-hubspot-api/12582>\
**Category:** APIs & Integrations\
**Tags:** email\
**Created:** [January 24, 2019, 6:25am UTC](https://community.hubspot.com/t/differences-in-gmail-data-when-using-hubspot-api/12582 "2019-01-24T06:25:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vi\_Quyet](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vi_quyet/32/34870_2.png) [@Vi\_Quyet](https://community.hubspot.com/u/Vi_Quyet)\
**Post date:** [January 24, 2019, 6:25am UTC](https://community.hubspot.com/t/differences-in-gmail-data-when-using-hubspot-api/12582/1 "2019-01-24T06:25:12Z")

</div>

I use the email event api to get data about the number of mail sent to customers for a selected time period  
But the result returned is different from what is displayed on Hubspot UI  
How to use the data when using API matches the display on the email analysis

![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/e/2e300bceabb17b2d26554f7ab5c0d78b6e3876aa.png) [developers.hubspot.com](https://developers.hubspot.com/docs/methods/email/get_events)

### [Get email events | Email Events API](https://developers.hubspot.com/docs/methods/email/get_events)

GET /email/public/v1/events

The difference is quite high  
I need to get the correct data to make the report  
Please help me answer this issue, if you know how it works  
Thanks very much!

[

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/6/e682fd7a2eff1f35d5f0714dd784b462ed5cc2f3.png)

hubspot.png1184×375 39.9 KB

]([https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/c/c32b94c6acf7e6765d9773636bfe96b0d78249a2.png](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/c/c32b94c6acf7e6765d9773636bfe96b0d78249a2.png))

The document may match the image above get by Email Events API

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [January 28, 2019, 1:54pm UTC](https://community.hubspot.com/t/differences-in-gmail-data-when-using-hubspot-api/12582/2 "2019-01-28T13:54:33Z")

</div>

Welcome, [@Vi\_Quyet](https://community.hubspot.com/u/vi_quyet).

Happy to help.

Could you share the following?

1. Your Hub ID.
2. A link to the email campaign you’re seeing discrepancies with? (I want to compare the up-to-date API and UI data.)

---

<div class="post-metadata">

**Author:** ![Vi\_Quyet](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vi_quyet/32/34870_2.png) [@Vi\_Quyet](https://community.hubspot.com/u/Vi_Quyet)\
**Post date:** [January 28, 2019, 5:16pm UTC](https://community.hubspot.com/t/differences-in-gmail-data-when-using-hubspot-api/12582/3 "2019-01-28T17:16:03Z")

</div>

Thanks Takushi,

i used url : url = "[https://api.hubapi.com/email/public/v1/events?"](https://api.hubapi.com/email/public/v1/events?%22) + str(offset) + “hapikey=my\_key\_api&eventType=SENT&startTimestamp=1543597200000&endTimestamp=1546189200000&limit=1000”

and get result = 4189 with time start = 12/01/2018 and time end = 31/12/2018

Differential results 4189 - 4155 = 34  
Can you help me explain that difference ? Thanks so much!

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [January 31, 2019, 2:14pm UTC](https://community.hubspot.com/t/differences-in-gmail-data-when-using-hubspot-api/12582/4 "2019-01-31T14:14:32Z")

</div>

Hi, [@Vi\_Quyet](https://community.hubspot.com/t5/user/viewprofilepage/user-id/84894).

Apologies for the delayed response. Thank you for sharing that information.

It seems you are using slightly different `startTimestamp` and `endTimestamp`values than the email _Analyze_ tool you referenced. If you go to [this page](https://app.hubspot.com/email/480402/analyze/overview/emails?startDate=1543590000000&endDate=1546268399999&rangeKey=CUSTOM), it shows the same statistics you reference in your screenshot, including **4,155** sends.

The URL shows this report is generated with the `startDate=1543590000000`, which is 2 hours earlier than your `startTimestamp=1543597200000` and the `endDate=1546268399999`, which is almost a full day later than your `endTimestamp=1546189200000`, which only goes until 30 December instead of 31 December.

Since your timeframe is shorter, it contains fewer sends.

If you use the parameters:

- `startTimestamp=1543590000000`
- `endTimestamp=1546268399999`

Then I would expect the number of sends to match.
