Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8703951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:58:50+00:00 2026-06-13T02:58:50+00:00

Looking to grab all the comments from a given video, rather than go one

  • 0

Looking to grab all the comments from a given video, rather than go one page at a time.

from gdata import youtube as yt
from gdata.youtube import service as yts

client = yts.YouTubeService()
client.ClientLogin(username, pwd) #the pwd might need to be application specific fyi

comments = client.GetYouTubeVideoComments(video_id='the_id')
a_comment = comments.entry[0]

The above code with let you grab a single comment, likely the most recent comment, but I’m looking for a way to grab all the comments at once. Is this possible with Python’s gdata module?


The Youtube API docs for comments, the comment feed docs and the Python API docs

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:58:52+00:00Added an answer on June 13, 2026 at 2:58 am

    The following achieves what you asked for using the Python YouTube API:

    from gdata.youtube import service
    
    USERNAME = 'username@gmail.com'
    PASSWORD = 'a_very_long_password'
    VIDEO_ID = 'wf_IIbT8HGk'
    
    def comments_generator(client, video_id):
        comment_feed = client.GetYouTubeVideoCommentFeed(video_id=video_id)
        while comment_feed is not None:
            for comment in comment_feed.entry:
                 yield comment
            next_link = comment_feed.GetNextLink()
            if next_link is None:
                 comment_feed = None
            else:
                 comment_feed = client.GetYouTubeVideoCommentFeed(next_link.href)
    
    client = service.YouTubeService()
    client.ClientLogin(USERNAME, PASSWORD)
    
    for comment in comments_generator(client, VIDEO_ID):
        author_name = comment.author[0].name.text
        text = comment.content.text
        print("{}: {}".format(author_name, text))
    

    Unfortunately the API limits the number of entries that can be retrieved to 1000. This was the error I got when I tried a tweaked version with a hand crafted GetYouTubeVideoCommentFeed URL parameter:

    gdata.service.RequestError: {'status': 400, 'body': 'You cannot request beyond item 1000.', 'reason': 'Bad Request'}
    

    Note that the same principle should apply to retrieve entries in other feeds of the API.

    If you want to hand craft the GetYouTubeVideoCommentFeed URL parameter, its format is:

    'https://gdata.youtube.com/feeds/api/videos/{video_id}/comments?start-index={sta‌​rt_index}&max-results={max_results}'
    

    The following restrictions apply: start-index <= 1000 and max-results <= 50.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking for a perl one-liner what will find all words with the next pattern:
Looking for a control that allows to select one text value at a time
Greetings all, I'm looking for a more efficient way to grab multiple users without
Well, I'm looking for a regexp in Java that deletes all words shorter than
If I am creating a simple web scraper (from root url, grab all links,
im looking for a way in php to grab entries from a table named
I'm looking to put together a simple scriptable backup utility to grab all the
I am looking for an effective way to grab image data off video files.
I'm looking for a way to grab a piece of markup that is in
I'm looking for a simple line or two of code that will grab an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.