Youtube v3 api PublishedAfter search

I'm trying to retrieve videos posted last 10 minuttes , but query is retrieving videos from 2015{MyAPIKey}

After looking around in forums, only advice I found was try to add the PublishedBefore option, but that did not help either.

2 answers

  • answered 2018-02-13 01:22 johnh10

    I used your example and get the 2015 results, but it looks like your datetime is in the future. How did you calculate the datetime?

    I just now used format 'Y-m-d\TH:i:s\Z' for '10 min ago' and the time is quite different. This link returned the expected results.{MyAPIKey}

    So even though I responded 13+ hours after your post, my datetime is still about 9 hours before your example.

  • answered 2018-02-13 01:22 noogui

    I managed to get this working. Here's the things you can double check. Make sure you are providing the correct date format as can be seen in the publishedAfter in the search.list:


    Also make sure the API Key you're using has the Youtube Data API "ENABLED" in your google dev console.

    So, using your exact URI request, it looks like this: 2018-02-12T00:00:00Z