Summary metrics values in Twitter Ads v1 API



Is there a way to get summary metrics in the v1 analytics API? In v0, you could pass in a start time, no end time, and use TOTAL for the granularity. Now, you are limited to 7 day ranges.


Hi @obscyuriy! Have you actually tried to make a request in v1 with granularity TOTAL and any start_time and didn’t get what you expected? Because granularity TOTAL is still available in v1.


Yes. Previously, if end_time was omitted, the current date was used as an implicit end date. This is no longer the case.

Granularity TOTAL is still available, but the maximum date range now supported is only 7 days, and it only provides you the total for those seven days. For example, let’s say you want to get total lifetime metrics for a promoted tweet with ID of octt5. If you query for metrics from 2016-03-07T00:00:00Z to 2016-03-14T00:00:00Z, you’ll get something like this (just a snippet):

{'data': [{'id': 'octt5',
   'id_data': [{'metrics': {'app_clicks': None,
      'billed_charge_local_micro': [1000000],
      'billed_engagements': [1],
      'card_engagements': None,
      'carousel_swipes': None,
      'clicks': [1],

and if you query for metrics from 2016-05-18T00:00:00Z to '2016-05-24T00:00:00Z', you get something like this (another snippet):

{u'data': [{u'id': u'octt5',
   u'id_data': [{u'metrics': {u'app_clicks': None,
      u'billed_charge_local_micro': None,
      u'billed_engagements': None,
      u'card_engagements': None,
      u'carousel_swipes': None,
      u'clicks': None,

In other words, it gives you the total for just that time period. There is, effectively, no way to easily get lifetime values anymore (without making many, many requests for 7 day periods and adding them together). This removed functionality makes it more difficult to scale with the Twitter Ads platform.