I have been using the YouTube search, channel, playlist api to collect video info.
But recently, some problem has occurred.
For example, I want to collect all videos and playlists in 'MassageASMR' channel.
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCgOfiuubHnhVrc9IEcSk1Nw&maxResults=50&key={YOUR_API_KEY}
but some videos info was not returned.
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCgOfiuubHnhVrc9IEcSk1Nw&q=ASMR+Crinkle+Heaven+5&key={YOUR_API_KEY}
This video(title is 'ASMR Crinkle Heaven 5') is definitely belong in this channel.
And this video info can be viewed using '/search' api with 'q' param.
But when searching all videos using '/search' api without 'q' param, I can't find this video info with in all pages.
I guess, many videos can not be retrieved.
I received a feedback message that some videos in my app are not visible.
Is there a problem with the API or do I change the param value?
YouTube has a soft limit of 500 video results returned for a search query. Since your channel has ~600 videos, 'ASMR Crinkle Heaven 5' must be one of the 100 that was left out.
Using the q parameter for 'ASMR Crinkle Heaven 5' returns 352 results, that's why you see it in that request.
To get all videos, I would suggest using multiple search queries using a filter like publishedAfter by month/year so that each result returned is less than 500. That way you can be sure of getting them all.
Related
I'm using Youtube API v3 to upload video. At the first time I use, it requires authorization then do upload but there are two videos is created. They are exactly the same but there is no error, the API returns the latest id. I checked in my channel, two videos could be view.
When I try to upload the previous video, another id returns, too, but if I use this, Youtube will show me "This video is a duplicate of another video". Other times, the API works right. Did anyone encounter this problem?
Iam building a social network website.
I want to crawl information of ALL images by a hashtag on Instagram by using Instagram API. ( I only store url link to instagram image, without store image on my server )
Is is possible ? Or Instagram API only response a limit number of recent images ?
Thanks all!
When looking at the API docs, it seems that the total amount of media on a certain hashtag can be looked up, but the actual media can only be found for recent posts.
So if you actually want to save all media, you might want to scrape all data every now and then. You do have a limit on how many times you can scrape though.
Using API you can get all hashtag media, it will start with most recent posts, you have to paginate and can get call data.
https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN
As of Oct 1, 2017, Instagram no longer gives permission for public_content scope that is required to access this data, if dont already have your app approved, you will not be able to use this API :(
I want to get related videos on Youtube when user enters the video id on my system. But system will work like this:
User will enter video id
System will find related videos of the video that user entered.
After that, system will choose one of the related videos and start to get that video's related vids list.
System will repeat this for 10 times.
And will show to user last video.
So, my problem is getting first video's related video and after last video's, after last video's etc... And my aim is try to find the journey from first video to last video.
How can I do this?
You can do this via search->list method specifying relatedToVideoId.
You can use PHP API client.
Here is a similar sample. https://github.com/youtube/api-samples/blob/master/php/search.php
I noticed some inconsistencies between the data retrieved via the Youtube API v3 and what Youtube shows accessing directly the website.
Sometimes, the data returned via the playlistitem list contains a lower number of items (videos) than the playlist shown in the website.
This happens when the playlist contains deleted videos. In fact, at times, a video marked as deleted on youtube's playlist, it is still reported in the returned data of a playlistitems call, other times it is not, leading to a playlist having 2 different sizes (i.e. 20 videos on the website and only 18 returned via the api).
This is puzzling for my users when they compare the playlists on youtube and in my application, as they see 2 different results...
Anyone knows how to handle playlists with deleted videos? Or how to retrieve the same data as it is shown in the website?
I'm using php and youtube v3 apis and youtube's php libraries if it is relevant.
I think it is a bug in the YouTube API version 3.
You should check if it is already reported as a bug and if not you can file it yourself here:
https://code.google.com/p/gdata-issues/issues/list?q=label:API-YouTube
if you decide to file it as a bug you should mention a playlistID that shows the problem.
I have noticed it too. However, it does not bother me.
In my case:
Using API version 3. The response is missing one or more items.
Missing playlist items always appear as DELETED on youtube.com
It happens on some playlists but not all.
The playlist is PUBLIC and contains only videos from other channels.
Is it possible to request all the videos associated with a face book account? So I can loop through and echo them to the page. Sort of like getting the json data of an album that has all the images within this album. I have been using [Facebook Graph API for Video][1]
[1]: http://developers.facebook.com/docs/reference/api/video/ as a reference.
I have it working for the albums and images so when a photo is added to face book it updates the website. Now I want to do the same thing for the videos.
Any ideas would be great.
Thanks!
It does not appear the Graph API offers access to a list of videos. You would need to use FQL
https://developers.facebook.com/docs/reference/fql/
And query the video table
https://developers.facebook.com/docs/reference/fql/video/
For videos owned by a user. Note you'd have to keep track of the last time you queried and limit your query only for videos with a created_time after the last time you checked.