Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

YouTube Channel Reports API not giving metrics (views, likes...) for current day (using Targeted Queries)

$
0
0

I'm using channel_reports from YouTube analytics API to fetch metrics such as views, likes, etc, but I can't fetch data for the current day (I can tough, get data spanning from a few days back). Even if I watch, like a bunch of videos and subscribe to the channel I'm trying to fetch the data from, I don't see any data.

I'm using the following to get data:

from datetime import datetime, timedeltayoutubeAnalytics = build(api_name, version, credentials=credentials) ### using Oauth token and allstartDate = (datetime.today() - timedelta(days=1)).date()endDate = (datetime.today() - timedelta(days=0)).date()metric_names = ["likes", "dislikes", "views", "subscribersGained", "subscribersLost"]youtubeAnalytics.reports().query(    ids='channel==MINE',    startDate=startDate,    endDate=endDate ,    metrics=",".join(metric_names ),    dimensions="day").execute()

But with the startDate and endDate representing today and yesterday, the results are empty (even after viewing lots of videos, subscribing, liking with other accounts).

For past data though, it yields results.


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>