To get the title of the video, you can request the YouTube v3 data API :
GET https://www.googleapis.com/youtube/v3/videos ?part=snippet &id=VIDEO_ID &key=YOUR_API_KEY
To do this, you need to register on the Google Cloud Console and create an API key (it is free). You can restrict the use of the API key only on your website so that you can safely publish it in your JS / html source code if others cannot make requests on your behalf. Be sure to enable the YouTube Data 3 API in the console, otherwise your queries will return errors.
The above request will return a JSON representation of information about the video you are interested in (part of snippet ). Let's say you parse JSON into an object called result . Then you can get the title of the video using
result.items[0].snippet.title
paolo source share