Python 质量数据
Python Qualtrics Data
所以,我正在从 Qualtrics v3 API 中提取数据,并且希望每晚都提取数据。我怎么能在一个晚上提取所有数据,然后在第二天晚上回来提取所有新数据。调查响应的参数称为 "lastModified",它是最后修改日期。
调用示例如下:
import urllib.request #默认模块 Python 3.X
url = 'https://yourdatacenterid.qualtrics.com/API/v3/surveys'
header = {'X-API-TOKEN': ''}
req = urllib.request.Request(url,None,header) #generating the request object
handler = urllib.request.urlopen(req) #running the request object
print(handler.status) #print status code
print(handler.reason)
这里是 JSON 的例子:
{
"result": {
"elements": [
{
"id": "SV_0D54a3emdOh7bBH",
"name": "Imported Survey",
"ownerId": "UR_8CywXqaSNzzu1Bb",
"lastModified": "2013-10-22T20:12:33Z",
"isActive": true
},
...
],
"nextPage": "https://yourdatacenterid.qualtrics.com/API/v3/surveys? offset=10"
},
"meta": {
"httpStatus": "200 - OK"
}
}
我认为您想使用 responseexports 而不是调查。保存每天检索到的最后一个响应 ID。然后,您可以使用 lastResponseId 参数指定从何处开始拉取新数据。
所以,我正在从 Qualtrics v3 API 中提取数据,并且希望每晚都提取数据。我怎么能在一个晚上提取所有数据,然后在第二天晚上回来提取所有新数据。调查响应的参数称为 "lastModified",它是最后修改日期。
调用示例如下: import urllib.request #默认模块 Python 3.X
url = 'https://yourdatacenterid.qualtrics.com/API/v3/surveys'
header = {'X-API-TOKEN': ''}
req = urllib.request.Request(url,None,header) #generating the request object
handler = urllib.request.urlopen(req) #running the request object
print(handler.status) #print status code
print(handler.reason)
这里是 JSON 的例子:
{
"result": {
"elements": [
{
"id": "SV_0D54a3emdOh7bBH",
"name": "Imported Survey",
"ownerId": "UR_8CywXqaSNzzu1Bb",
"lastModified": "2013-10-22T20:12:33Z",
"isActive": true
},
...
],
"nextPage": "https://yourdatacenterid.qualtrics.com/API/v3/surveys? offset=10"
},
"meta": {
"httpStatus": "200 - OK"
}
}
我认为您想使用 responseexports 而不是调查。保存每天检索到的最后一个响应 ID。然后,您可以使用 lastResponseId 参数指定从何处开始拉取新数据。