title: Retrieving all comments from a thread on Reddit
body: <p>I’m new to API’s and working with JSON and would love some help here.</p>
  <p>I know everything I’m trying to accomplish can be done using the PRAW library, but I’m trying to figure it out without PRAW.</p>
  <p>I have a for loop that pulls post titles from a specific subreddit, inputs all the post titles into a pandas data frame, and after the limit is reached, changes the <code>‘after</code> parameter to the last post id so it repeats with the next batch.</p>
  <p>Everything worked perfectly, but when I tried the same technique with a specific thread and gathering the comments, the <code>‘after’</code> parameter doesn’t work to grab the next batch.</p>
  <p>I’m assuming <code>‘after’</code> works differently with threads than with a subreddits posts. I saw in the JSON <code>‘more’</code> with a list of ids. Do I need to use this somehow? When I looked at the JSON for the thread, the <code>‘after’</code> says <code>‘none’</code> even with the updated parameters.</p>
  <p>Any idea on what I need to change here? It’s probably something simple.</p>
  <p><strong>Working code for getting the subreddit posts with limit 5:</strong></p>
  <pre class="lang-py prettyprint-override"><code>params = {&quot;t&quot;:&quot;day&quot;,&quot;limit&quot;:5}
  for i in range(2):
      response = requests.get('https://oauth.reddit.com/r/stocks/new',
                              headers=headers, params = params)
      response = response.json()
      for post in response['data']['children']:
          name = post['data']['name']
          print('name',name)
      params['after'] = name
      print(params)
  </code></pre>
  <p>Giving the output:</p>
  <pre><code>name t3_lifixn
  name t3_lifg68
  name t3_lif6u2
  name t3_lif5o2
  name t3_lif3cm
  {'t': 'day', 'limit': 5, 'after': 't3_lif3cm'}
  name t3_lif26d
  name t3_lievhr
  name t3_liev9i
  name t3_liepud
  name t3_lie41e
  {'t': 'day', 'limit': 5, 'after': 't3_lie41e'}
  </code></pre>
  <p><strong>Code for the Reddit thread with limit 10</strong></p>
  <pre class="lang-py prettyprint-override"><code>params = {&quot;limit&quot;:10}
  for i in range(2):
      response = requests.get('https://oauth.reddit.com/r/wallstreetbets/comments/lgrc39/',
                              params = params,headers=headers)
      response = response.json()
      for post in response[1]['data']['children']:
          name = post['data']['name']
          print(name)
      params['after'] = name
      print(params)
  </code></pre>
  <p>Giving the output:</p>
  <pre><code>t1_gmt20i4
  t1_gmzo4xw
  t1_gmzjofk
  t1_gmzjkcy
  t1_gmtotfl
  {'limit': 10, 'after': 't1_gmtotfl'}
  t1_gmt20i4
  t1_gmzo4xw
  t1_gmzjofk
  t1_gmzjkcy
  t1_gmtotfl
  {'limit': 10, 'after': 't1_gmtotfl'}
  </code></pre>
  <p>Even though the limit was set to 10, it only gave 5 id's before continuing the loop.  Also, rather than updating the <code>'after'</code> parameter, it just restarted.</p>