Discrepancy in YouTube Analytics and YouTube Data APIs

时间:2019-04-08 13:42:44

标签: youtube-api youtube-data-api youtube-analytics-api youtube-analytics

We have an application in C# that makes use of YouTube Analytics and YouTube Data APIs to gather analytics for certain videos of a specific channel. We fetch the data for each API and store it in the database. The analytics api gives us data daily, while youtube data gives us total data.

Initially, we only used the Analytics API in order to generate a chart with all analytics data. However, there was a delay of 2 days and the client requested us to fix it. YouTube Data API seemed to be the solution. We assumed both APIs would have the same values except the 2 day difference. We could fetch data each day in specific times and then just equalize the two values. However, this shows weird discrepancies.

Sum of daily values for YouTube Analytics (without last 2 days)

|    Metric    | Value  |
|--------------|--------|
| CommentCount |   4476 |
| DislikeCount |   4894 |
| LikeCount    |  25586 |
| ViewCount    | 640124 |

Values from YouTube Data API (last two days are 2019-03-19 and 2019-03-20)

| Capture Date | CommentCount | DislikeCount | LikeCount | ViewCount |
|--------------|--------------|--------------|-----------|-----------|
| 2019-03-20   |         8433 |         4787 |     25161 |    642968 |
| 2019-03-19   |         8425 |         4778 |     25104 |    641455 |
| 2019-03-18   |         8412 |         4776 |     25085 |    640906 |

Discrepancy

CommentCount form YouTube Data for 2019-03-18 was 8412, while summing for YouTube Analytics was 4476. I expected these values would be the same. When looking at the video this data was taken from ( for reference: https://youtu.be/iV18Xx5EkaE ), I observed the comment count shown on page was a little more than 8000, agreeing with the YouTube Data API.

Question

Are these APIs supposed to output the same thing? I couldn't find in the documentation, my team and I just assumed they should be the same thing. We couldn't find errors in the code so far.

0 个答案:

没有答案