Skip to main content

QualtricsAPI is a lightweight Python library for the Qualtrics Web API.

Project description


Build Status PyPI PyPI - Downloads

Author: Jeremy Seibert
License: MIT
Package Documentation: Documentation

Qualtrics is an awesome company that builds software which gives users the ability to collect online data through online surveys. This python package, exists as a wrapper on top of the Qualtrics API. This package's primary goal is to be a super convenient way for python users to ingest, or upload their data from Qualtrics to their development environment, and vice versa.

Before we continue, I want to mention two things:

First, you must have Qualtrics API access in order to use this package. Contact whomever your Qualtrics Account Manager is for further clarification on your account's access credentials.

Secondly, this package is not affiliated with Qualtrics. Thus, I the author of this package, Jeremy Seibert, is not affiliated with Qualtrics, and Qualtrics does not offer support for this package. For specific information about the Qualtrics API, you can refer to their official documentation.

R Users

For any R users there is an equally awesome package called "qualtRics" which functions in very similar ways to this package. I have tried to keep consistent with some of the methods that are used in the qualtRics package and this one, so that there is a cohesion between the two. However, I don't believe that it supports functionality to work within the XM Contacts Data (i.e. the XMDirectory, or Mailing Lists). CRAN

Authors: Julia Silge, Jasper Ginn
License: MIT

Basic Usage

Credentials Code Flow

We first create environment variables that will hold your API credentials, so you don't have to continually declare them. To do this we import the Credentials module, create and call the qualtrics_api_credentials()method.

from QualtricsAPI.Setup import Credentials

#Call the qualtrics_api_credentials() method (Non-XM Directory Users)
Credentials().qualtrics_api_credentials(token='Your API Token',data_center='Your Data Center')

#Call the qualtrics_api_credentials() method (XM Directory Users)
Credentials().qualtrics_api_credentials(token='Your API Token',data_center='Your Data Center',directory_id='Your Directory ID')

This will generate environment variables that will be used to populate the HTTP headers which are necessary to make your API calls.

Contact Data

Now the generation of the necessary HTTP headers will be handled automatically, so we don't have to worry about it. We have 2 modules available to work with Contact Data. The first is XMDirectory(), and MailingList(). We import each as follows below.

from QualtricsAPI.XM import XMDirectory
from QualtricsAPI.XM import MailingList

#Create instances of each
x = XMDirectory()
m = MailingList()

Once imported, there are 10 methods that are available between both modules.

  1. XMDirectory() Class Methods
# Creates contacts in the XMDirectory

#Deletes a contact in the XMDirectory (use cautiously!)

#lists Contacts in the XMDirectory
  1. MailingList() Class Methods
#Creates a new Mailing list for the given Qualtrics User()

#Lists the Mailing Lists for the given Qualtrics User()

#Gets the Attributes of the defined Mailing List

#Renames the defined Mailing List

#Deletes a defined Mailing List (use cautiously!)

#Lists the contacts in the defined Mailing List

#Creates contacts in a Mailing List

Survey Module

The Responses() module has two methods. Each of those methods can be called using the following methodology.

from QualtricsAPI.Survey import Responses

#Get Survey Responses (Updated)

#Get Survey Questions (Updated)


Again this is currently under development so there may be reduced functionality, but I hope this helps fellow Qualtrics users to expedite their current workflow!

Want to Contribute?

This project abides by the Contributor Code of Conduct. By participating in this project you agree to abide by its terms. Feedback, bug reports (and fixes!), and feature requests are welcome!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for QualtricsAPI, version 0.5.8
Filename, size File type Python version Upload date Hashes
Filename, size QualtricsAPI-0.5.8-py2-none-any.whl (32.1 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size QualtricsAPI-0.5.8-py3-none-any.whl (32.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size QualtricsAPI-0.5.8.tar.gz (24.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page