0.1.2 • Published 11 years ago
opensecrets-js v0.1.2
opensecrets-js
A NodeJS library for the OpenSecrets.org API
Installation
npm install opensecrets-js
Methods/Usage
To use the library, you must include it:
var OpenSecrets = require('opensecrets-js');
The following methods are currently available, note that all callbacks are of the form: function(error, results)
Members
OpenSecrets.getLegislators(stateID, callback)
stateID: the standard two letter state abbreviation of a state, e.g. ME for MaineCallback: the callback function
OpenSecrets.memPFDprofile(year, cid, callback)
year: The year of the electioncid: The representative's cid numberCallback: the callback function
Candidates
OpenSecrets.candSummary(stateID, callback)
stateID: the standard two letter state abbreviation of a state, e.g. ME for MaineCallback: the callback function
OpenSecrets.candContrib(cid, cycle, callback)
cid: The candidate's cidcycle: The year of the raceCallback: the callback function
OpenSecrets.candIndustry(cid, cycle, callback)
cid: The candidate's cidcycle: The year of the raceCallback: the callback function
OpenSecrets.candIndByInd(cid, cycle, ind, callback)
cid: The candidate's cidcycle: The year of the raceind: A three character industry codeCallback: the callback function
OpenSecrets.candSectory(cid, cycle, callback)
cid: The candidate's cidcycle: The year of the raceCallback: the callback function
Congressional Committees
OpenSecrets.conCmteIndus(cmte, congno, indus, callback)
cmte: Committee ID in CQ formatcongno: 112 (for 2012), 113 (for 2014)indus: Industry codeCallback: the callback function
Organizations
OpenSecrets.getOrgs(org, callback)
org: Name or partial name of organization requestedCallback: the callback function
OpenSecrets.orgSummary(id, callback)
id: CRP orgidCallback: the callback function
0.1.2
11 years ago