I'm using mostly the video and search list resource types. I want to filter the results for video ads. I had hoped that ads would be a video category or there would be another identifier for video ads, but I haven't been able to find a way so far. Any ideas?
-
Just to make sure: videos including paid promotion don't interest you ? – Benjamin Loison Apr 01 '22 at 12:53
-
Any ad really is fine. – Erik Apr 03 '22 at 10:11
2 Answers
Unfortunately (AFAIK), some of those ads videos are unlisted videos - see these (1 and 2) ads videos examples I extracted while watching a random YouTube video - this ads video is public, though.
While querying the data of one of these videos (i.e. uuh2wkRmodI
) - see the example using the try-it feature in the API documentation - , I don't see any relevant information that points me this is an advertisement video - other than being an unlisted video.
Probably, you can consider its statistics - I found odd that a video has no likes, no favorites no comments AND has views:
"statistics": {
"viewCount": "32",
"likeCount": "0",
"favoriteCount": "0",
"commentCount": "0"
}
Since those are unlisted ads videos, those cannot be searched via the API. Quote:
If a video is uploaded as an unlisted video, the property value also specifies the date and time that the video was uploaded. In this case, anyone who knows the video's unique video ID can retrieve the video metadata.
Unless you somehow manages to get the VIDEO_ID
s of those ads appearing before a normal video starts, you cannot really search those videos neither by YouTube or its API.
My additional guess is also those ads videos are set by YouTube itself based (aside other settings) in the region (country) of the viewer and the owner of those ads videos pays to YouTube for embed their advertisements.
If you want to try it out, then, try to search for videos that came from channels of recognized product brands and get only their public and kind of short videos (I'm not talking abuot #shorts, but, videos with a duration of a half on a minute or less).
Additionally, take into account that some ads videos might be longer, so, in resume: you have to work with what is publicly available.

- 3,782
- 4
- 16
- 33

- 2,071
- 2
- 9
- 33
With my open-source YouTube operational API you have access to whether or not a given video is a paid promotion by fetching the isPaidPromotion
boolean in the JSON file at https://yt.lemnoslife.com/videos?part=isPaidPromotion&id=VIDEO_ID
Here are examples of videos ids:
- having paid promotion:
Q6gtj1ynstU
- not having paid promotion:
PEorJqo2Qaw
Then you have to discover all YouTube videos, to do so except if you look for specific keywords etc, there is this difficult method which consists in getting an initial set of YouTube channels, fetching their videos, fetching the comments on each video, fetching the YouTube channels from the comments and so on.

- 3,782
- 4
- 16
- 33