I am running the following query with Youtube Analytics API
now = datetime.datetime.now()
start_date = (now - datetime.timedelta(days=4)).strftime('%Y-%m-%d')
end_date = (now - datetime.timedelta(days=3)).strftime('%Y-%m-%d')
args = {
'metrics': 'views,estimatedMinutesWatched',
'dimensions': 'subscribedStatus',
'ids': 'channel==<my_channel_id>',
'startDate': start_date,
'endDate': end_date
}
analytics_query_response = youtube.reports().query(**args).execute()
I am using youtube analytics api version 2 and changed the end_date parameter to endDate and start_date to startDate and I am getting the following response
{u'kind': u'youtubeAnalytics#resultTable', u'rows': [], u'columnHeaders': [{u'dataType': u'STRING', u'columnType': u'DIMENSION', u'name': u'subscribedStatus'}, {u'dataType': u'INTEGER', u'columnType': u'METRIC', u'name': u'views'}, {u'dataType': u'INTEGER', u'columnType': u'METRIC', u'name': u'estimatedMinutesWatched'}]}
I get the 'rows' in response but it's empty. When I try with the same parameters in Youtube API Explorer, it gives me the result for 'rows'.
What I am doing wrong here?