Youtube Video title with API v3 without API key?

sam picture sam · May 6, 2015 · Viewed 21.6k times · Source

Is it possible to get the video title using the video ID with API v3 without the API key? I could not find any information or example of getting the title in the API documentation.

Answer

rsp picture rsp · Aug 24, 2015

No need for API key

To get the video title, you will NOT need an API key, and you'll need to make a request to:

https://noembed.com/embed?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ

Change the YouTube URL for the video that you need.

It also works with Vimeo and many other supported sites with URLs like:

https://noembed.com/embed?url=https://vimeo.com/45196609

Details

It is not possible to get the video title using the video ID with API v3 without the API key if you use the API directly. The YouTube Data API v2 is deprecated (see: YouTube Data API v2 Deprecation: Frequently Asked Questions) and currently the YouTube API doesn't support oEmbed with JSONP as it should (see Issue 4329: oEmbed callback for JSONP).

But fortunately there is the Noembed service that lets you get the titles (and other data) of YouTube videos with JSONP and without the API key.

Demo

Here is a simple demo to get the title with jQuery:

var id = 'dQw4w9WgXcQ';
var url = 'https://www.youtube.com/watch?v=' + id;

$.getJSON('https://noembed.com/embed',
    {format: 'json', url: url}, function (data) {
    alert(data.title);
});

See DEMO on JS Bin.

See also these questions: