Insights

Get bounces by question

Back to top

Retrieve statistics on which questions the survey was abandoned.

GET
/v1/insights/question-drop-off/:survey

Parameters - Parameter

NameTypeDescription
surveyString

The unique id of the survey to retrieve live insights for.

Examples

curl https://api.surveyplanet.com/v1/insights/question-drop-off/62b9db151489dd913aeaa22f 
--header "Authorization: Bearer <ACCESS_TOKEN>"
// For Node.js considering using the 'node-fetch' library: npm info node-fetch
fetch(`https://api.surveyplanet.com/v1/insights/question-drop-off/62b9db151489dd913aeaa22f`, {
	headers: { Authorization: 'Bearer <ACCESS_TOKEN>' },
})
	.then((response) => response.json())
	.then((res) => console.log(res.data))
	.catch((err) => console.error(err));
# This code sample uses the 'requests' library: pip show requests
import requests
response = requests.get(
  "https://api.surveyplanet.com/v1/insights/question-drop-off/62b9db151489dd913aeaa22f",
  headers={"Authorization": "Bearer <ACCESS_TOKEN>"}
)
print(response.text)

Success response example

Success response example - Response

{
  "status": 200,
  "type": "ok",
  "message": "Request worked as expected."
  "data": [
    {
      "_id": "welcome",
      "index": -1,
      "bounced": 8
    },
    {
      "_id": "5bede818ab42d25d620efe0d",
      "index": 0,
      "bounced": 1
    }
  ]
}

Get devices

Back to top

Retrieve statistics on participant devices.

GET
/v1/insights/devices/:survey

Parameters - Parameter

NameTypeDescription
surveyString

The unique id of the survey to retrieve live insights for.

Examples

curl https://api.surveyplanet.com/v1/insights/devices/62b9db151489dd913aeaa22f 
--header "Authorization: Bearer <ACCESS_TOKEN>"
// For Node.js considering using the 'node-fetch' library: npm info node-fetch
fetch(`https://api.surveyplanet.com/v1/insights/devices/62b9db151489dd913aeaa22f`, {
	headers: { Authorization: 'Bearer <ACCESS_TOKEN>' },
})
	.then((response) => response.json())
	.then((res) => console.log(res.data))
	.catch((err) => console.error(err));
# This code sample uses the 'requests' library: pip show requests
import requests
response = requests.get(
  "https://api.surveyplanet.com/v1/insights/devices/62b9db151489dd913aeaa22f",
  headers={"Authorization": "Bearer <ACCESS_TOKEN>"}
)
print(response.text)

Success response example

Success response example - Response

{
  "status": 200,
  "type": "ok",
  "message": "Request worked as expected."
  "data": {
    "desktop": 925,
    "mobile": 56,
    "tablet": 8,
    "other": 0
  },
}

Get insights

Back to top

Retrieve the general insight data.

GET
/v1/insights/:survey

Parameters - Parameter

NameTypeDescription
surveyString

The unique id of the survey to retrieve live insights for.

Examples

curl https://api.surveyplanet.com/v1/insights/62b9db151489dd913aeaa22f 
--header "Authorization: Bearer <ACCESS_TOKEN>"
// For Node.js considering using the 'node-fetch' library: npm info node-fetch
fetch(`https://api.surveyplanet.com/v1/insights/62b9db151489dd913aeaa22f`, {
	headers: { Authorization: 'Bearer <ACCESS_TOKEN>' },
})
	.then((response) => response.json())
	.then((res) => console.log(res.data))
	.catch((err) => console.error(err));
# This code sample uses the 'requests' library: pip show requests
import requests
response = requests.get(
  "https://api.surveyplanet.com/v1/insights/62b9db151489dd913aeaa22f",
  headers={"Authorization": "Bearer <ACCESS_TOKEN>"}
)
print(response.text)

Success response example

Success response example - Response

{
  "status": 200,
  "type": "ok",
  "message": "Request worked as expected."
  "data": {
    "survey": "62b9db151489dd913aeaa22f",
    "sessions": 16,
    "bounces": 16,
    "bounceQuestions": {
      "welcome": 8,
      "62b9db151489dd913aeaa22a": 1
    },
    "minSeconds": 1,
    "averageSeconds": 3.5670103092783507,
    "maxSeconds": 21,
    "completes": 97,
  },
}

Get live insights

Back to top

Retrieve the total number of participants taking the survey now.

GET
/v1/insights/live/:survey

Parameters - Parameter

NameTypeDescription
surveyString

The unique id of the survey to retrieve live insights for.

Examples

curl https://api.surveyplanet.com/v1/insights/live/62b9db151489dd913aeaa22f 
--header "Authorization: Bearer <ACCESS_TOKEN>"
// For Node.js considering using the 'node-fetch' library: npm info node-fetch
fetch(`https://api.surveyplanet.com/v1/insights/live/62b9db151489dd913aeaa22f`, {
	headers: { Authorization: 'Bearer <ACCESS_TOKEN>' },
})
	.then((response) => response.json())
	.then((res) => console.log(res.data))
	.catch((err) => console.error(err));
# This code sample uses the 'requests' library: pip show requests
import requests
response = requests.get(
  "https://api.surveyplanet.com/v1/insights/live/62b9db151489dd913aeaa22f",
  headers={"Authorization": "Bearer <ACCESS_TOKEN>"}
)
print(response.text)

Success response example

Success response example - Response

{
  "status": 200,
  "type": "ok",
  "message": "Request worked as expected."
  "data": 25,
}

Get locations

Back to top

Retrieve statistics on participant locations.

GET
/v1/insights/locations/:survey

Parameters - Parameter

NameTypeDescription
surveyString

The unique id of the survey to retrieve live insights for.

Examples

curl https://api.surveyplanet.com/v1/insights/locations/62b9db151489dd913aeaa22f 
--header "Authorization: Bearer <ACCESS_TOKEN>"
// For Node.js considering using the 'node-fetch' library: npm info node-fetch
fetch(`https://api.surveyplanet.com/v1/insights/locations/62b9db151489dd913aeaa22f`, {
	headers: { Authorization: 'Bearer <ACCESS_TOKEN>' },
})
	.then((response) => response.json())
	.then((res) => console.log(res.data))
	.catch((err) => console.error(err));
# This code sample uses the 'requests' library: pip show requests
import requests
response = requests.get(
  "https://api.surveyplanet.com/v1/insights/locations/62b9db151489dd913aeaa22f",
  headers={"Authorization": "Bearer <ACCESS_TOKEN>"}
)
print(response.text)

Success response example

Success response example - Response

{
  "status": 200,
  "type": "ok",
  "message": "Request worked as expected."
  "data": [
    {
      "_id": "62ac8bccf8d5efcc2205976b",
      "lat": 34.04563903808594,
      "lng": -118.24163818359375
    },
    {
      "_id": "6230bb1799660c0058314cab",
      "lat": 53.97200012207031,
      "lng": -1.0980000495910645
    },
  ]
}

Get response rate

Back to top

Retrieve statistics on a survey's response rate.

GET
/v1/insights/response-rate/:survey

Parameters - Parameter

NameTypeDescription
surveyString

The unique id of the survey to retrieve live insights for.

Query Parameters

NameTypeDescription
afterStringoptional

Start date is ISO format.

beforeStringoptional

Before date is ISO format.

granularityStringoptional

One of hour, day, week, month, year

Success response example

Success response example - Response

{
  "status": 200,
  "type": "ok",
  "message": "Request worked as expected."
  "data": [
    {
        "total": 4,
        "date": { "year": 2020, "month": 11 }
    },
    {
        "total": 1,
        "date": { "year": 2020, "month": 12 }
    },
    [...]
  ]
}