php - YouTube DATA API maxResults strange behavior -
i getting list of myrecentsubscribers
, , value of maxresults
want max, 50:
$response = $this->service->subscriptions->listsubscriptions( 'snippet,subscribersnippet', array( 'myrecentsubscribers' => true, 'maxresults' => 50, ) );
in response have 5 items, ano no nextpage
token.
google_service_youtube_subscriptionlistresponse {#479 ▼ #collection_key: "items" +etag: ""m2yskbqfythfe4irbtieogyyfbu/onryswh5-esop0xzefvmzbepfes"" +eventid: null #itemstype: "google_service_youtube_subscription" #itemsdatatype: "array" +kind: "youtube#subscriptionlistresponse" +nextpagetoken: null #pageinfotype: "google_service_youtube_pageinfo" #pageinfodatatype: "" +prevpagetoken: null #tokenpaginationtype: "google_service_youtube_tokenpagination" #tokenpaginationdatatype: "" +visitorid: null #internal_gapi_mappings: [] #modeldata: array:2 [▼ "pageinfo" => array:2 [▼ "totalresults" => 18 "resultsperpage" => 50 ] "items" => array:5 [▼ 0 => array:5 [▶] 1 => array:5 [▶] 2 => array:5 [▶] 3 => array:5 [▶] 4 => array:5 [▶] ] ] #processed: [] }
when adjust maxresults
ex. 3, getting 3 items
, maxresults
= 5 getting 5 items
, bizarre stuff happens: maxresults
= 6 -> 6 items
, maxresults
7 , bigger -> again 5 items
. 5 default value maxresults
.
acceptable values 0 50, inclusive. default value 5. https://developers.google.com/youtube/v3/docs/subscriptions/list
the resultsperpage
being updated when change maxresults
. well, maxresults
= 6 , less, nextpagetoken
appears:
+nextpagetoken: "caiqaa" "pageinfo" => array:2 [▼ "totalresults" => 18 "resultsperpage" => 6 ]
important thing need make few request possible due quota cost, hitting limits already.
any idea why happening?
Comments
Post a Comment