class praw.models.reddit.poll.PollData(reddit: praw.Reddit, _data: dict[str, Any] | None)#

Class to represent poll data on a poll submission.

If submission is a poll Submission, access the poll data like so:

poll_data = submission.poll_data
print(f"There are {poll_data.total_vote_count} votes total.")
print("The options are:")
for option in poll_data.options:
    print(f"{option} ({option.vote_count} votes)")
print(f"I voted for {poll_data.user_selection}.")

Typical Attributes


This table describes attributes that typically belong to objects of this class. PRAW dynamically provides the attributes that Reddit returns via the API. Since those attributes are subject to change on Reddit’s end, PRAW makes no effort to document any new/removed/changed attributes, other than to instruct you on how to discover what is available. As a result, this table of attributes may not be complete. See Determine Available Attributes of an Object for detailed information.

If you would like to add an attribute to this table, feel free to open a pull request.




A list of PollOption of the poll.


The total number of votes cast in the poll.


The poll option selected by the authenticated user (possibly None).


Time the poll voting closes, represented in Unix Time.

__init__(reddit: praw.Reddit, _data: dict[str, Any] | None)#

Initialize a PRAWBase instance.


reddit – An instance of Reddit.

option(option_id: str) PollOption#

Get the option with the specified ID.


option_id – The ID of a poll option, as a str.


The specified PollOption.


KeyError if no option exists with the specified ID.

classmethod parse(data: dict[str, Any], reddit: praw.Reddit) Any#

Return an instance of cls from data.

  • data – The structured data.

  • reddit – An instance of Reddit.

user_selection() PollOption | None#

Get the user’s selection in this poll, if any.


The user’s selection as a PollOption, or None if there is no choice.