/channels/views/show

Shows views statistics for a channel.

Parameters

channel_key : string

Key of the channel which views statistics to show.

start_date (optional) : unsigned integer

UTC date starting from which channels views statistics should be returned. Date must be in Unix timestamp format. Default is the first day of the current month.

end_date (optional) : unsigned integer

UTC date until (and including) which channels views statistics should be returned. Date must be in Unix timestamp format. Default is today’s date.

aggregate (optional) : string

Specifies if returned channel views statistics should be aggregate.

True

Aggregate channel views for the specified date range.

False

Do not aggregate channel views.

Default is False.

group_days (optional) : string

Specifies if returned channel views statistics should be grouped by year and month.

True

Group daily channel views statistics by year and month.

False

Do not group daily channel views.

Default is False. Skipped, if aggregate parameter set to True.

include_empty_days (optional) : string

Specifies if channel views statistics should include days for which there is no statistics available:

True

Daily views statistics will include empty days. Channel views for the empty days will be set to 0.

False

Daily views statistics will not include empty days.

Default is False. Applicable only when list_by parameter set to day.

Example response (group_days == False)

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <channel key="bIt7nRZu">
    <days total="7">
      <day date="2009-10-01" timestamp="1254355200">
        <views>1234</views>
      </day>
      ...
    </days>
  </channel>
</response>

Response parameters

/response/status : string

Call execution status. Set to ok if call executed successfully.

//channel/@key : string

Channel key.

//days/@total : unsigned integer

Total number of returned days.

//day/@date : string

UTC date of the day in YYYY-MM-DD format.

//day/@timestamp : unsigned integer

UTC date of the day in Unix timestamp format.

//day/views : unsigned integer

Channel views this day.

Example response (group_days == True)

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <channel key="bIt7nRZu">
    <years total="1">
      <year number="2009">
        <months total="1">
          <month number="10">
            <days total="19">
              <day number="1" timestamp="1254355200">
                <views>1234</views>
              </day>
              ...
            </days>
          </month>
        </months>
      </year>
    </years>
  </channel>
</response>

Response parameters

/response/status : string

Call execution status. Set to ok if call executed successfully.

//channel/@key : string

Channel key.

//years/@total : unsigned integer

Total number of returned years.

//year/@number : unsigned integer

Number of the year.

//month/@total : unsigned integer

Total number of returned month for the year.

//month/@number : unsigned integer

Number of the month in a year (1..12).

//days/@total : unsigned integer

Total number of returned days.

//day/@number : unsigned integer

Number of the day in a month (1..31).

//day/@date : string

UTC date of the day in YYYY-MM-DD format.

//day/@timestamp : unsigned integer

UTC date of the day in Unix timestamp format.

//day/views : unsigned integer

Channel views this day.

Example response (aggregate == True)

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <channel key="bIt7nRZu">
    <views>9876</views>
  </channel>
</response>

Response parameters

/response/status : string

Call execution status. Set to ok if call executed successfully.

//channel/@key : string

Channel key.

//channel/views : unsigned integer

Channel views for the specified date range.