Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API PHP search video limit 50? #89

Open
hatienkma opened this issue Nov 27, 2016 · 5 comments
Open

API PHP search video limit 50? #89

hatienkma opened this issue Nov 27, 2016 · 5 comments

Comments

@hatienkma
Copy link

Hello,

I have a problem, can i increase limit result to 100 or 200?

Thanks.

@salimsaid
Copy link

Hi @hatienkma ,
the youtube api can only query 50 videos, videos each result page is limited to 50 items, you can use page token to get next result page.

@hatienkma
Copy link
Author

Hi @salimsaid ,
Do you have any document for it? I search but not success.
I want to search all result with paging.
Thank you.

@salimsaid
Copy link

salimsaid commented Dec 5, 2016

Hi @hatienkma , please see code below for page token implementation

` try {
$searchResponse = $youtube->search->listSearch('id,snippet', array(
'type' => 'video',
'order' =>'date',
'channelId' =>'UCHwINorOiya_rq7VwhF0LIA',
'maxResults' => 50,
//'pageToken' => 'CJYBEAA'
));

//get nextpage token
$nextPageToken = $searchResponse['nextPageToken'];
var_dump($nextPageToken);`

@hatienkma
Copy link
Author

Thank you @salimsaid.

It's working :D.

Thanks so much :D.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@salimsaid @hatienkma and others