title: How to collect all results from a web API in Python?
body: <p>I am collecting data from a web API by using a Python script. The web API provides maximum 50 results (<code>"size":50</code>). However, I need to collect all the results. Please let me know how can I do it. My initial code is available below. Thank you in advance.   </p>
  
  <pre><code>def getData():
      headers = {
      'Content-type': 'application/json',
      }
  
      data = '{"size":50,"sites.recruitment_status":"ACTIVE", "sites.org_state_or_province":"VA"}'
      response = requests.post('https://clinicaltrialsapi.cancer.gov/v1/clinical-trials', headers=headers, data=data)
  
      print(response.json())
  </code></pre>