Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including openstates with all npm packages installed. Try it out:

var openstates = require("openstates")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

openstates v0.0.1

node.js wrapper for Sunlight Open States API


A node.js wrapper for the Sunlight Foundation's Open States API.

Check out their docs here.


npm install openstates


var OpenStates = require('./openstates');

var openstates = new OpenStates(apiKey);

openstates.legDetail('NCL000173', function(err, json) {
  if (err) throw err;

// Roger West

There is a method for each Open States endpoint. Response is a JSON object.




RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free