0

I want to get the top comments of youtube videos. Is there a way to do this with a scriptable commandline utility or do I need to use curl and the API.

I thought of using youtube-dl , but there seems to be no such function. Is there a similar tool capable of doing this?

Also I read some older questions, which suggested that there is no way of doing this (except by getting all comments and searching them locally), since it is not implemented in the API. So I was wondering if this changed recently.

question from 2011

question from 2015

d00-11
  • 3
  • 1

1 Answers1

0

The API doesn't order comments into 'top comments' (unless you mean top-level comments, which is default) but you can use wget and parse the output file.

wget -O output "https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&maxResults=5&videoId=[VIDEO_ID]&order=time&textFormat=plainText&key=[API_KEY]"
johnh10
  • 4,047
  • 1
  • 18
  • 30