0

I have been learning about youtube api. In market some of the browser extensions can able to apply video cards template to existing youtube video. As per my knowledge to do this we need to have some cards api because I don't believe Youtube will allow to modify the web app DOM directly as this will be security risk.I have gone through YT data api, reports and analytics api but I could not exactly find a way to add video cards programatically.However we can add cards from YT studio which is normal way of doing it. is there any api available for cards/annotations?if not how other developers are able to achieve this indirectly?

Note:

1)I have also posted this on YT community help but did not get response so far and posting here so that I may get some help from others. 2)I have also referred an old stackover flow post YouTube Cards API but could not find exact answer as it was posted long ago and there are so many recent changes in YT api.

Youtube data api

https://developers.google.com/youtube/v3/guides/implementation/videos

I have tried video create and update api.But could not find a field/method to add info cards

Please find the sample code below

POST https://youtube.googleapis.com/youtube/v3/videos?part=snippet%2Cstatus&key=[YOUR_API_KEY] HTTP/1.1

Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json

{
  "snippet": {
    "categoryId": "1",
    "description": "Video Description.",
    "title": "Test video 123"
  },
  "status": {
    "privacyStatus": "private"
  }
}


PUT https://youtube.googleapis.com/youtube/v3/videos?part=snippet%2Cstatus%2Clocalizations&key=[YOUR_API_KEY] HTTP/1.1

Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json

{
  "id": "YOUR_VIDEO_ID",
  "snippet": {
    "categoryId": 22,
    "defaultLanguage": "en",
    "description": "This is sample description",
    "tags": [
      "sample tag1"
    ],
    "title": "Sample title"
  },
  "status": {
    "privacyStatus": "private"
  },
  "localizations": {
    "es": {
      "title": "Hello data",
      "description": "hello description"
    }
  }
}

We have adding cards feature in Youtube studio UI.But I want to implement same with api. Reference: https://support.google.com/youtube/answer/6140493?hl=en&co=GENIE.Platform%3DDesktop

  • Please provide enough code so others can better understand or reproduce the problem. – Community Jan 23 '23 at 09:43
  • @Community, I have added sample curl commands.Kindly confirm the api availability of YouTube cards edit/update. – Digital Consultant Feb 03 '23 at 20:43
  • @Community, We have adding cards feature in Youtube studio UI.But I want to implement same with api. Reference: https://support.google.com/youtube/answer/6140493?hl=en&co=GENIE.Platform%3DDesktop – Digital Consultant Feb 03 '23 at 21:00

0 Answers0