Minnesota Election Results Utility

Now ~anyone~ can be a Twitter thought-leader on election data! 🌻

This is a tiny, fully open-source utility for handling raw election results data provided by the Minnesota Secretary of State.

To get started, enter a link to a raw election results file below. The page should look something like this!

Processing...

Election Results Loaded! 🎉

Now you can do one of the following:

View JSON Download JSON View CSV Download CSV

Oops! Unable to validate that link.

Check out the FAQ below for more info on how to get a valid URL!

FAQ

WTF is this?

Basically, after each election, the Minnesota Secretary of State posts raw election results data like this. Over the years, I've had to do the same sort of pre-processing to make this data usable with modern tools.

Hopefully, this tool will save you the trouble of pre-processing the data so you can do whatever analysis you need to.

It's easy — just takes a few steps!

  1. Go to the Minnesota Secretary of State's Election Results page and select the election of your choice.
  2. Depending on the election, you'll either one of the following:
    • A summary of the results with a link at the bottom to "see the Complete Election Results"
    • A bunch of different options to select results for various districts, with a link at the bottom to "Downloadable Text Results"
  3. If you see the former, click that link and you'll be taken to the latter. Then click that "Downloadable Text Results" link.

  4. Select the election results of your choice (I'd recommend the ones that are "by Precinct")
  5. The URL for that text file is what you'll use in the above form!

What is tool this capable of doing?

The following features are currently supported:

How does the API work?

The API is just the base URL for this app along with the following passed as URL query parameters (i.e. ?url=http://example.com&type=json&download=true):

  • url (required): This is the link to the text file. Basically what's passed into the above form! Depending on the URL, it may need to be URL-encoded.
  • type: Can either be csv or json. If you include an Accept request header with text/csv or application/json, that takes precedence. This defaults to rendering this page with the form filled in.
  • download: This defaults to rendering the file in the browser. If set to true, it should download the file in the browser. This hasn't been tested in a lot of browsers, so it might not work as intended... lol

The pivot table is overwhelming! What's it for?

Pivot tables are really a powerful tool for filtering, aggregating, disaggregating, and visualizing data in a variety of ways. The pivot table on this page should already have some helpful fields populated in the row, column and aggregator fields. Feel free to drag fields around and see what happens! These are great for viewing turnout and vote breakdowns by county, precinct, etc.

The pivot table available on this page is a little clunky and overwhelming... sorry y'all 😬 I also recommend using the pivot table features available in Excel and Google Sheets!

How well does this handle large files?

I guess we'll find out! I have yet to run into any issues retrieving, parsing, and writing the data in my testing. The only slowness I've seen is with the pivot table (lol). This uses Node.js streams to pipe data into the response as the file is being read from the origin — meaning that it should scale quite well.

I should note that it is my first time working with Node.js streams/pipes — so if you are so inclined, please take a look at the source code (available by clicking the floating fish in the top-right corner). I'd love to get some feedback!

How can I submit feedback or questions?

Feel free to DM me on Twitter! I built this from the ground up in Glitch and I'm a little too lazy to move my development environment off of it at the moment. Will update this page if I create a GitHub repository for this!

Do you have plans to build this out for other states?

Nope. But if you do, definitely let me know—would love to provide links here!

Will elections actually save us?

lmao