Skip to content

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

ParameterTypeDescription
idstringThe 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.

FieldTypeDescription
responseCountintegerResponses the survey has collected, including incomplete ones.
completedCountintegerResponses where the respondent reached the end.
incompleteCountintegerResponses that were started and abandoned.
completionRatenumber· nullableCompleted responses as a share of all of them, between 0 and 1. Null before the first response.
questions[].idstringId of the question these aggregates describe. Matches id on the questions endpoint.
questions[].respondentCountintegerRespondents who gave a countable answer to this question.
questions[].skippedCountintegerRespondents who reached this question and left it blank.
questions[].textAnswerCountintegerFree-text answers counted. The wording itself is not returned here.
questions[].options[].valuestringThe option as it appears in an answer. The array is empty for question types that have no options.
questions[].options[].labelstringThe option as it was shown to respondents.
questions[].options[].countintegerRespondents who chose this option.
questions[].numeric.countintegerAnswers included in the numeric summary. The whole numeric object is null for questions that do not collect a number.
questions[].numeric.meannumberArithmetic mean of the answers.
questions[].numeric.mediannumber· nullableMiddle value, or null when there were too few answers to report one.
questions[].numeric.minnumber· nullableLowest answer recorded.
questions[].numeric.maxnumber· nullableHighest answer recorded.
questions[].numeric.standardDeviationnumber· nullableSample standard deviation, or null below two answers.
questions[].ranking[].valuestringThe ranked option as it appears in an answer. The whole ranking array is null for questions that are not ranked.
questions[].ranking[].labelstringThe option as it was shown to respondents.
questions[].ranking[].countintegerRespondents who placed this option.
questions[].ranking[].averageRanknumber· nullableMean 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.

Example response
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
    }
  ]
}