Skip to content

Instantly share code, notes, and snippets.

@alexrutherford
Last active September 22, 2015 00:33
Show Gist options
  • Save alexrutherford/309405b74bdebfa44fc6 to your computer and use it in GitHub Desktop.
Save alexrutherford/309405b74bdebfa44fc6 to your computer and use it in GitHub Desktop.
Snippet to grab video comments from YouTube API
import requests
ids=['qJS3xnD7Mus','LrNSOnQIVbI','p3tUqRBiMVo']
for id in ids:
commentsLink='https://gdata.youtube.com/feeds/api/videos/'+id+'/comments?v=2'+'&alt=json&max-results=50
commentsRaw=requests.get(commentsLink)
print commentsRaw.ststus_code
# 404 means not found, 200 means success
comments=commentsRaw.json()
print comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment