Last active
September 22, 2015 00:33
-
-
Save alexrutherford/309405b74bdebfa44fc6 to your computer and use it in GitHub Desktop.
Snippet to grab video comments from YouTube API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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