Skip to content

Instantly share code, notes, and snippets.

@renderorange
Last active October 16, 2018 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renderorange/f2a8bd0ffc6eeefe79f13de684631387 to your computer and use it in GitHub Desktop.
Save renderorange/f2a8bd0ffc6eeefe79f13de684631387 to your computer and use it in GitHub Desktop.
propublica GET request via javascript
const request = require( 'request' );
let options = {
url: 'https://api.propublica.org/congress/v1/115/senate/bills/passed.json',
headers: {
'X-API-Key': 'apikeygoeshere'
},
json: true
};
request( options,
function( err, res, json ) {
if ( err )
throw new Error( err );
console.log( JSON.stringify( json ) );
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment