我正在使用python脚本从web api收集数据。Web API提供最多50个结果(
"size":50
)但是,我需要收集所有的结果请告诉我怎么做我的初始代码如下。提前谢谢你。
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())