Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Translating YouTube video title and description | V3 API

For the last few hours, I have been trying to find a solution to updating/uploading videos to many different languages throw the YouTube V3 API. I can set the defaultLanguage,

"defaultLanguage": string

I can set video title and description,

   "title": string,
   "description": string,

or maybe there is a way of uploading many different snippets in different languages?

"snippet": {
 "publishedAt": datetime,
 "channelId": string,
 "title": string,
 "description": string,
 "thumbnails": {
   (key): {
     "url": string,
     "width": unsigned integer,
     "height": unsigned integer
   }
 },

I don't see a way of translating the title and descriptions.

I see that it might be possible to do with the "localized" property but, I do not know if it is even possible or if it is the best way to do it.

"localized": {
  "title": string,
  "description": string
},

I would like to have some suggestions since I'm so new to YouTube API and I find this would be a very easy question to answer if you knew the answer, I do not expect any code or a complex solution but just to be guided, thanks for the help.

like image 497
Felipe Lopez Avatar asked Sep 18 '25 04:09

Felipe Lopez


1 Answers

I found the solution, localizations is what it's called.

https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.videos.update

PUT https://www.googleapis.com/youtube/v3/videos?part=localizations&key={YOUR_API_KEY}

{
 "id": "kE7dYgd3F8E",  //https://www.youtube.com/edit?video_id=kE7dYgd3F8E
 "localizations": {
  "es-do": {           //local codes, http://www.science.co.il/Language/Locale-codes.php
   "title": "Translated title",
   "description": "Translated description"
  }
 }
}
like image 50
Felipe Lopez Avatar answered Sep 19 '25 19:09

Felipe Lopez