rtimes-package: rtimes

Description Details rtimes API Authentication Rate limits Author(s)

Description

Interface to the Congress and Campaign Finance APIs from Propublica, and the Article Search and Geographic 'APIs' from the New York Times.

Details

Backstory is that the Congress and Campaign finance APIs used to be part of NYTimes, but were taken over by Propublica.

rtimes API

Functions that wrap these sets of APIs are prefixed by two letter acronyms fo reach API endpoint + the function name itself as for example cg + fxn

See the vignette for help.

Authentication

Get your own API keys for NYTimes APIs at http://developer.nytimes.com/signup - you'll need a different key for each of the article saerch and geo NYTimes APIs.

Get your Propublica API key for Congress and Campaign Finance APIs at either https://www.propublica.org/datastore/api/propublica-congress-api or https://www.propublica.org/datastore/api/campaign-finance-api - as far as I know, you can use the same key for both APIs

We set up the functions so that you can put the key in your .Renviron file, which will be called on startup of R, and then you don't have to enter your API key for each run of a function. Add entries for an R session like

Or set them across sessions by putting entries in your .Renviron file like

You can also pass in your key in a function call, but be careful not to expose your keys in code committed to public repositories. If you do pass in a function call, use e.g., Sys.getenv("NYTIMES_AS_KEY")

Rate limits

Rate limits vary for the different APIs:

Author(s)

Scott Chamberlain myrmecocystus@gmail.com


rtimes documentation built on May 2, 2019, 2:06 p.m.