List Survey Statistics

List Survey Statistics

Returns question-level statistics for all questions in a specified survey, including response counts, averages, and breakdowns for choice-based questions.

Endpoint

GET /v5/survey/{survey_id}/surveystatistic

Authentication is required for all requests. See Authentication.

Path Parameters

survey_id
integer
required
The ID of the survey for which to retrieve statistics.

Query Parameters

surveypage
integer
Filter results to a specific page by page ID.
surveyquestion
integer
Filter results to a specific question by question ID.

Response

result_ok
boolean
Returns true if the request was successful.
total_count
integer
Total number of survey responses collected.
page
integer
Current page number.
total_pages
integer
Total number of pages.
results_per_page
integer
Number of results per page.
data
array
Array of question statistic objects, one per question in the survey. Each object includes the question ID and type. Statistics fields are present for answerable question types; non-answerable types (INSTRUCTIONS, ESSAY, GROUP, SCRIPT, HIDDEN) return only id and type.

Examples

Request
curl "https://api.alchemer.com/v5/survey/123456/surveystatistic?api_token=YOUR_API_TOKEN&api_token_secret=YOUR_API_TOKEN_SECRET"
Response
{
  "result_ok": true,
  "total_count": 3,
  "page": 1,
  "total_pages": 1,
  "results_per_page": 3,
  "data": [
    {
      "id": 5,
      "type": "INSTRUCTIONS"
    },
    {
      "id": 26,
      "type": "RADIO",
      "breakdown": [
        {
          "label": "Male",
          "percentage": "66.7",
          "count": "2"
        },
        {
          "label": "Female",
          "percentage": "33.3",
          "count": "1"
        }
      ],
      "total responses": "3",
      "sum": "0",
      "average": "",
      "stdDev": null,
      "min": null,
      "max": null
    },
    {
      "id": 9,
      "type": "TEXTBOX",
      "total responses": "1",
      "sum": "0",
      "average": "",
      "stdDev": null,
      "min": null,
      "max": null
    }
  ]
}