Seems like they simply store it as wiki markup - https://ballotpedia.org/wiki/index.php?title=Marco+Rubio&action=edit, unless they generate it from some other internal database.

On Mon, Mar 12, 2018 at 8:10 PM, Stas Malyshev <smalyshev@wikimedia.org> wrote:
Hi!

> Something I wish was available is the voting record, at least at a
> country/state level.  Knowing the politician's time in office is a great
> start, but how that person voted is what really makes democracy work.

I think Ballotpedia has this data. E.g.: https://ballotpedia.org/Marco_Rubio

Not sure however if it's structured or available in API form. It also
has state level politicians, e.g.: https://ballotpedia.org/Bill_Monning
- but it seems it's even harder to parse there.
--
Stas Malyshev
smalyshev@wikimedia.org