blob: c1fd26c3b8fda98c0987ada106a305d10da8cede [file] [log] [blame]
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="youtubeAnalytics_v2.html">YouTube Analytics API</a> . <a href="youtubeAnalytics_v2.reports.html">reports</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#query">query(startDate=None, includeHistoricalChannelData=None, sort=None, endDate=None, ids=None, currency=None, startIndex=None, metrics=None, filters=None, maxResults=None, dimensions=None, x__xgafv=None)</a></code></p>
<p class="firstline">Retrieve your YouTube Analytics reports.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="query">query(startDate=None, includeHistoricalChannelData=None, sort=None, endDate=None, ids=None, currency=None, startIndex=None, metrics=None, filters=None, maxResults=None, dimensions=None, x__xgafv=None)</code>
<pre>Retrieve your YouTube Analytics reports.
Args:
startDate: string, The start date for fetching YouTube Analytics data. The value should be in
`YYYY-MM-DD` format.
required: true, pattern: &quot;[0-9]{4}-[0-9]{2}-[0-9]{2}
includeHistoricalChannelData: boolean, If set to true historical data (i.e. channel data from before the linking
of the channel to the content owner) will be retrieved.&quot;,
sort: string, 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 &#x27;`-`&#x27; prefix causes descending sort order.&quot;,
pattern: [-0-9a-zA-Z,]+
endDate: string, The end date for fetching YouTube Analytics data. The value should be in
`YYYY-MM-DD` format.
required: true, pattern: [0-9]{4}-[0-9]{2}-[0-9]{2}
ids: string, Identifies the YouTube channel or content owner for which you are
retrieving YouTube Analytics data.
- To request data for a YouTube user, set the `ids` parameter value to
`channel==CHANNEL_ID`, where `CHANNEL_ID` specifies the unique YouTube
channel ID.
- To request data for a YouTube CMS content owner, set the `ids` parameter
value to `contentOwner==OWNER_NAME`, where `OWNER_NAME` is the CMS name
of the content owner.
required: true, pattern: [a-zA-Z]+==[a-zA-Z0-9_+-]+
currency: string, The currency to which financial metrics should be converted. The default is
US Dollar (USD). If the result contains no financial metrics, this flag
will be ignored. Responds with an error if the specified currency is not
recognized.&quot;,
pattern: [A-Z]{3}
startIndex: integer, An index of the first entity to retrieve. Use this parameter as a
pagination mechanism along with the max-results parameter (one-based,
inclusive).&quot;,
minValue: 1
metrics: string, A comma-separated list of YouTube Analytics metrics, such as `views` or
`likes,dislikes`. See the
[Available Reports](/youtube/analytics/v2/available_reports) document for
a list of the reports that you can retrieve and the metrics
available in each report, and see the
[Metrics](/youtube/analytics/v2/dimsmets/mets) document for definitions of
those metrics.
required: true, pattern: [0-9a-zA-Z,]+
filters: string, A list of filters that should be applied when retrieving YouTube Analytics
data. The [Available Reports](/youtube/analytics/v2/available_reports)
document identifies the dimensions that can be used to filter each report,
and the [Dimensions](/youtube/analytics/v2/dimsmets/dims) document defines
those dimensions. If a request uses multiple filters, join them together
with a semicolon (`;`), and the returned result table will satisfy both
filters. For example, a filters parameter value of
`video==dMH0bHeiRNg;country==IT` restricts the result set to include data
for the given video in Italy.&quot;,
maxResults: integer, The maximum number of rows to include in the response.&quot;,
minValue: 1
dimensions: string, A comma-separated list of YouTube Analytics dimensions, such as `views` or
`ageGroup,gender`. See the [Available
Reports](/youtube/analytics/v2/available_reports) document for a list of
the reports that you can retrieve and the dimensions used for those
reports. Also see the [Dimensions](/youtube/analytics/v2/dimsmets/dims)
document for definitions of those dimensions.&quot;
pattern: [0-9a-zA-Z,]+
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for TargetedQueriesService.Query.
&quot;rows&quot;: [ # The list contains all rows of the result table. Each item in the list is
# an array that contains comma-delimited data corresponding to a single row
# of data. The order of the comma-delimited data fields will match the
# order of the columns listed in the `columnHeaders` field.
#
# If no data is available for the given query, the `rows` element will be
# omitted from the response.
#
# The response for a query with the `day` dimension will not contain rows for
# the most recent days.
[
&quot;&quot;,
],
],
&quot;errors&quot;: { # Request Error information. # When set, indicates that the operation failed.
#
# The presence of an error field signals that the operation
# has failed.
&quot;requestId&quot;: &quot;A String&quot;, # Request identifier generated by the service, which can be
# used to identify the error in the logs
&quot;error&quot;: [ # Specific error description and codes
{ # Describes one specific error.
&quot;argument&quot;: [ # Error arguments, to be used when building user-friendly error messages
# given the error domain and code. Different error codes require different
# arguments.
&quot;A String&quot;,
],
&quot;code&quot;: &quot;A String&quot;, # Error code in the error domain. This should correspond to
# a value of the enum type whose name is in domain. See
# the core error domain in error_domain.proto.
&quot;location&quot;: &quot;A String&quot;, # Location of the error, as specified by the location type.
#
# If location_type is PATH, this should be a path to a field that&#x27;s
# relative to the request, using FieldPath notation
# (net/proto2/util/public/field_path.h).
#
# Examples:
# authenticated_user.gaia_id
# resource.address[2].country
&quot;externalErrorMessage&quot;: &quot;A String&quot;, # A short explanation for the error, which can be shared outside Google.
#
# Please set domain, code and arguments whenever possible instead of this
# error message so that external APIs can build safe error messages
# themselves.
#
# External messages built in a RoSy interface will most likely refer to
# information and concepts that are not available externally and should not
# be exposed. It is safer if external APIs can understand the errors and
# decide what the error message should look like.
&quot;locationType&quot;: &quot;A String&quot;,
&quot;debugInfo&quot;: &quot;A String&quot;, # Debugging information, which should not be
# shared externally.
&quot;domain&quot;: &quot;A String&quot;, # Error domain. RoSy services can define their own
# domain and error codes. This should normally be
# the name of an enum type, such as: gdata.CoreErrorDomain
},
],
&quot;code&quot;: &quot;A String&quot;, # Global error code. Deprecated and ignored.
# Set custom error codes in ErrorProto.domain and ErrorProto.code
# instead.
},
&quot;kind&quot;: &quot;A String&quot;, # This value specifies the type of data included in the API response.
# For the query method, the kind property value will be
# `youtubeAnalytics#resultTable`.
&quot;columnHeaders&quot;: [ # This value specifies information about the data returned in the `rows`
# fields. Each item in the `columnHeaders` list identifies a field returned
# in the `rows` value, which contains a list of comma-delimited data. The
# `columnHeaders` list will begin with the dimensions specified in the API
# request, which will be followed by the metrics specified in the API
# request. The order of both dimensions and metrics will match the ordering
# in the API request. For example, if the API request contains the parameters
# `dimensions=ageGroup,gender&amp;metrics=viewerPercentage`, the API response
# will return columns in this order: `ageGroup`, `gender`,
# `viewerPercentage`.
{ # The description of a column of the result table.
&quot;columnType&quot;: &quot;A String&quot;, # The type of the column (`DIMENSION` or `METRIC`).
&quot;name&quot;: &quot;A String&quot;, # The name of the dimension or metric.
&quot;dataType&quot;: &quot;A String&quot;, # The type of the data in the column (`STRING`, `INTEGER`, `FLOAT`, etc.).
},
],
}</pre>
</div>
</body></html>