Link to home
Start Free TrialLog in
Avatar of slightlyoff
slightlyoff

asked on

YouTube v3 API - Only getting 10 results

I'm trying to implement YouTube's API v3 - but I"m running into issues with the number of results being returned.

For example:

https://www.googleapis.com/youtube/v3/search?order=date&q=drums&maxResults=50&channelId={myChannelID}&maxResults=50&type=video&key={myAPIKiey}&part=snippet

In my jSON result set, i see:

"pageInfo": {
        "totalResults": 36,
        "resultsPerPage": 50
    },

but I only get 10 results.

I'd like to display all 36 results on one page.
Any suggestions on what I might be missing?

What's the purpose of having maxResults, if the real maxResults is 10?

Thanks for your help!
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slightlyoff
slightlyoff

ASKER

Thanks for the reply.  I think you're right - there are only 10 results for the search term.  I don't know why i didn't try other search terms yesterday.  I get more than 10 results when I search for other things.

The downside for this is that you can't use the totalResults to loop through the json.  It seemed very convenient to have that.
Hi,
thanks for the points.
You should be able to either use the items.length property to get the number of elements or use the jQuery.each functionality.
HTH
Rainer