Author Archives: Ibrahim Ulukaya

Access to YouTube Analytics data in bulk

Want to get all of your YouTube data in bulk? Are you hitting the quota limits while accessing analytics data one request at a time? Do you want to be able to break down reports by more dimensions? What about accessing assets and revenue data?
With the new YouTube Bulk Reports API, your authorized application can retrieve bulk data reports in the form of CSV files that contain YouTube Analytics data for a channel or content owner. Once activated, reports are generated daily and contain data for a unique, 24-hour period.

While the known YouTube Analytics API supports real-time targeted queries of much of the same data as the YouTube Bulk Reports API, the latter is designed for applications that can retrieve and import large data sets, then use their own tools to filter, sort, and mine that data.

As of now the API supports video, playlist, ad performance, estimated earnings and asset reports.

How to start developing


  • Choose your reports:
    • Video reports provide statistics for all user activity related to a channel's videos or a content owner's videos. For example, these metrics include the number of views or ratings that videos received. Some video reports for content owners also include earnings and ad performance metrics.
    • Playlist reports provide statistics that are specifically related to video views that occur in the context of a playlist.
    • Ad performance reports provide impression-based metrics for ads that ran during video playbacks. These metrics account for each ad impression, and each video playback can yield multiple impressions.
    • Estimated earnings reports provide the total earnings for videos from Google-sold advertising sources as well as from non-advertising sources. These reports also contain some ad performance metrics.
    • Asset reports provide user activity metrics related to videos that are linked to a content owners' assets. For its data to included in the report, a video must have been uploaded by the content owner and then claimed as a match of an asset in the YouTube Content ID system.

  • Schedule reports:
  1. Get an OAuth token (authentication credentials)
  2. Call the reportTypes.list method to retrieve a list of the available report types
  3. Create a new reporting job by calling jobs.create and passing the desired report type (and/or query in the future)

  • Retrieve reports:
  1. Get an OAuth token (authentication credentials)
  2. Call the jobs.list method to retrieve a list of the available reporting jobs and remember its ID.
  3. Call the reports.list method with the jobId filter parameter set to the ID found in the previous step to retrieve a list of downloadable reports that that particular job created.
  4. Creators can check the report’s last modified date to determine whether the report has been updated since the last time it was retrieved.
  5. Fetch the report from the URL obtained by step 3.

  • While using our sample code and tools
    • Client libraries for many different programming languages can help you implement the YouTube Reporting API as well as many other Google APIs.
    • Don't write code from scratch! Our Java, PHP, and Python code samples will help you get started.
    • The APIs Explorer lets you try out sample calls before writing any code.


Cheers,


Bye-bye, YouTube Data API v2

UPDATE 08/03/15: Starting today, API v2 of comments, captions and video flagging services are turned down.
------------------------------------------------------------------------------------------------------------------------------------------------------UPDATE 06/03/15: Starting today, most YouTube Data API v2 calls will receive 410 Gone HTTP responses.
------------------------------------------------------------------------------------------------------------------------------------------------------
UPDATE 05/06/15: Starting today, YouTube Data API v2 video feeds will only return the support video.
------------------------------------------------------------------------------------------------------------------------------------------------------
UPDATE: With the launch of video abuse reporting and video search for developer, the Data API v3 supports every feature scheduled to be migrated from the soon-to-be-turned-down Data API v2.
------------------------------------------------------------------------------------------------------------------------------------------------------

With the recent additions of comments, captions, and RSS push notifications, the Data API v3 supports almost every feature scheduled to be migrated from the soon-to-be-turned-down Data API v2. The only remaining feature to be migrated is video flagging, which will launch in the coming days. The new API brings in many features from the latest version of YouTube, making sure your users are getting the best YouTube experience on any screen.

For a quick memory lane trip, in March 2014, we announced that the Data API v2 would be retired on April 20, 2015, and would be shut down soon thereafter. To help with your migration, we launched the migration guide in September 2014, and have also been giving you regular notices on v3 feature updates.

Retirement plan
If you’re still using the Data API v2, today we’ll start showing a video at the top of your users’ video feeds that will notify them of how they might be affected. Apart from that, your apps will work as usual.
In early May, Data API v2 video calls will start returning only the warning video introduced on April 20. Users will not be able to view other videos on apps that use the v2 API video calls. See youtube.com/devicesupport for affected devices.

By late May, v2 API calls except for comments and captions will receive 410 Gone HTTP responses. You can test your application’s reaction to this response by pointing the application at eol.gdata.youtube.com instead of gdata.youtube.com. While you should migrate your app as soon as possible, these features will work in the Data API v2 until the end of July 2015 to avoid any outages.

How you can migrate
Check out the frequently asked questions and migration guide for the most up-to-date instructions on how to update specific features to use the Data API v3. The guide now lists all of the Data API v2 functionality that is being deprecated and won't be offered in the Data API v3. It also includes updated instructions for a few newly migrated features, like comments, captions, and video flagging.

- Ibrahim Ulukaya, and the YouTube for Developers team

Manage comments with the YouTube Data API v3

YouTube Sentiment Analysis Demo
Cindy 3 hours ago
I wish my app could manage YouTube comments.

Ibrahim 2 hours ago
Then it's your day today. With the new YouTube Data API (v3) you can now have comments in your app. Just register your application to use the v3 API and then check out the documentation for the  Comments and CommentThreads resources and their methods.

Andy 2 hours ago
+Cindy R u still on v2? U know the v2 API is being deprecated on April 20, and you’ve updated to v3 right?

Andy 1 hour ago
+Ibrahim I can haz client libraries, too?

Ibrahim 30 minutes ago
Yes, there are client libraries for many different programming languages, and there are already Java, PHP, and Python code samples.

Matt 20 minutes ago
My brother had a python and he used to feed it mice. Pretty gross!

Cindy 10 minutes ago
Thanks, +Ibrahim. This is very cool. The APIs Explorer lets you try out sample calls before writing any code, too.

Ibrahim 5 minutes ago
Check out this interactive demo that uses the new comments retrieval feature and Google Prediction APIs. The demo displays audience sentiment against any video by retrieving the video's comments and feeding them to the Cloud Prediction API for the sentiment analysis.

Dude, are you still on YouTube API v2?

Nah man, my mom is on v2.

Your YouTube integration is important; but, do you know if you are still on the soon-to-be-retired v2 API or taking advantage of many new features that the new Data API v3 offers, like “video ratings,” “in-video promotions” and “channel sections?”

Retirement plan
In March 2014, we announced that the v2 API would be retired in April 20, 2015, and would be shut down soon thereafter. To help you with your migration, we launched the migration guide in September. Now, we’d like to provide you with more details on the plan to retire v2.

To make sure that you’ve migrated everything over before fully shutting off the v2 API, we’ll perform the first of what we call “blackout tests” for the v2 API in the coming weeks, where we’ll shut down the v2 API for a limited period of time. The blackout tests, which will take place on different days of the week and at varying times of day, are meant to help you better understand the impact the retirement will have on your applications and users.

Most of the v2 requests during the blackout window will be responded to with a HTTP 410 Gone. If you want to test your application’s reaction to this response, point it at eol.gdata.youtube.com instead of gdata.youtube.com.

How you can migrate
Check out the frequently asked questions and migration guide for the most up-to-date instructions on how to update specific features to use the new API. The guide now lists all of the v2 API functionality that is being deprecated and won't be offered in the v3 API. It also identifies a couple of features that we're migrating but still working on, like “captions” and “comments”. And, finally, it includes updated instructions for a few newly migrated features, like “browser-based uploading” and “language relevant search”.

Migration Guide

Once you’re done with that, join the rest of the folks who’ve migrated, kick back and enjoy this.