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
Related
I am searching for historical data (last 3-4 years) from youtube/instagram/spotify/twitter.
The goal is to compare the development of views/subsription/likes over time for about 500 accounts/channels. Monthly data would be perfectly fine.
From looking at some of the APIs, it is only possible to get the data of the day. Socialblade gives you in some cases the data for the last month.
Is there an API or a Service that would help this task ?
For Twitter https://developer.twitter.com/en/docs/tweets/batch-historical/overview
For Youtube https://developers.google.com/youtube/reporting/#choose-the-right-api-for-your-application
For Instagram https://www.instagram.com/developer/endpoints/
I don't think this kind of data is available for Spotify https://developer.spotify.com/documentation/web-api/reference/users-profile/
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.
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 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
I'm able to get view count with Youtube API v3, but does anyone know how get the number of views per day? Any suggestions on how to scrape this data would be great.
Apparently it's possible:
How does one pull statistics (either daily or over time) from the YouTube API
but the person who commented how to do it now has a broken link.
Thanks in advance!
You'll have to pull in the total views every day and calculate the difference yourself.