Um den pageToken
Parameter zu verwenden, sollten Sie hier den String-Code, den Sie erhalten Ihre erste Reihe von Ergebnissen.
Zum Beispiel verwende ich Search: list mit diesen Parametern:
- part: snippet
- maxResults: 6
- order: viewCount
- type: playlist
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&maxResults=6&order=viewCount&type=playlist&_h=4&
Hier sind die Ergebnisse
- Popmusik Video
- Beliebte Rechts N ow - Russland
- Beliebte Right Now
- offiziell UK Top 40 Singles Chart - 4. Februar 2017"
- wichtige Videos
- Music Hits 2017 - Die besten Songs Play
Wenn wir nun maxResults: 3
verwenden In dieser Anfrage erhalten wir die ersten 3 wie erwartet.
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&maxResults=3&order=viewCount&type=playlist&_h=2&
{
"kind": "youtube#searchListResponse",
"etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/ytSWQ-kg4VSK7qMICh0IzyEBj9k\"",
"nextPageToken": "CAMQAA",
"regionCode": "PH",
"pageInfo": {
"totalResults": 1000000,
"resultsPerPage": 3
},
"items": [
{
"kind": "youtube#searchResult",
"etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/WsiG1obELyLKGKhqpeHgqP3Zr0g\"",
"id": {
"kind": "youtube#playlist",
"playlistId": "PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI"
},
"snippet": {
"publishedAt": "2013-11-20T16:21:03.000Z",
"channelId": "UC-9-kyTW8ZkZNDHQJ6FgpwQ",
"title": "Popular Music Videos",
"description": "",
"thumbnails": {
"default": {
"url": ,
"width": 120,
"height": 90
},
"medium": {
"url": ",
"width": 320,
"height": 180
},
"high": {
"url": "",
"width": 480,
"height": 360
}
},
"channelTitle": "Music",
"liveBroadcastContent": "none"
}
},
{
"kind": "youtube#searchResult",
"etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/HSVXUxTS3sWhu_EXXqL19b-n3VE\"",
"id": {
"kind": "youtube#playlist",
"playlistId": "PLgMaGEI-ZiiZ0ZvUtduoDRVXcU5ELjPcI"
},
"snippet": {
"publishedAt": "2014-01-13T16:24:21.000Z",
"channelId": "UCtxxJi5P0rk6rff3_dCfQVw",
"title": "Popular Right Now - Russia",
"description": "",
"thumbnails": {
"default": {
"url": "",
"width": 120,
"height": 90
},
"medium": {
"url": "",
"width": 320,
"height": 180
},
"high": {
"url": "",
"width": 480,
"height": 360
}
},
"channelTitle": "Popular on YouTube - Russia",
"liveBroadcastContent": "none"
}
},
{
"kind": "youtube#searchResult",
"etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/smJq1QWQX4SzucjteOJ91pLe96Y\"",
"id": {
"kind": "youtube#playlist",
"playlistId": "PLrEnWoR732-BHrPp_Pm8_VleD68f9s14-"
},
"snippet": {
"publishedAt": "2014-01-03T17:55:03.000Z",
"channelId": "UCF0pVplsI8R5kcAqgtoRqoA",
"title": "Popular Right Now",
"description": "",
"thumbnails": {
"default": {
"url": "",
"width": 120,
"height": 90
},
"medium": {
"url": "",
"width": 320,
"height": 180
},
"high": {
"url": "",
"width": 480,
"height": 360
}
},
"channelTitle": "Popular on YouTube",
"liveBroadcastContent": "none"
}
}
]
}
Sie werden in den obigen Ergebnissen der Parameter "nextpagetoken" bemerkt: "CAMQAA", das ist die Zeichenfolge Code, den Sie auf Ihrer nächsten Anfrage liefern müssen Holen Sie sich die nächste Seite, oder in diesem Beispiel, um die nächsten drei Ergebnisse zu erhalten, die sind:
- Die offizielle UK Top 40 Singles Chart - 4. F ebruar 2017"
- wichtige Videos
- Music Hits 2017 - Die besten Songs Play
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&maxResults=3&order=viewCount&pageToken=CAMQAA&type=playlist&_h=3&
{
"kind": "youtube#searchListResponse",
"etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/MUqIBto7KPYKqDBGqUboyp81FPs\"",
"nextPageToken": "CAYQAA",
"prevPageToken": "CAMQAQ",
"regionCode": "PH",
"pageInfo": {
"totalResults": 1000000,
"resultsPerPage": 3
},
"items": [
{
"kind": "youtube#searchResult",
"etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/yRymKW4Nn45KqMRXNQAMKnKeUB8\"",
"id": {
"kind": "youtube#playlist",
"playlistId": "PL2vrmw2gup2Jre1MK2FL72rQkzbQzFnFM"
},
"snippet": {
"publishedAt": "2015-01-04T15:21:08.000Z",
"channelId": "UCchuF2Q0QhYzeUShQUm1yzQ",
"title": "The Official UK Top 40 Singles Chart - 4th February 2017",
"description": "The Official UK Top 40 Singles Chart [Update Every Week]",
"thumbnails": {
"default": {
"url": "",
"width": 120,
"height": 90
},
"medium": {
"url": "",
"width": 320,
"height": 180
},
"high": {
"url": "",
"width": 480,
"height": 360
}
},
"channelTitle": "MUSIC CHARTS",
"liveBroadcastContent": "none"
}
},
{
"kind": "youtube#searchResult",
"etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/JCiR47eVFaF_o19Ax9V5_K2_Ux8\"",
"id": {
"kind": "youtube#playlist",
"playlistId": "PL7XlqX4npddfrdpMCxBnNZXg2GFll7t5y"
},
"snippet": {
"publishedAt": "2015-12-30T03:21:42.000Z",
"channelId": "UCZj9kF7Wu2IE_-DzbQZwCEw",
"title": "important videos",
"description": "",
"thumbnails": {
"default": {
"url": "",
"width": 120,
"height": 90
},
"medium": {
"url": "",
"width": 320,
"height": 180
},
"high": {
"url": "",
"width": 480,
"height": 360
}
},
"channelTitle": "eljolto",
"liveBroadcastContent": "none"
}
},
{
"kind": "youtube#searchResult",
"etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/BBQhDUu22HGejcoP1QvArM4001U\"",
"id": {
"kind": "youtube#playlist",
"playlistId": "PLw-VjHDlEOgvtnnnqWlTqByAtC7tXBg6D"
},
"snippet": {
"publishedAt": "2015-06-07T17:54:39.000Z",
"channelId": "UCo7i93EtJhQub3SDKrtIAPA",
"title": "Music Hits 2017 - Best Songs Playlist",
"description": "Follow this playlist on Spotify: https:xxx/DZ8tw6 Follow this playlist on Deezer: https:xxxxJmKIaH \"Music can change the world because it can change ...",
"thumbnails": {
"default": {
"url": ,
"width": 120,
"height": 90
},
"medium": {
"url": "",
"width": 320,
"height": 180
},
"high": {
"url": "",
"width": 480,
"height": 360
}
},
"channelTitle": "#RedMusic: HotMusicCharts",
"liveBroadcastContent": "none"
}
}
]
}
Dann nutzen Sie wieder die "nextPageToken": string
die nächste Seite Ergebnisse zu erhalten.
Ich hoffe, diese Informationen helfen Ihnen.