--- title: "Yt::Group" h2: "Groups" ---

Yt::Group represents a YouTube Analytics group. Initialize using its YouTube ID:

{% include doc.html instance="Group#initialize" %}{% include example.html object='group = Yt::Group' method='new' params=' id: "ABVSo3DwAAA"' %}
{% include example.html result='#<Yt::Group @id=ABVSo3DwAAA>' %}
{% include doc.html instance="Group#canonical_url" %}{% include example.html object='group' method='title' %}
{% include example.html result='"Video group"' %}

Authentication

All methods of Yt::Group act on behalf of YouTube accounts (e.g.: to fetch a group).
To use these methods (marked with   below), you need to get an API Client ID/Secret from Google, then obtain a refresh token from the account you want to act as, and finally configure the values:

{% highlight ruby %} Yt.configuration.client_id = "" ## replace with your client ID Yt.configuration.client_secret = "" ## replace with your client secret Yt.configuration.refresh_token = "" ## use the account’s refresh token Yt::Group.new(id: 'ABVSo3DwAAA').title # => "Video group" {% endhighlight %}

List of Yt::Group data methods

{% include dt.html title="Group’s snippet" label="warning" auth="must authenticate as the channel’s account" %}
{% include doc.html instance="Group#id" %}{% include example.html object='group' method='id' result='"ABVSo3DwAAA"' %}
{% include doc.html instance="Group#title" %}{% include example.html object='group' method='title' result='"Video Group"' %}
{% include doc.html instance="Group#published_at" %}{% include example.html object='group' method='published_at' result='2014-05-02 20:12:57 UTC' %}
{% include dt.html title="Group’s content details" label="warning" auth="must authenticate as the group’s account" %}
{% include doc.html instance="Group#item_count" %}{% include example.html object='group' method='item_count' result='4' %}
{% include doc.html instance="Group#item_type" %}{% include example.html object='group' method='item_type' result='"youtube#video"' %}