vp1
vp1

Reputation: 65

Maximum number of comments from Youtube video with API?

What Java API code to use to retrieve more than 50 comments for selected video? Or this is impossible? Thanks!

Upvotes: 1

Views: 1207

Answers (2)

Salman Arshad
Salman Arshad

Reputation: 272236

According to the documentation, the maximum value for the max-results parameter is 50. However, it is possible to create a loop that reads 50 items per iteration using the start-index parameter:

Notes:

  1. The returned feed contains a property called openSearch$totalResults which gives you (approximate) number of total results. Or you can exit the loop when you get less than 50 results.
  2. You can use alt=rss or alt=atom if you want data in XML format
  3. prettyprint=true parameter is added for readability only

Upvotes: 1

Zack
Zack

Reputation: 5148

From what I've researched, it seems the max amount of results (videos/comments) you can retrieve is 50, but it is not recommended. See here

Upvotes: 0

Related Questions