Get survey analytics
Returns the counts and per-question aggregates behind a survey's results, already computed.
HTTP request
GET https://www.asqiro.com/api/v1/surveys/{id}/analytics
Any API key in the survey's workspace.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| id | string | The survey id, as returned by the surveys endpoints.Required |
Response body
The counts describe every response the survey has collected, not the page you last read. completionRate is a share between 0 and 1, derived from the two counts beside it, so the arithmetic is always checkable.
| Field | Type | Description |
|---|---|---|
| responseCount | integer | Responses the survey has collected, including incomplete ones. |
| completedCount | integer | Responses where the respondent reached the end. |
| incompleteCount | integer | Responses that were started and abandoned. |
| completionRate | number· nullable | Completed responses as a share of all of them, between 0 and 1. Null before the first response. |
| questions[].id | string | Id of the question these aggregates describe. Matches id on the questions endpoint. |
| questions[].respondentCount | integer | Respondents who gave a countable answer to this question. |
| questions[].skippedCount | integer | Respondents who reached this question and left it blank. |
| questions[].textAnswerCount | integer | Free-text answers counted. The wording itself is not returned here. |
| questions[].options[].value | string | The option as it appears in an answer. The array is empty for question types that have no options. |
| questions[].options[].label | string | The option as it was shown to respondents. |
| questions[].options[].count | integer | Respondents who chose this option. |
| questions[].numeric.count | integer | Answers included in the numeric summary. The whole numeric object is null for questions that do not collect a number. |
| questions[].numeric.mean | number | Arithmetic mean of the answers. |
| questions[].numeric.median | number· nullable | Middle value, or null when there were too few answers to report one. |
| questions[].numeric.min | number· nullable | Lowest answer recorded. |
| questions[].numeric.max | number· nullable | Highest answer recorded. |
| questions[].numeric.standardDeviation | number· nullable | Sample standard deviation, or null below two answers. |
| questions[].ranking[].value | string | The ranked option as it appears in an answer. The whole ranking array is null for questions that are not ranked. |
| questions[].ranking[].label | string | The option as it was shown to respondents. |
| questions[].ranking[].count | integer | Respondents who placed this option. |
| questions[].ranking[].averageRank | number· nullable | Mean position given to this option, where 1 is first. Null when nobody ranked it. |
Note Every entry in questions carries its question id, and option values match options[].value on the questions endpoint, so a result joins back to its wording without a second lookup.
Note These numbers come from the same stored aggregates the results screen reads, so a scheduled pull costs one cached payload instead of a scan of every response. A very recent response can take a short while to be included.
Errors
- unauthorized · 401 · The API key is missing, malformed, deleted, or its creator lost workspace access. Check the Authorization header, then the key itself.
- forbidden · 403 · The key is valid but lacks the access this call needs - most often a read-only key attempting a write.
- not_found · 404 · No survey with that id is reachable by this key. A survey in another workspace answers the same way as one that does not exist.
- plan_upgrade_required · 403 · The workspace owner's plan does not include API access. Upgrading the plan restores it; retrying will not.
- rate_limited · 429 · Too many requests. The Retry-After response header carries the number of seconds to wait.
Example request
bash
curl "https://www.asqiro.com/api/v1/surveys/s_7t2qk8wvbf31/analytics" \
-H "Authorization: Bearer $ASQIRO_API_KEY"Returns 200 on success.
json
{
"responseCount": 142,
"completedCount": 118,
"incompleteCount": 24,
"completionRate": 0.831,
"questions": [
{
"id": "f_channels",
"respondentCount": 118,
"skippedCount": 4,
"textAnswerCount": 0,
"options": [
{ "value": "Email", "label": "Email", "count": 71 },
{ "value": "Slack", "label": "Slack", "count": 52 }
],
"numeric": null,
"ranking": null
}
]
}