I have found an example of someone apparently successfully doing this: https://tool.veescore.com/showcase/videos/views?interval=1d, but this only updates once every 5 days. Can anyone suggest how I could request this information manually?
YouTube api request allows you to enter a specifier for published after x time, so you could grab the time 24 hours ago and apply it to.
https://www.googleapis.com/youtube/v3/search?part=snippet&order=viewCount&publishedAfter=2017-10-27T00%3A00%3A00Z&key=YOUR_API_KEY
Related
I'm using MS Graph API endpoint /beta/reports/getTeamsUserActivityUserDetail on a daily basis. According to this doc page it is expected that activity data is not available before 48 hours, thus I'm always using the date parameter with a value corresponding to "3 days ago".
However, when trying to retrieve activity data today for three different tenants, it appears that no activity data is available starting from november 13. That is, latest data available is from november 12 (confirmed by property reportRefreshDate of each user object, which is "2022-11-12" at best, when I query the report with parameter period='D7'), thus meaning latest report data has been generated 5 days ago 🤔
Plus, in the past few days, I got some HTTP 504 / gateway timeout errors when retrieving reports paginated data, not sure if this is related though.
Is there currently an issue with user activity reports generation?
This was likely an issue on MS Graph API side, which appears to be solved now.
This morning, when running the same query with parameter period='D7' I now get activity data statistics for two days ago 👍
I use Google API to get a JSON result of my own YouTube channel videos.
The URL has not changed, but suddenly, Google returns the JSON only with order=relevant instead of order by date.
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCqEcEGQ0sG89j7ZhOdgFOyg&maxResults=24&order=date&type=video&videoType=any&key=<key>
The first result returned will be a 2 year old video instead of yesterday's one.
This call did work 'till last week (week 11 2016)
From this thread, it seems it is a bug and that the YouTube team is aware of it. A Google employee responded 3 days ago with:
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.
Thanks for your patience while we work through this. Will update this
thread when these features are working normally again, feel free to
subscribe for updates.
You can subscribe to the thread for faster updates.
How far can you get data from youtube api? I was testing on getting data from the past and was only able to get 6 months from now. Can anyone confirm this? Thank you very much
Edit: It seems like the issue is only visible when i'm using the https://github.com/alaouy/youtube package. I tried to access it via url and I got a response data.
EDIT 2:
Here is the call:
https://www.googleapis.com/youtube/v3/search?key={KEY}&part=snippet&channelId=UCBJycsmduvYEL83R_U4JriQ&type=video&order=date&publishedBefore=2016-11-30T23%3A59%3A59.999999%2B08%3A00&publishedAfter=2016-09-01T00%3A00%3A00.000000%2B08%3A00&maxResults=50
I used this script in curl on loop with -3 months every loop in 5 seconds interval
I'm trying to retrieve videos posted last 10 minuttes , but query is retrieving videos from 2015
https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=25&publishedAfter=2018-02-13T23%3A10%3A00Z&q=surfing&key={MyAPIKey}
After looking around in forums, only advice I found was try to add the PublishedBefore option, but that did not help either.
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.
https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=25&publishedAfter=2018-02-13T14%3A14%3A58Z&q=surfing&key={MyAPIKey}
So even though I responded 13+ hours after your post, my datetime is still about 9 hours before your example.
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:
2018-02-12T00:00:00Z
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:
https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=25&publishedAfter= 2018-02-12T00:00:00Z
&q=surfing&key=API_KEY
Our URL is below:
https://www.googleapis.com/youtube/v3/search?part=id%2Csnippet&maxResults=40&channelId=xxx&type=video&order=date&publishedAfter=2019-03-14T00:00:00Z&fields=items%2Fid%2Citems%2Fsnippet(title%2CpublishedAt)&access_token=yyy
Note I have replaced our Channel ID and Access Token with substitute values for this post.
The publishedAfter parameter is not working and has never worked for us. This wasn't a problem until the March 15-16 timeframe when something changed w/ the YouTube API and the order parameter is no longer being considered by their service. Since that time, all videos are being returned by their API in order of upload date (for us, this means starting w/ 2015).
I need to make a twitter page to show the tweets that happened a year ago for a certain hashtag.
The page should show the tweets wrote, but a year ago right in this time "hour, min, second".
I looked in the twitter API and i didn't get anything useful.
Please help me.
For search you can use the since and until operators.
https://dev.twitter.com/docs/using-search
but you may have issues retrieving tweets from a year ago, or even 2 weeks ago.
To overcome this I suggest looking into Snapbird API
https://github.com/remy/snapbird