Engineering and Developers Blog
What's happening with engineering and developers at YouTube
Partial Responses and Updates with the YouTube API
Monday, March 22, 2010
We wanted to share some big news that was
just announced
on the Google Code blog: the YouTube API now supports partial responses and partial update requests. Both these features allow you to drastically cut down on the amount of data you send and receive via the API, which means simpler, faster API operations and happier users.
The
announcement post
on the Google Code blog goes into much more detail, so take a look at that first. When you’re ready to start writing code, check out the
partial response
and
partial update
sections of the YouTube API Developer’s Guide.
Cheers,
-Jeff Posnick, YouTube API Team
YouTube is hiring! ~
http://google.com/jobs/workyoutube
YouTube Direct for Mobile, and Other Updates
Tuesday, March 9, 2010
Since launching
YouTube Direct
last November
, our team has been hard at work adding new functionalities, fixing bugs, and answering developer's questions. We wanted to take a momentary break from all that to share some updates.
Separate from but related to the main YouTube Direct project are two other Google Code projects: video capture and YouTube Direct upload applications for the
Android
and
iPhone
operating systems. These two projects are basic implementations that we hope will inspire organizations to add video capture and YouTube Direct upload functionality to their Android or iPhone applications.
We've been gradually, and quietly, checking in various bug fixes and enhancements to the current release's
Subversion repository
on Google Code. One recent change is especially important, as it adds support for the
new video page URLs
that will start becoming more common. Periodically, we package the current release into a new "tagged" release, and generate
release notes
summarizing what's new. If you haven't updated your YouTube Direct codebase recently, we strongly suggest that you read the release notes and perform a sync with our code repository. Starting with the next YouTube Direct release, we will send email announcements to the low-traffic, announce-only
Google Group
. We recommend that all developers using YouTube Direct sign up to the group — actually, all YouTube API users should sign up to receive periodic important notifications.
Many organizations, in addition to our
launch partners
, have deployed YouTube Direct on their websites since our launch, and we wanted to highlight a few here.
Gannett rolled out a company-wide initiative in honor of Black History month, in which they ask people to
interview civil rights heroes
via video. Al-Jazeera invited the community to
share their thoughts
and experiences around Hajj, the annual Muslim pilgrammage to Mecca. And if you have news videos around any of the big stories of the day,
ITN News
wants them. Even Tufts University is using YouTube Direct to solicit personal videos from the community called "
You, in One Minute
".
As always, the best resource for developers looking to embed YouTube Direct functionality on their website is our
Getting Started Guide
. If you have any technical questions about YouTube Direct, our
YouTube API Developer's Google Group
is the place to turn.
Cheers,
-Jeff Posnick on behalf of the YouTube Direct Team
YouTube + You
Thursday, March 4, 2010
YouTube is an extremely team-oriented, creative workplace where every single employee has a voice in the choices we make and the features we implement. We work together in small teams to design, develop, and roll out key features and products in very short time frames. Which means - something you write today could be seen by millions of viewers tomorrow.
Despite being the world's largest online video site and part of Google, we still have a relatively small engineering group. We are looking to add a few key impact players to our team. Come see what it's like to work at YouTube!
http://www.google.com/jobs/workyoutube
Lisa Pisacane, YouTube Recruiting
Extended Access Controls Available via API
Tuesday, February 23, 2010
One of the feature requests that we've received most frequently from developers it to have a YouTube API call that enables or disables commenting for videos. It's a logical request — videos can be automatically uploaded via the API, and having to visit youtube.com from a web browser to modify the commenting settings manually doesn't make much sense.
We've taken action on this feature request, and gone one step further: the new
<yt:accessControl>
element lets video owners enable or disable video rating, comment voting, video responses, and off-web syndication in addition to commenting. We've also taken an existing element for controlling embedding,
<yt:noembed>
, and migrated its functionality to <yt:accessControl>. Existing code that uses the <yt:noembed> element will continue to work as per our
API deprecation policy
, but <yt:accessControl> is preferred for new development.
You can set access controls for a video when uploading or updating a video. See the
Setting access controls for a video
section of the Developer's Guide for more information.
With the addition of the this feature, the YouTube API now offers parity with all the settings available via the YouTube web interface. We hope that applications that support YouTube uploads take advantage of this new functionality, and we know your users will appreciate it!
Cheers,
-Jeff Posnick, YouTube API Team
Announcing the YouTube SDK for .NET
Monday, February 22, 2010
I am happy to announce a new resource for the .NET fans in the YouTube developer community. The YouTube Software Developer Kit for .NET contains all you need to get you started with the YouTube API using Visual Studio 2008.
The SDK includes a help file, a project template and the following sample programs:
An application that use the Simple Update Protocol to watch for YouTube activity from a group of users.
An example ASP.NET website that illustrates the use of AuthSub authentication.
A bulk uploader tool that uses the new ResumableUploader component to asynchronously and reliably upload video files. Multiple threads are used to process video metadata, which is read from a CSV file.
After installing the SDK, you can open Visual Studio 2008 and select the YouTube template to get started writing your own code.
This packaged SDK no longer contains any source code, but it's all available from the project's
Subversion repository
. The
YouTubeUploader source code
is of specific interest to developer who want to see the ResumableUploader component in action.
To file bug reports or make feature requests, please use the project's
Issue Tracker
.
Regards,
—Frank Mantek, Google Data APIs Team
Best Practices for Avoiding Quota Issues
Tuesday, February 9, 2010
Like most publicly-available web services, the YouTube API implements a quota system to protect our servers from excessive traffic. This traffic might result from a harmless typo – who hasn't written an infinite loop or two after a long night of coding? – or it may result from an inefficiently designed system that makes needless API calls. Regardless of the cause, blocking traffic from a specific source once it reaches a certain level is necessary for the overall health of the YouTube API. It ensures that one developer's actions cannot negatively impact the larger community.
That being said, we've recently made some changes to the way we implement YouTube API quotas. Our previous quota implementation was a bit too coarse-grained for some common usage scenarios. For instance, if an application running on a common web hosting platform generated excessive requests, it could end up blocking other applications running on the same servers that were generating only a modest amount of traffic.
We believe that our new quota implementation is much more straightforward and less likely to negatively impact applications that are "doing the right thing." The new quota system ties usage to a specific
developer key
; as long as your application
includes a developer key
along with your YouTube API requests, your requests will be less likely to be flagged for quota violations.
It's also worth noting that different types of API operations count differently towards quota calculations. In general, you can safely make more frequent HTTP GET requests to retrieve data than HTTP POST/PUT/DELETE requests to modify data.
In the unlikely event that you do get flagged for excessive API requests, you'll receive an HTTP response with a code of 403 and a response body that includes
<errors><error><domain>yt:quota</domain><code>too_many_recent_calls</code></error></errors>
It's up to your code to detect this error and take appropriate action. As a best practice, we recommend stopping all API calls from your application for 10 minutes after receiving such an error in order to "reset" your quota. When you resume making API calls, you should scale back on the frequency of your requests. As a rule, API requests that do not originate from user interaction – requests made one right after another as part of a background synchronization or bulk import process, for instance – are more likely to trigger quota violations, so they should be avoided.
Update
: Watch a YouTube Developers Live broadcast devoted to quota best practices:
Cheers,
-Jeff Posnick, YouTube API Team
A New Format for JSON Results
Monday, February 1, 2010
It's been two and a half years since we
announced
JSON as an alternative output format to Atom XML for YouTube API responses. As illustrated in the
developer's guide
and
codelab
, JSON-formatted data is a natural choice when writing web applications – after all, who wants to parse XML from JavaScript?
Our existing JSON format isn't perfect, however. It's very much a literal translation from Atom. As is often the case with literal translations, the current JSON format is wordier than it needs to be, and it lacks some of the elegance that a native dialect would offer.
We've rethought out current JSON implementation, and moved away from a literal representation of the Atom data to a format that we hope will be more pleasing to those who are fluent in JSON. The vestigial XML namespace prefixes are no more, and we've removed many pieces of metadata specific to Atom documents that come across as noise in JSON. Repeating data elements are always structured as true JSON lists, and useful video metadata that exist as XML attributes in Atom have been rearranged to make more sense in the JSON document. You'll also find that the new JSON results are more compact than Atom XML, which is of special importance to code running from limited-bandwith mobile applications.
We call this new format JSON-C, and you can read about all the technical details in our
documentation
and see it in action in our
live demo
.
With the release of JSON-C, we consider the legacy JSON format officially deprecated. All new development should prefer JSON-C to JSON, and if you have existing YouTube API code that relies on JSON-formatted results, you'll need to upgrade your code to use the new format. We will be supporting legacy JSON-formatted output in accordance with the deprecation policy outlined in our
Terms of Service
.
Cheers,
-Jeff Posnick, YouTube API Team
Labels
.net
acceleration
access control
accessibility
actionscript
activities
activity
android
announcements
apis
app engine
appengine
apps script
as2
as3
atom
authentication
authorization
authsub
best practices
blackops
bootcamp
captions
categories
channels
charts
chrome
chromeless
client library
clientlibraries
clientlogin
code
color
comments
compositing
create
curation
custom player
decommission
default
deprecation
devs
direct
discovery
docs
Documentation RSS
dotnet
education
embed
embedding
events
extension
feeds
flash
format
friendactivity
friends
fun
gears
google developers live
google group
googlegamedev
googleio
html5
https
iframe
insight
io12
io2011
ios
iphone
irc
issue tracker
java
javascript
json
json-c
jsonc
knight
legacy
Live Streaming API
LiveBroadcasts API
logo
mashups
media:keywords keywords tags metadata
metadata
mobile
mozilla
news
oauth
oauth2
office hours
open source
partial
partial response
partial update
partners
patch
php
player
playlists
policy
previews
pubsubhubbub
push
python
quota
rails
releases
rendering
reports
responses
resumable
ruby
samples
sandbox
shortform
ssl https certificate staging stage
stack overflow
stage video
staging
standard feeds
storify
storyful
subscription
sup
survey
tdd
theme
tos
tutorials
updates
uploads
v2
v3
video
voting
watch history
watchlater
webvtt
youtube
youtube api
youtube developers live
youtube direct
ytd
Archive
2015
December
Chat it up, streamers! New Live Chat, Fan Funding ...
November
October
May
April
March
January
2014
October
September
August
May
March
2013
December
October
September
August
July
June
May
April
March
February
2012
December
November
September
August
July
June
May
April
March
February
January
2011
December
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
July
June
May
April
March
February
January
2009
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
2007
December
November
August
June
May
Feed
YouTube
on
Follow @youtubedev