Skip to content

Get Vote Totals

GET /vote

Returns aggregate statistics and, when available, the current viewer's known vote.

Authorization

Send Authorization: <Twitch Extension Client ID> <Muxy JWT>. The JWT role must satisfy the endpoint requirements shown in the examples.

Parameters

Name In Required Type Constraints Description
id query no string default "default"; at most 64 characters Poll identifier. Defaults to default; global polls use an ID beginning with global.

Responses

200 Response

Current vote statistics.

Content type: application/json

Schema
{
  "type": "object",
  "required": [
    "stddev",
    "mean",
    "sum",
    "specific",
    "count",
    "decay"
  ],
  "properties": {
    "stddev": {
      "type": "number",
      "description": "Sample standard deviation across effective stored votes."
    },
    "mean": {
      "type": "number",
      "description": "Mean of all effective stored vote values."
    },
    "sum": {
      "type": "number",
      "description": "Sum of all effective stored vote values."
    },
    "specific": {
      "type": "array",
      "description": "Exactly 32 counters. Indexes 0 through 31 count votes whose value equals that index; values outside this range still contribute to the other statistics.",
      "minItems": 32,
      "maxItems": 32,
      "items": {
        "type": "integer",
        "minimum": 0
      }
    },
    "count": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of effective stored vote entries after per-user replacement and modifiers; this is not the number of requests."
    },
    "decay": {
      "type": "object",
      "additionalProperties": true
    },
    "vote": {
      "type": "integer",
      "minimum": -128,
      "maximum": 128,
      "description": "The caller's known vote, omitted when no vote is known."
    }
  }
}
Example
{
  "stddev": 0,
  "mean": 1,
  "sum": 2,
  "specific": [
    0,
    2,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  "count": 2,
  "decay": {},
  "vote": 1
}

Generated API reference

This endpoint is generated from rest-v1.yaml.