My favorites | Sign in
Logo
             
Search
for
Updated Jul 03, 2009 by aavindraa
Labels: Implementation
API  
Video player api for YouTube.com, and how to use it.

Introduction

Instead of loading an entire video page to get information about a video, you can retrieve only the small bits that you need and nothing else. Note that it is only useful to make calls to this API if you're not on the page of the video you want, or you're using the embedded player.

Another key thing to notice is that the t value is called token in the API.

The API

It is "get_video_info" and takes a video_id parameter:

http://www.youtube.com/get_video_info?video_id=

What is returned

An escaped query string containing many parameters.

An Example Script

The following script is a great example of how to use the API for videos. It looks up all the videos in a playlist, and gets the hidden token value for each one, as well as checks the fmt_map to see if it has an HD video.

http://userscripts.org/scripts/review/52180


Sign in to add a comment
Hosted by Google Code