diegoaguilar diegoaguilar - 1 year ago 97
AngularJS Question

How to paginate if no page token present in Youtube API search request

I'm querying videos to Youtube API with AngularJS this way:

$http.get('https://www.googleapis.com/youtube/v3/search', {
params: {
key: 'API_KEY',
type: 'video',
part: 'id,snippet',
maxResults: '10',
fields: 'items/id,items/snippet/title,items/snippet/description,items/snippet/thumbnails/default,items/snippet/channelTitle',
q: query

However, the response object is only returning a JSON response with
property but there's not a

I need to obtain multiple results, so it's pretty important to me to be capable to paginate the search.

I already tried with out
query param but got not results. How can I achieve it?

Answer Source

I was trimming the API answer to myself:

fields: 'items/id,items/snippet/title,items/snippet/description,items/snippet/thumbnails/default,items/snippet/channelTitle'

So the fields param is the one telling API which response properties to include.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download