I want to take campaign stats on python with this request:


I get INVALID_TIME_WINDOW error when using day granularity with date range from 2016-10-28 to 2016-10-31. Response here:

[{u’message’: u’Time cannot be fractional hours’, u’code’: u’INVALID_TIME_WINDOW’, u’parameter’: u’end_time’}, {u’message’: u"Expect time to be midnight in the account’s local timezone for day granularity", u’code’: u’INVALID_TIME_WINDOW’, u’parameter’: u’’}]

Such as date range from 2016-10-01 to 2016-10-20 i able to get stats. What is the cause of the situation?


You should consider your hour gap between UTC in order to define midnight time


@Altug_Yigit: We’re able to make a successful request for 98spr with the information you provided, even though there is no data (all null values). (It looks like this campaign ended on 2016-02-08T03:00:00Z, which would explain the response.)

What is different between the requests you’ve made earlier in October and now? The error message suggests that an incorrect time is being passed in. Could you share the actual start and end time values (not just the date)?


Actually my account id is different from in request. I tried start time and end time as 2016-10-28T21:00:00Z and 2016-10-30T21:00:00Z problem was solved, thanks for your advice.


@Altug_Yigit: Great to hear! Please consider marking this thread as solved.