get_views

Gets the number of views for a given tracker, publisher or video ID. This includes statistics aggregated over the specified timeframe, plus optional per-day, week or month totals.

Explorer

Explore this method

Request URL

http://api.tubemogul.com/api/v3/

HTTP method

GET

Arguments

scope (string)
The scope of the method being called. Valid values are tracker or publisher.
id (string)
The ID corresponding to the scope of the report.
start (string)
The start date for the report. Format is YYYY-MM-DD.
end (string)
The end date for the report. Format is YYYY-MM-DD.
site_id (string) — Optional
The ID for your site. This is required for publisher-scoped queries but not for trackers. Contact us if you do not know your site_id.
interval (string) — Optional
Determines the granularity of list values in the detailed response list. Valid values include perday or none. A value of none will omit the detail list. Defaults to none.
video_id (string) — Optional
The identifier provided for this video in the video player. This must be unique for every distinct video, and must not change over time. This will scope the response to include stats for this video only.

Response Parameters

views (integer)
The total number of views over the specified date range. A view is defined as when the video is actually played, i.e. when play is called on the video object.
daily_avg (integer)
The average number of views per day over the specified date range.
daily_max (integer)
The maximum number of views on any single day over the specified date range.
all_time_views (integer)
The total number of views since InPlay tracking began. Note if videos were present prior to InPlay deployment, this number could be significantly lower than reported by a video site.
details (list)
A list of per-day views with the following parameters: date, views and per_viewer_avg. The entries will scoped based on the arguments provided in the request.

Example Response

http://api.tubemogul.com/api/v3?date=1230109922&user_id=123456
&scope=tracker&id=TD-PEX-Y83&method=get_views&interval=perday
&start=2008-12-10&end=2008-12-31&index=1&max_results=20
&auth=aa6fb416b3cac7861be9c9db2ebeef564b70f2e4

<response name="get_views" status="ok">
  <views>1910754</views>
  <daily_avg>86852</daily_avg>
  <daily_max>127017</daily_max>
  <all_time_views>6587340</all_time_views>
  <details interval="perday" has_more_items="true" list_size="22" count="20">
    <entry>
      <date>2008-12-10</date>
      <views>74556</views>
    </entry>
    ...
    <entry>
      <date>2008-12-29</date>
      <views>77749</views>
    </entry>
  </details>
</response>

Error Codes

Standard error codes