This page has moved to Google Developers. Welcome! Learn more Dismiss

YouTube

API Overview Guide

The YouTube APIs and Tools let you bring the YouTube experience to your webpage, application, or device. The Data API lets you perform most of the operations a normal YouTube user can on the YouTube website. The Player APIs let you control the YouTube player using JavaScript or ActionScript. You can also use the basic embedded player, which already contains player controls, or the chromeless player, which lets you create your own player controls.

First, you should decide which of our APIs and tools best suits your needs. Start with the embedded player if you want to add a player to your website to show individual videos or a playlist. If you're comfortable with JavaScript or Flash, you may want to use the Player APIs to customize a chromeless player. If you are programming a device or server-side logic for a website, look at the Data API. The table below attempts to describe the experience level of a developer for each option:

Basic Player APIs with embedded player
Medium Player APIs with chromeless player
Advanced Data API and Player APIs with chromeless player

Player APIs

The player APIs let you control how YouTube videos look on your site. The first thing you should know is there are two kinds of players: the normal "embedded" player you've seen around the web, and a second "chromeless" player that is just a video box without any controls. The chromeless player is intended for experienced web programmers that want to design their own video player. Both of these players have the same API that are exposed in JavaScript and ActionScript.

Note: To allow room for critical player functionality, players must be at least 200px by 200px.


The following sections discuss each option and their uses:

Embedded Player

The embedded player is the simplest way to place a YouTube video on a webpage. To customize the behavior and color of the player, you can use the documented Player Parameters. The code to display this player can be quickly generated from a program, making it possible to find a video using the Data API and then display it using the embedded player.

Once the embedded player has been added to a webpage, it can be controlled using JavaScript. Alternatively, if you are embedding the player in a Flash application, you can use ActionScript instead. Using either system, you can perform actions similar to what the user can do by clicking on the controls: you can pause the video, seek ahead, mute the sound, etc. You are also able to poll the status of the player and listen for events, to let your code react to whatever the player is currently doing.

Chromeless Player

Interface elements and controls around content is sometimes referred to as "chrome" (e.g. the browser buttons on the top of a webpage.) The chromeless player is, by definition, a YouTube video with no controls. This makes it easy to customize within Flash or HTML.

The chromeless player exposes the same JavaScript and ActionScript APIs that the embedded player does. The player demo lets you preview the embedded and chromeless players using JavaScript and some simple HTML controls. You can also use the Google Code Playground to debug and run JavaScript player code.

Data API

The Data API allows a program to perform many of the operations available on the YouTube website. It is possible to search for videos, retrieve standard feeds, and see related content. A program can also authenticate as a user to upload videos, modify user playlists, and more.

The Data API is primarily for developers who are used to programming in server-side languages. It is useful for sites or applications that wish to have a deeper integration with YouTube. This integration could be a web application allowing users to upload video to YouTube. It could also be a device or desktop application that brings the YouTube experience to a new platform. The Data API gives you programmatic access to the video and user information stored on YouTube. With this, you can personalize your site or application with the user's existing information as well as perform actions on their behalf (like commenting on and rating videos.)

If you are curious about how the Data API works at the basic level using XML and HTTP, you can read the Protocol Guide. This guide details the requests and responses that the YouTube API servers expect and return. To learn more about the structure of these requests and responses, read the Reference Guide. This guide defines the API's feed types, HTTP request parameters, HTTP response codes, and XML elements. You may also want to read about the Google Data Protocol and the Atom Publishing Protocol, which are the standards upon which the Data API is built.

To make working with the API easier, we have a number of client libraries that abstract the API into a language-specific object model. These client libraries are open source and can be used and modified under the Apache License 2.0. There are Developer's Guides for Java, .NET, PHP, and Python as well as sample code.

Authentication required

You need to be signed in to do that.

Signing you in...

Google Developers needs your
permission to do that.