Reputation: 260
I want to scrape YouTube for not only the Published Date, but the Uploaded Date of a video. My business uploads a video as a private listing, days or weeks before it's publicly published. Querying the part=snippet will return the 'publishedAt' item, which is the time at which the video was published as public. But I do not see a comparable 'uploadedAt' item. When I go to the video's edit page on YouTube, I can see the Upload Date (which currently I'm manually copying into my spreadsheet), but it doesn't appear to be accessible within YouTube APIv3.
Am I missing something, or am I correct in assuming there is no way to scrape the upload date of a video?
Upvotes: 2
Views: 2396
Reputation: 5319
Unfortunately, once a private video gets updated to public, the publishedAt
date gets updated from the date that the video was uploaded to the date that it was made public. At this point, the upload date is no longer available directly in the API.
From YouTube's documentation about snippet.publishedAt
:
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.
There are a couple of special cases:
- If a video is uploaded as a private video and the video metadata is retrieved by the channel owner, then the property value specifies the date and time that the video was uploaded.
- 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.
The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
Relevant documentation about this behavior can be found here
As an alternative, you could consider scraping the YouTube Studio Dashboard with Browser-based tools like Selenium (or use something like BeautifulSoup to parse the Dashboard HTML) to get the data you're looking for.
Upvotes: 1