YouTube Bulk Reports

The YouTube Bulk Reports Connector provides automated access to the YouTube Analytics and Reporting APIs

Prerequisites

The YouTube Bulk Reports Connector requires Google OAuth authentication to access its data.

See the YouTube Analytics and Reporting APIs for the necessary authorization scopes.

To authenticate via OAuth you must add a Key with the Credential Type Google OAuth, enter a Key Name (used in the Switchboard Script below) and perform the Oauth flow by clicking the button labeled Connect.

Scheduling

The YouTube Bulk Reports connector can be scheduled to ingest data once per day at a user-defined hour and timezone.

By default, the connector will run once at 6am PT.

See Daily Scheduling for more information.

Parameters

content_owner_id
A contentOwner resource represents an organization or other entity that owns content or administers content on YouTube.

There is an API to retrieve a list of Content Owners.

report_type
the connector supports a variety of report types including the following:

content_owner_basic_a3 content_owner_province_a2 content_owner_playback_location_a2 content_owner_traffic_source_a2 content_owner_device_os_a2 content_owner_demographics_a1 content_owner_sharing_service_a1 content_owner_annotations_a1 content_owner_cards_a1 content_owner_end_screens_a1 content_owner_subtitles_a2 content_owner_combined_a2 content_owner_playlist_basic_a1 content_owner_playlist_province_a1 content_owner_playlist_playback_location_a1 content_owner_playlist_traffic_source_a1 content_owner_playlist_device_os_a1 content_owner_playlist_combined_a1 content_owner_ad_rates_a1 content_owner_estimated_revenue_a1 content_owner_asset_estimated_revenue_a1 content_owner_asset_basic_a2 content_owner_asset_province_a2 content_owner_asset_playback_location_a2 content_owner_asset_traffic_source_a2 content_owner_asset_device_os_a2 content_owner_asset_demographics_a1 content_owner_asset_sharing_service_a1 content_owner_asset_annotations_a1 content_owner_asset_cards_a1 content_owner_asset_end_screens_a1 content_owner_asset_combined_a2

Sample Switchboard Script

import asset_basic_raw from {
   type: "youtube:report";
   content_owner_id: "my_content_owner_id";
   key: "google_access_credential";
   report_type: "content_owner_asset_basic_a2";
} using {
    date: datetime("YYYYMMdd");
    channel_id: string;
    video_id: string;
    claimed_status: string;
    uploader_type: string;
    live_or_on_demand: string;
    subscribed_status: string;
    country_code: string;
    views: integer;
    comments: integer;
    shares: float;
    watch_time_minutes: float;
    average_view_duration_seconds: float;
    average_view_duration_percentage: float;
    annotation_click_through_rate: float;
    annotation_close_rate: float;
    annotation_impressions: integer;
    annotation_clickable_impressions: float;
    annotation_closable_impressions: float;
    annotation_clicks: integer;
    annotation_closes: float;
    card_click_rate: float;
    card_teaser_click_rate: float;
    card_impressions: float;
    card_teaser_impressions: integer;
    card_clicks: integer;
    card_teaser_clicks: float;
    subscribers_gained: integer;
    subscribers_lost: integer;
    videos_added_to_playlists: integer;
    videos_removed_from_playlists: float;
    likes: integer;
    dislikes: integer;
    red_views: integer;
    red_watch_time_minutes: float;
};