title: How to get all comments of a facebook post using facebook SDK in Python?
body: <p>I want to get all comments of a facebook post. We can extract comments by  passing the <code>limit()</code> in Api call But how we know the limit? I need all comments. </p>
  
  <pre><code>https://graph.facebook.com/10153608167431961?fields=comments.limit(100).summary(true)&amp;access_token=LMN  
  </code></pre>
  
  <p>By using this </p>
  
  <pre><code>data = graph.get_connections(id='10153608167431961', connection_name='comments')
  </code></pre>
  
  <p>I am getting few comments. 
  How can I get all comments of a post?</p>
  
  <p><strong>Edit</strong></p>
  
  <pre><code>import codecs
  import json
  import urllib
  
  import requests
  B = "https://graph.facebook.com/"
  P ="10153608167431961"
  f = "?fields=comments.limit(4).summary(true)&amp;access_token="
  T = "EAACb6lXwZDZD"
  url = B+P+f+T
  
  
  def fun(data):
  
      nextLink =  (data['comments']['paging']['next'])
      print(nextLink)
      for i in data['comments']['data']:
          print (i['message'])
  
      html = urllib.request.urlopen(nextLink).read()
      data = json.loads(html.decode('utf-8'))
      fun(data)
  
  html = urllib.request.urlopen(url).read()
  d = json.loads(html.decode('utf-8'))
  
  fun(d)
  </code></pre>
  
  <p>It is giving the error</p>
  
  <blockquote>
    <p>KeyError: 'comments'</p>
  </blockquote>