Stream the Nevada Caucus Results with the Twitter API

Monday, 30 January 2012

Twitter and the Nevada Republican Party have partnered to deliver voters, developers and news organizations real-time access to the results of the “First in the West” Nevada Presidential Caucuses on February 4th. You can follow the votes on Twitter as they come in via two accounts:

  • @NVGOP will be tweeting updates on statewide vote totals and other news throughout the evening. Follow @NVGOP to track statewide caucus results, see how many precincts have reported, and for updates on closing times and other vital information.
  • @NVVoteCount will be tweeting the results from each precinct as they become available, in a format designed for news organizations and developers to easily integrate into their own data systems and visualizations. This data can be used to power real-time charts of caucus results, for example, or be mashed up with other data to create maps.

    With more than 2,000 individual precinct results expected to be tweeted out in this “machine readable” format, this account is not intended for general users.

Accessing the @NVVoteCount feed of results

To access the automated precinct-by-precinct data, you will need to use the Twitter Streaming API. Documentation on using the API to bring in data is available here.

We recommend using the follow parameter with the statuses/filter API method for streaming the Tweets sent from @NVVoteCount (user ID 475526099). You may utilize just the query string with a curl request for this kind of simple integration.

Example (where username:password are your credentials):

Example outputting Tweets to a text file as they happen:

curl -u username:password "https://stream.twitter.com/1/statuses/filter.json?follow=475526099" > nvvotecount.json

Instructions on how to parse the data in each Tweet is available here. [UPDATED 2/2/12]

To be notified of documentation updates and tests, please sign up here.