3

I am trying to get the latest, up to date videos from a channel on youtube. Not sure why, but order: 'date', , publishedAfter: '2019-03-13T19:14:31.000Z', and publishedBefore: '2019-02-13T19:14:31.000Z', don't seem to have an effect.

The full code of what I'm using is here below:

baseURL: 'https://www.googleapis.com/youtube/v3',
params: {
    part: 'snippet',
    publishedAfter: '2019-03-13T19:14:31.000Z',
    publishedBefore: '2019-02-13T19:14:31.000Z',
    order: 'date',
    maxResults: 10,
    key: KEY,
    channelId: 'UCzQUP1qoWDoEbmsQxvdjxgQ'
}

Is youtube messing around with the API? Is there a special way we are meant to be doing this? Maybe my ordering is wrong? I'm quite confused

NoobCoder
  • 127
  • 1
  • 12
  • Possible duplicate of [Youtube Data API v3: Sort by date not working](https://stackoverflow.com/questions/55195054/youtube-data-api-v3-sort-by-date-not-working) – azenet Mar 19 '19 at 16:40

2 Answers2

1

This is a temporary issue, as per the Google forums : https://support.google.com/youtube/thread/2494861?msgid=2520468

YouTube is aware the search/sorting functions aren't working as expected – this is temporary and part of our efforts to better respond, review and remove graphic, violative content from YouTube.

azenet
  • 379
  • 1
  • 6
  • 14
1

This issue is related to the following ones:

See also Google's issue #128673552, https://issuetracker.google.com/issues/128673552.

A workaround for this issue: use PlaylistItems endpoint instead, queried for a channel's uploads list. However your should be aware of the difference between a video's published time and upload time (https://developers.google.com/youtube/v3/docs/videos#snippet.publishedAt).

stvar
  • 6,551
  • 2
  • 13
  • 28