The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
SurveySolutionsAPIv2 is a
comprehensive, production-ready R interface to the World Bank’s Survey Solutions Computer-Assisted
Personal Interviewing (CAPI) and Computer-Assisted Web Interviewing
(CAWI) platform.
Built on modern httr2, this package
supersedes the previous httr-based implementation
(SurveySolutionsAPI). It covers the full current REST API
(v1 and v2) as well as complementary GraphQL queries and mutations,
providing a robust foundation for survey operations, quality control
dashboards, and automated data pipelines.
httr2 Architecture: Fast,
resilient HTTP communications with structured error handling via
cli and automatic retries for transient server errors.ConditionExpression), Designer validations
(val), and categorical answer options
(answers).include_raw = FALSE produces pure atomic
data.table outputs that serialize cleanly with
data.table::fwrite(), with an opt-in
include_raw = TRUE to retain raw JSON nodes.exportClass).suso_createUSER()), preloaded sample assignments, and
offline basemap management.DT
and plotly.install.packages("SurveySolutionsAPIv2")You can install the latest release directly from GitHub:
# install.packages("remotes")
remotes::install_github("michael-cw/SurveySolutionsAPIv2")Configure your Survey Solutions server credentials securely using
suso_set_key(). Credentials can be supplied directly or
loaded from environment variables:
library(SurveySolutionsAPIv2)
# Set credentials for the active session
suso_set_key(
suso_server = Sys.getenv("SUSO_SERVER", "https://your-server.mysurvey.solutions"),
suso_user = Sys.getenv("SUSO_USER", "api_user"),
suso_password = Sys.getenv("SUSO_PASSWORD", "secret_pass"),
workspace = "primary"
)
# Test connectivity (returns HTTP 200 on success)
suso_PwCheck()Retrieve all questionnaires available in the active workspace:
# List questionnaires
quest_list <- suso_getQuestDetails(operation.type = "list")
print(quest_list[, .(Title, Variable, Version, QuestionnaireId)])Parse the entire questionnaire into four structured
data.table components:
# Extract questionnaire metadata
q_struct <- suso_getQuestDetails(
questID = quest_list$QuestionnaireId[1],
version = quest_list$Version[1],
operation.type = "structure",
include_raw = FALSE # Clean flat tables, ready for data.table::fwrite
)
# Access questions, validations, and answer options
questions <- q_struct$q
validations <- q_struct$val
codebook <- q_struct$answersDistribute assignments to field enumerators with preloaded sample data:
suso_set_assignments(
questID = quest_list$QuestionnaireId[1],
version = quest_list$Version[1],
responsible = "interviewer01",
quantity = 10,
prefill = list(cluster_id = 101, region = "North")
)Trigger, monitor, download, and parse export data with a single function:
# Export all approved interviews as Tabular data
survey_data <- suso_export(
questID = quest_list$QuestionnaireId[1],
version = quest_list$Version[1],
type = "Tabular",
workStatus = "ApprovedByHeadquarters",
addTranslation = TRUE
)
# The returned exportClass object contains labeled data tables
summary(survey_data)Comprehensive documentation and tutorials are available on the companion pkgdown website:
exportClass attributes, and parallel
processing.This project is licensed under the MIT License — see the LICENSE file for details.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.