Youtube Data API v3 pageToken for arbitrary page

后端 未结 3 2025
情深已故
情深已故 2020-12-17 02:31

Another question on SO revealed that pageTokens are identical for different searches, provided that the page number and maxResults settings are the same.

Version 2

3条回答
  •  无人及你
    2020-12-17 03:21

    YouTube's pagetokens can be treated as indices.

    • Pagetokens for the first 1000 items can be found here.
    • Pagetokens for every 10th item in range(1, 100000) can be found here.
    • The highest available pagetoken is "CJ-NBhAA" which points to the 100.000th item with position 99.999.
    • The highest possible value for maxresults is 50.

    Use pagetoken to specify a starting point and maxresults to specify the number of items.

    Examples:

    • 1st item

    https://www.googleapis.com/youtube/v3/playlistItems?part=id%2Csnippet&playlistId=&key=&maxResults=1&pageToken=CAAQAA

    • 555th item

    https://www.googleapis.com/youtube/v3/playlistItems?part=id%2Csnippet&playlistId=&key=&maxResults=1&pageToken=CKoEEAA

    • 99999th item

    https://www.googleapis.com/youtube/v3/playlistItems?part=id%2Csnippet&playlistId=&key=&maxResults=1&pageToken=CJ6NBhAA

    • 10 items starting at 10th item

    https://www.googleapis.com/youtube/v3/playlistItems?part=id%2Csnippet&playlistId=&key=&maxResults=10&pageToken=CAkQAA

    • 30 items starting at 555th item

    https://www.googleapis.com/youtube/v3/playlistItems?part=id%2Csnippet&playlistId=&key=&maxResults=30&pageToken=CKoEEAA

    • 50 items starting at 9999th item

    https://www.googleapis.com/youtube/v3/playlistItems?part=id%2Csnippet&playlistId=&key=&maxResults=50&pageToken=CI9OEAA

提交回复
热议问题