I am trying to download survey data (around 5000 responses) from Qualtrics using the API in R. I am using the `qualtRics` package.
Here’s my code:
library("qualtRics")
qualtrics_api_credentials(api_key = "abcxyz", #A valid token key
base_url = "dc1.qualtrics.com",
install = TRUE)
surveys <- all_surveys()
glimpse(surveys) #this gives me a list of surveys from my qualtrics account.
ema_survey <- fetch_survey(surveyID = surveys$ids6])
glimpse(ema_survey)
> ema_survey <- fetch_survey(surveyID = surveys$ids6], verbose = TRUE)
|=======================================================================================================| 100%
── Column specification ─────────────────────────────────────────────────────────────────────────────────────────
cols(
StartDate = col_character(),
EndDate = col_character(),
Status = col_character(),
IPAddress = col_character(),
Progress = col_character(),
`Duration (in seconds)` = col_character(),
Finished = col_character(),
RecordedDate = col_character(),
ResponseId = col_character(),
RecipientLastName = col_character(),
RecipientFirstName = col_character(),
RecipientEmail = col_character(),
ExternalReference = col_character(),
LocationLatitude = col_character(),
LocationLongitude = col_character(),
DistributionChannel = col_character(),
UserLanguage = col_character(),
Q1_1 = col_character()
)
> ema_survey
# A tibble: 0 × 18
# ℹ 18 variables: StartDate <chr>, EndDate <chr>, Status <chr>, IPAddress <chr>, Progress <chr>,
# Duration (in seconds) <chr>, Finished <chr>, RecordedDate <chr>, ResponseId <chr>, RecipientLastName <chr>,
# RecipientFirstName <chr>, RecipientEmail <chr>, ExternalReference <chr>, LocationLatitude <chr>,
# LocationLongitude <chr>, DistributionChannel <chr>, UserLanguage <chr>, Q1_1 <chr>