Skip to content

Commit

Permalink
updated readme for pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjamesbrown committed Sep 7, 2016
1 parent f953aed commit c8619e5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Expand Up @@ -25,7 +25,7 @@ For use CLI need install youtube-node using -g param.
#### Installation
$ npm install youtube-node

#### Example search (search term, num results, callback) return object
#### Example search (search term, num results, <optional>params, callback) return object
var YouTube = require('youtube-node');

var youTube = new YouTube();
Expand All @@ -43,6 +43,14 @@ For use CLI need install youtube-node using -g param.

See output: [https://gist.github.com/paulomcnally/620b76a9afe81f56e8c9](https://gist.github.com/paulomcnally/620b76a9afe81f56e8c9)

You can also pass in an optional params object. This is useful for paging:

youTube.search('World War z Trailer', 2, {pageToken: 'XxXxX'}, function(error, result) {
//as above example
});

Page token is a property on the response - `nextPageToken` or `previousPageToken`

#### Example getById (youtube id, result) return object
var YouTube = require('youtube-node');

Expand Down

0 comments on commit c8619e5

Please sign in to comment.