StrawPoll API

Although we never intended to provide an API for StrawPoll, it's obvious that it is already there and in internal use. We thought that it might be more helpful to provide some information about it than trying to hide the endpoints.
Still, there is no reason to provide an API endpoint for voting, since we always give our best to only allow humans to vote on a poll. Therefore, we provide the following two endpoints for creating a poll programmatically as well es reading the results in real-time.


Create a Poll
We send a JSON-like formatted string to our API backend. It contains a 'poll' object like in the example below:
  • Request URL:
  • Request Method: POST
  • Post Data (example): {"poll":{"title":"Your poll question","description":"Description Text","answers":["answer #1","answer #2","answer #3"],"priv":true,"ma":0,"mip":0,"co":1,"vpn":0,"enter_name":0,"has_deadline":true,"deadline":"2020-02-27T07:00:00.000Z","only_reg":0,"has_image":0,"image":null}}
Options (Explanation)
  • priv: true/false - Private or public
  • co: true/false - Allow Comments
  • ma: true/false - Multiple Answers allowed
  • mip: true/false - Multiple votes per IP allowed
  • enter_name: true/false - Voters have to enter their name (still in development)
  • has_deadline: true/false - Activate Deadline
  • deadline: Datetime - Specific datetime of deadline in zulu time
  • only_reg: true/false - Allow only registered users to vote
  • vpn: true/false - Allow VPN users to vote
Get Poll Results
Fetching poll results are fairly easy. The results are always delivered in realtime and the response contains JSON formatted data with the poll information as well es a timestamp in UNIX-time. Keep in mind that JSON fields are not sorted, so they can are returned in random order.
  • Request URL:$id (replace $id with your poll id, obviously ;)
  • Request Method: GET
  • Response (example): GET
    {"id":"rae5gcp1","poll_answers":[{"answer":"Super easy","id":"3h8kcprp9448","sorting":1,"type":"text","votes":35},{"answer":"Somewhat easy","id":"4c6drcgb4yay","sorting":2,"type":"text","votes":3},{"answer":"Moderate","id":"47ry2yc6ad21","sorting":3,"type":"text","votes":6},{"answer":"Quite difficult","id":"kzhyffc39shs","sorting":4,"type":"text","votes":3},{"answer":"Very difficult","id":"8gxgye81zyp8","sorting":5,"type":"text","votes":7}],"success":1,"title":"How easy is embedding a StrawPoll?","total_votes":54}