knime youtube api search result next page - youtube-api

I am using the example server provided by knime to get youtube search result. But I am only able to get maximum 50 results. how do I get access to more results?
https://www.knime.com/nodeguide/data-access/rest-web-services/access-youtube-rest-api

Since it's using Youtube API, you'll be using nextPageToken to access the next results. So in your case that would be 51-100. The prevPageToken does the opposite.
pageToken
The pageToken parameter identifies a specific page in the result set
that should be returned. In an API response, the nextPageToken and
prevPageToken properties identify other pages that could be retrieved.
You can try here in Google API
Explorer.
Authorize and Execute. If there's more than 50 result, you'll notice a nextPageToken in the JSON response. Place that in the "pageToken" property and execute again. You'll be given the 51-100 results. The same thing happens with 101-150 and so forth.

Related

https://www.googleapis.com/youtube/v3/search api returning empty response

I am trying to search videos through https://www.googleapis.com/youtube/v3/ api.
When I call the api for the first time without pageToken, i am getting pageInfo - totalResults as 1000000.
After loading more than 500 in my recyclerview, loadafter not getting called because search API returning empty items.
YouTube Search call has a soft limit of 500 results returned, regardless of total found.
See this answer how to get all: How can get all results from Youtube API (search API) response

YouTube Content ID API : AssetSearch Issue

I am working on YouTube Content ID API to fetch assests which are added today.
First of all I try to explore API on YouTube Content ID API explorer and then find asset search suitable for my criteria.So I provided the required parameters and got the response but response include only 25 results each time so I used NextPageToken
recived from response to get next assests,so far so good ,but for all this responses I noticed the ResultsPerPage varies for each request which confused me.As I assumed that ResultsPerPage indicates the all assests for the particular content owner and considering this I decided to code but now I'm unable to decide how should procced.
Can any one help me to understand this
Both the totalResults and ResultsPerPage are not reliable, according to employees at YouTube. You can only rely on the data that comes through. You can verify this with your TAM/Partner Manager.
In order to get the real count of your assets (I'm assuming you're using AssetSearch?), you have to keep paginating until there's no "nextPageToken' in the response, and count your results.
By the way, if you set the parameter "maxResults=50" in your request, you'll get 50 per page (until there's less than 50 left to display, which should only happen on the last page, given that you have a number of assets not divisible by 50).

How to get all comments on a YouTube video?

Since Google has deprecated the YouTube v2 API, I cannot find a way to get all the comments from a video.
Is it possible to use a single, non-deprecated API (Google+, YT v3) to do that?
I am not concerned about maintaining threading.
Believe me it works
https://www.googleapis.com/youtube/v3/commentThreads?key=******************&textFormat=plainText&part=snippet&videoId=kffacxfA7G4&maxResults=50
Key will be provided by the google developer console and 50 denotes 50 comments in form of a json, video id is the id of the video. For any type of queries comment below.
You can get only 100 at most at a time with the comments API. But you get a nextPageToken from the comment api response. Pass &pageToken={nextPageToken} to next api call, until the nextPageToken is undefined. Then you can get all comments if you like.
https://www.googleapis.com/youtube/v3/commentThreads?key={your_api_key}&textFormat=plainText&part=snippet&videoId={video_id}&maxResults=100&pageToken={nextPageToken}
Apparently it is now possible to fetch comment threads.
(old answer)
Currently that's impossible with a first-party tool.
Source:
While v3 offers the majority of v2 functionality, there are currently
a couple of tasks that can only be done with the older API.
Specifically, applications that manage captions or that work with
video comments still need to use the v2 API until modern equivalents
are available. Our goal is to provide similar functionality well
before the April 2015 shut-off date—please subscribe to this blog, the
YouTube Data API v3 revision history page, or follow +YouTubeDev on
Google+ to keep up-to-date. -
http://apiblog.youtube.com/2014/03/committing-to-youtube-data-api-v3.html
TubeKit (YouTube crawling toolkit) might be of help to some.
You can fetch all the comments using https://www.googleapis.com/youtube/v3/commentThreads
The Youtube API v3.0 allows you the following parameters.
textFormat - This parameter indicates whether the API should return comments formatted as HTML or as plain text. The default value is html.
videoId - The Youtube Video ID you want to fetch comments for ( if you dont know your Youtube Video ID, you can get one from Youtube Video ID Finder )
maxResults - The maxResults parameter specifies the maximum number of items that should be returned in the result set.
pageToken - The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved.
$.ajax({
dataType: "jsonp",
type: 'GET',
url: "https://www.googleapis.com/youtube/v3/commentThreads?key=PUT-YOUR-KEYXXXXXXX&textFormat=plainText&part=snippet&videoId=PUT-YOUR-VIDEO-ID",
success: function(result){
data = result;
$('.data').text(data);
console.log(data);
}});
To find PUT-YOUR-KEY(API key) ---> https://console.developers.google.com/apis/credentials then click on blue color button select API key option you can get

how to get the exact page of searchlist in Youtube api V3?

As you know use, i can use Optional parameters:
pageToken to get nextPageToken or
prevPageToken
but how can i get the exact page, like page4? Link
There is no way to jump ahead through results as in web page. You need to iterate through pages.

Why is the twitter list API not returning the correct number of results?

I'm using the twitter List API to get tweets from a set of accounts that I've added to a list. However, I'm noticing that for some reason I'm not receiving the correct number of tweets in the response from twitter. Here is my URL
https://api.twitter.com/1/lists/statuses.xml?list_id=68707107&per_page=30
I'm clearly asking for 30 results there, however if you just type that into a web browser you'll see it does not return 30 results. Does anyone know why this is?
Thanks!!
The per_page attribute it's an "up to" value. If you use the since_id you may get better results. And the pages in the api are being deprecated as you can read in the doc.
Work your solution using the since_id and max_id arguments in the api.
Check https://dev.twitter.com/docs/working-with-timelines
Check this answer: GET lists/statuses per_page returning unexpected results
Twitter may be limiting the number of tweets in requests to 20 so you could try downloading 20 and then load the next 10 after that.

Resources