项目作者: bahildebrand

项目描述 :
Node wrapper for ProPublica campaign finance API.
高级语言: TypeScript
项目地址: git://github.com/bahildebrand/propublica-campaign-finance-node.git
创建时间: 2018-07-14T19:00:44Z
项目社区:https://github.com/bahildebrand/propublica-campaign-finance-node

开源协议:MIT License

下载


Status

Build Status Greenkeeper badge

propublica-campaign-finance-node

Node wrapper for ProPublica campaign finance API.

Getting Started

First request an api key here.

Declare a new instance of the object as follows:

  1. var ppcf = require('ppcf');
  2. var p = new ppcf('2016', 'API_KEY_HERE');

All function calls share the name of the API and accept a json object with the field indicated in the brackets of indicated in the API documentation, and return a promise with the result being a json object.

Below is an example of the candidate search function:

  1. p.candidates.search({"candidate":"trump"})
  2. .then((result) => {
  3. console.log(result);
  4. })