Obtain the scheduled publish date/time for a previously uploaded and scheduled youtube video - youtube

I am traversing the uploads playlist using the youtube v3 api, and fetching details for each video using videos/list({id}). I'm requesting the snippet and contentDetails parts, but I'm finding that snippet.publishedAt and contentDetails.videoPublishedAt fields always reflect the uploaded date, not the scheduled date (for videos that were scheduled when uploaded).
I have requested all of the documented parts and don't see a 'scheduledDate' field anywhere; wondering if there is another technique to obtain this info?

According to the docs, you have at your disposal the following property:
status.publishAt (datetime)
The date and time when the video is scheduled to publish. It can be set only if the privacy status of the video is private. The value is specified in ISO 8601 format. Note the following two additional points about this property's behavior:
If you set this property's value when calling the videos.update method, you must also set the status.privacyStatus property value to private even if the video is already private.
If your request schedules a video to be published at some time in the past, the video will be published right away. As such, the effect of setting the status.publishAt property to a past date and time is the same as of changing the video's privacyStatus from private to public.
For to obtain this property from the Videos.list API endpoint, do not forget to pass to the parameter part the value status too.

Related

Is there a way to check Premiere's date and time via YouTube API?

Is there a way to check Premiere's date and time?
User can upload video to YouTube and schedule its first run. It can be done by setting a video as Premiere -> https://support.google.com/youtube/answer/9080341?hl=en
I would like to know the time and date when a video will be "live"; when I can actually watch it.
I can't find any parameter in /videos or /search that could help.
Only liveStreamingDetails or eventType=upcoming belongs to category of what I search for but they don't provide information about date and time.
Best,

Playlist video API missed certain posts when ran on particular day

I use Youtube APIs to keep track of the brand assets of a certain channel.
Playlist API: https://www.googleapis.com/youtube/v3/playlistItems
There is a weekly refresh on the platform. In one of the refresh, playlist API missed a certain post in the corresponding week. Post published date was well within the range.
Any justifiable reason for this issue? Just want to get the root cause and probability for this issue to occur, so that I can build some safeguard on my platforms if required.
To my knowledge the result set obtained from PlaylistItems endpoint should be exact -- no fuzziness implied like in the case of Search endpoint. Therefore I am inclined to believe -- you did not provided actual data along with your question -- that there is something else that caused your issue.
Often users of the API overlook the fact that any video could first be uploaded as private and only later made public.
publishedAt (datetime)
The date and time that the video was published. Note that this time might be different than the time that the video was uploaded. For example, if a video is uploaded as a private video and then made public at a later time, this property will specify the time that the video was made public.

Prevent live broadcast in search result using Youtube api v3

I am using YouTube API v3 to search for videos using Type = "video" with
snippet result.
Is there a way to tell YouTube API to ignore Live or Upcoming or Completed broadcasts videos in the result? Just need regular video search.
You may check the Search:list to know the parameters that this query supports.
eventType - The eventType parameter restricts a search to broadcast events. If you specify a value for this parameter, you must also set the type parameter's value to video.
Acceptable values are:
completed – Only include completed broadcasts.
live – Only include active broadcasts.
upcoming – Only include upcoming broadcasts.
Also from this post Exclude live events from YouTube data api search query:
on closer inspection, not all livestreams even seem to have the marker [liveBroadcastContent] set. I have found some that are set to none as with ordinary videos.

Is it possible to do a search for videos updated after date? [YouTube-Data-Api]

I am wondering if it is possible to get a list of videos that have been updated after a specified date? I am writing an application that helps users manage their videos titles, thumbnails, tags, descriptions, etc. This app really targets content creators that put out episodic content on a set schedule but also includes data of past videos. I am currently able to retrieve videos but I don't want to have to retrieve every video at the start of the application. It's both costly as far as the quota is concerned and time consuming. What I would like to do, is retrieve every video when the application starts up for the first time and store the data (done) and then any time after that, retrieve only new videos and/or videos that have been updated since the last date checked. If this is possible please let me know how I would go about this.
If not and a Google engineer happens to see this, this functionality would make for a very useful feature.
Maybe you want to use publishedAfter and publishedBefore from ressource search.list.
The publishedAfter parameter indicates that the API response should
only contain resources created after the specified time. The value is
an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z). (string)
The publishedBefore parameter indicates that the API response should
only contain resources created before the specified time. The value is
an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z). (string)

YouTube API v3 Order Parameter Possible Bug

Looking at the YouTube API v3 Search documentation, it states that the order parameter is used to control ordering of API response resource results. However, when attempting to order by date, I'm not receiving the results in reverse chronological order as specified. In fact, they are not in any order whatsoever.
API Request with order date using API Explorer UI:
Is there some other way I should be requesting for results to be ordered by the time they were published on YouTube? Is there a bug in the handling of the order API parameter?
There's no bug; the 'order' parameter will sort results based on when the resources were created, This value may be slightly different than when a video is published, as a resource is created when an upload begins but a video is published when the upload finishes and is processed.
In this case, it looks like the 10 or so most recent videos were all uploaded at the exact same time (YouTube.com has a batch uploader), so you're getting the order they were created in, even though the published dates reflect minor differences (maybe a couple took a bit longer to upload or something). IF you scan the full list of results, though, you'll see they play out just fine in terms of their reverse chronological order. And generally you probably won't have so many videos that were batch uploaded like this.

Resources