Reference

Endpoint Get report


Name

get_report

Description

No description available [API reference]

Parameters

Parameter Required Options
Name: ids

Label: ids

YES
Option Value
Filter1 channel==MINE
Filter2 channel==ENTER_CHANNEL_ID
Filter3 contentOwner==ENTER_OWNER_NAME
Name: metrics

Label: metrics

YES
Option Value
adEarnings adEarnings
annotationImpressions annotationImpressions
annotationClickableImpressions annotationClickableImpressions
annotationClicks annotationClicks
annotationClickThroughRate annotationClickThroughRate
annotationClosableImpressions annotationClosableImpressions
annotationCloses annotationCloses
annotationCloseRate annotationCloseRate
audienceWatchRatio audienceWatchRatio
averageViewDuration averageViewDuration
averageViewPercentage averageViewPercentage
cardClickRate cardClickRate
cardClicks cardClicks
cardImpressions cardImpressions
cardTeaserClickRate cardTeaserClickRate
cardTeaserClicks cardTeaserClicks
cardTeaserImpressions cardTeaserImpressions
comments comments
dislikes dislikes
earnings earnings
estimatedMinutesWatched estimatedMinutesWatched
estimatedPartnerAdSenseRevenue estimatedPartnerAdSenseRevenue
estimatedPartnerDoubleClickRevenue estimatedPartnerDoubleClickRevenue
grossRevenue grossRevenue
impressionBasedCpm impressionBasedCpm
impressions impressions
likes likes
monetizedPlaybacks monetizedPlaybacks
playbackBasedCpm playbackBasedCpm
playlistStarts playlistStarts
savesAdded savesAdded
savesRemoved savesRemoved
shares shares
subscribersGained subscribersGained
subscribersLost subscribersLost
videosAddedToPlaylists videosAddedToPlaylists
videosRemovedFromPlaylists videosRemovedFromPlaylists
viewerPercentage viewerPercentage
views views
Name: startDate

Label: Start Date (yyyy-MM-dd)

The date for which to retrieve the report in YYYYMMDD format. Supported functions now|today|yesterday|weekstart|weekend|monthstart|monthend|yearstart|yearend and supported intervals for add/subtract are ms|s|sec|min|h|hour|y|year|d|day|m|month|y|year. Example monthstart-3d (subtract 3days from month start)
YES
Option Value
today today
yesterday yesterday
monthstart monthstart
monthend monthend
yearstart yearstart
yearend yearend
weekstart weekstart
weekend weekend
yearstart-1y yearstart-1y
yearend-1y yearend-1y
monthstart-1d monthstart-1d
monthend+1d monthend+1d
Name: endDate

Label: End Date (yyyy-MM-dd)

The date for which to retrieve the report in YYYYMMDD format. Supported functions now|today|yesterday|weekstart|weekend|monthstart|monthend|yearstart|yearend and supported intervals for add/subtract are ms|s|sec|min|h|hour|y|year|d|day|m|month|y|year. Example monthstart-3d (subtract 3days from month start)
YES
Option Value
today today
yesterday yesterday
monthstart monthstart
monthend monthend
yearstart yearstart
yearend yearend
weekstart weekstart
weekend weekend
yearstart-1y yearstart-1y
yearend-1y yearend-1y
monthstart-1d monthstart-1d
monthend+1d monthend+1d
Name: currency

Label: currency

Name: dimensions

Label: dimensions

Option Value
adType adType
ageGroup ageGroup
asset asset
audienceType audienceType
channel channel
claimedStatus claimedStatus
contentOwner contentOwner
country country
day day
deviceType deviceType
elapsedVideoTimeRatio elapsedVideoTimeRatio
gender gender
insightPlaybackLocationDetail insightPlaybackLocationDetail
insightPlaybackLocationType insightPlaybackLocationType
insightTrafficSourceDetail insightTrafficSourceDetail
insightTrafficSourceType insightTrafficSourceType
liveOrOnDemand liveOrOnDemand
operatingSystem operatingSystem
playlist playlist
province province
sharingService sharingService
subscribedStatus subscribedStatus
subtitleLanguage subtitleLanguage
uploaderType uploaderType
video video
Name: filters

Label: filters

A list of filters that should be applied when retrieving YouTube Analytics data. The documentation for channel reports and content owner reports identifies the dimensions that can be used to filter each report, and the Dimensions document defines those dimensions.
Option Value
Example1 country==IT
Example2 video==dMH0bHeiRNg
Example3 gender==FEMALE
Example4 dimension==some_value
Name: includeHistoricalChannelData

Label: includeHistoricalChannelData

Option Value
true true
false false
Name: maxResults

Label: maxResults

Name: sort

Label: sort

A comma-separated list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The - prefix causes descending sort order.
Option Value
adType adType
ageGroup ageGroup
asset asset
audienceType audienceType
channel channel
claimedStatus claimedStatus
contentOwner contentOwner
country country
day day
deviceType deviceType
elapsedVideoTimeRatio elapsedVideoTimeRatio
gender gender
insightPlaybackLocationDetail insightPlaybackLocationDetail
insightPlaybackLocationType insightPlaybackLocationType
insightTrafficSourceDetail insightTrafficSourceDetail
insightTrafficSourceType insightTrafficSourceType
liveOrOnDemand liveOrOnDemand
operatingSystem operatingSystem
playlist playlist
province province
sharingService sharingService
subscribedStatus subscribedStatus
subtitleLanguage subtitleLanguage
uploaderType uploaderType
video video

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime.
If the column you are looking for is missing, consider customizing YouTube Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime.

Examples

SSIS

Use YouTube Connector in API Source or in API Destination SSIS Data Flow components to read or write data.

API Source

API Source - YouTube
Read / write YouTube data inside your app, perform many Youtube operations without coding using easy to use high performance API Connector for YouTube
YouTube
Get report
Required Parameters
ids Fill-in the parameter...
metrics Fill-in the parameter...
Start Date (yyyy-MM-dd) Fill-in the parameter...
End Date (yyyy-MM-dd) Fill-in the parameter...
Optional Parameters
ArrayTransformType TransformSimpleTwoDimensionalArray
ArrayTransColumnNameFilter $.columnHeaders[*].name
ArrayTransRowValueFilter $.rows[*]
currency
dimensions
filters
includeHistoricalChannelData
maxResults 50
sort
SSIS API Source - Read from table or endpoint

API Destination

API Destination - YouTube
Read / write YouTube data inside your app, perform many Youtube operations without coding using easy to use high performance API Connector for YouTube
YouTube
Get report
Required Parameters
ids Fill-in the parameter...
metrics Fill-in the parameter...
Start Date (yyyy-MM-dd) Fill-in the parameter...
End Date (yyyy-MM-dd) Fill-in the parameter...
Optional Parameters
ArrayTransformType TransformSimpleTwoDimensionalArray
ArrayTransColumnNameFilter $.columnHeaders[*].name
ArrayTransRowValueFilter $.rows[*]
currency
dimensions
filters
includeHistoricalChannelData
maxResults 50
sort
SSIS API Destination - Access table or endpoint

ODBC application

Use these SQL queries in your ODBC application data source:

Gets a report of specific channel

SELECT *
FROM get_report
WITH(
	  ids='channel==ENTER_CHANNEL_ID'
	, metrics='likes~shares~views'
	, startDate='2022-08-01'
	, endDate='2022-08-30'
)

Gets a report of my channel with relative date

SELECT *
FROM get_report
WITH(
      ids='channel==MINE'
    , metrics='likes~shares~views'
    , startDate='yearstart' --OR put date like '2022-08-01'
    , endDate='today' --OR put date like '2022-08-01'
    , dimensions='country'
)

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Gets a report of specific channel

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM get_report
WITH(
	  ids=''channel==ENTER_CHANNEL_ID''
	, metrics=''likes~shares~views''
	, startDate=''2022-08-01''
	, endDate=''2022-08-30''
)';

EXEC (@MyQuery) AT [LS_TO_YOUTUBE_IN_GATEWAY];

Gets a report of my channel with relative date

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM get_report
WITH(
      ids=''channel==MINE''
    , metrics=''likes~shares~views''
    , startDate=''yearstart'' --OR put date like ''2022-08-01''
    , endDate=''today'' --OR put date like ''2022-08-01''
    , dimensions=''country''
)';

EXEC (@MyQuery) AT [LS_TO_YOUTUBE_IN_GATEWAY];