Get Survey Monkey Data Using the REST API

API, Data, Tech Tips Comments (0)

Recently Survey Monkey updated their REST API to version 3, which increases the difficulty of requesting data for use in your analysis tools (e.g., R, Power BI, etc.). The language and instructions used in this post should be easy enough for a non-developer (with patience) to understand. The goal is to allow Survey Monkey account administrators to create Survey Monkey apps that then allow authenticating and getting data from their Survey Monkey account.

Why would you want to do this? Well there could be several reasons but, for most people, the main benefit is to get real-time, updated data while eliminating the need to login to Survey Monkey to perform several manual steps to get your data.

There are two parts of this process: 1. Authentication, and 2. Getting the data

You only need to authenticate occasionally since you can use a long lived token. For most people, the authentication part is the most difficult. Once we generate a token, getting data is pretty straightforward.

High-Level Workflow

  1. Survey Monkey account administrator creates a Survey Monkey app (or uses an existing app)
  2. Using the information provided with that app, get an access token to use for authentication with a data analysis tool
  3. Once access token has been acquired, use data analysis tool to authenticate into Survey Monkey REST API
  4. Retrieve Survey list to get survey ID
  5. Retrieve survey responses


Note: for the purposes of this guide, we will use Postman. You could choose a number of other routes but I think this is one of the more simple approaches for data analysts.

  1. Log in to Survey Monkey
  2. Go to My Apps in the Developer area
  3. Either create a new app or use an existing app
  4. Click on Settings for your app and use this OAuth Redirect URL
  5. Install Postman on your computer
    Okay, this is where it gets complicated. I won’t go into details about why you have to use Postman. You could actually create a real app to interface with Survey Monkey but, since we just need to get data, this would be a lot of unnecessary work. So we fake it in order to get our access token using Postman.
  6. Open Postman and enter basic info
    a. Add this URL to GET

    b. Select OAuth 2.0 

    c. click Get New Access Token

  7. Now use the information from your Survey Monkey app in My Apps to complete the info and click Request Tokenaccess_token_postman_sm
  8. It will prompt you to login using your Survey Monkey admin credentials and ask you to complete a captcha in order to Authorize
  9. At long last, we will get our token. Use access_token to authenticate in your data analysis toolaccess_token_long_lived
    Note: you can create tokens that expire at a given date but that’s for another dayWhew! So with that out of the way, we can reuse this forever. You only have to do this once. Onward!


Power BI Authentication Example

  1. In Power BI Desktop, click on Get Data -> Blank Query
  2. Click on Advanced Editor and use this to get a list of surveys from your Survey Monkey account. The two parts of this that are important are the Survey Monkey API URL and you will replace “<<API-TOKEN>>” with the access token you generated using Postman.
        Source = Web.Contents("", [Headers=[#"Authorization"="bearer <<API-TOKEN>>"]]),
        convertToJson = Json.Document(Source),
        toTable = Table.FromRecords({convertToJson})

R Authentication Example

You will enter your access token you painstakingly generated in Postman in the space where it says “Enter your access token for SurveyMonkey” below:

sm_get_surveys <- function(auth_token, page = 1, per_page = 250) {
 if (missing(auth_token)) {
 auth_token <- readline('Enter your access token for SurveyMonkey: ')
 auth <- paste("bearer", auth_token, sep=" ");
 url <- paste('', page, '&per_page=', per_page, sep='')
 survey_list_response <- httr::GET(url=url, add_headers("Content-Type" = "application/json", "Authorization" = auth ))
 if (survey_list_response$status_code != 200) {
 stop(paste('Bad response from server: ', httr::http_status(survey_list_response)))
 json <- httr::content(survey_list_response, as = 'text')
 survey_list <- jsonlite::fromJSON(json)


Get the Data

So after you authenticate, you have to request the data. I’ll show you how to get all of the responses for a survey but there are a lot of options available:

  1. Get survey list (list of survey ids)
  2. Use a specific survey id from the list retrieved in #1 to get responses in bulk{survey_id}/responses/bulk



» API, Data, Tech Tips » Get Survey Monkey Data Using...
On November 18, 2016
, , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

« »