Package 'ropensecretsapi'

Title: R Package for the OpenSecrets.org API
Description: An R package for the OpenSecrets.org web services API.
Authors: Thomas P. Fuller <[email protected]>
Maintainer: Thomas P. Fuller <[email protected]>
License: LGPL-3
Version: 1.0.1
Built: 2024-11-15 03:04:52 UTC
Source: https://github.com/cran/ropensecretsapi

Help Index


Provides the top organizations contributing to specified politician.

Description

Provides the top organizations contributing to specified politician.

Usage

GetCandContribData(params)

Arguments

params

Any parameter accepted by this web service call – see here.

Examples

## Not run: 
 SetAPIKey ("ENTER YOUR PRIVATE API KEY HERE.")
 params <- list (cid="N00007360", cycle="2012")
 tryCatch(
     candContribData <- GetCandContribData (params),
     error =
         function (e) {
             print (
                 paste (
                     "An exception was thrown -- details follow: ",
                     e,
                     sep=""
                 )
             )
         }
     )
 
## End(Not run)

Provides total contributed to specified candidate from specified industry for specified cycle.

Description

Provides total contributed to specified candidate from specified industry for specified cycle.

Usage

GetCandIndByIndData(params)

Arguments

params

Any parameter accepted by this web service call – see here.

Examples

## Not run: 
 SetAPIKey ("ENTER YOUR PRIVATE API KEY HERE.")
 params <- list (cid="N00007360", cycle="2012", ind="K02")
 tryCatch(
     candIndByIndData <- GetCandIndByIndData (params),
     error =
         function (e) {
             print (
                 paste (
                     "An exception was thrown -- details follow: ",
                     e,
                     sep=""
                 )
             )
         }
     )
 
## End(Not run)

Provides the top industries contributing to a specified politician.

Description

Provides the top industries contributing to a specified politician.

Usage

GetCandIndustryData(params)

Arguments

params

Any parameter accepted by this web service call – see here.

Examples

## Not run: 
 SetAPIKey ("ENTER YOUR PRIVATE API KEY HERE.")
 params <- list (cid="N00007360", cycle="2012", ind="K02")
 tryCatch(
     candIndustryData <- GetCandIndustryData (params),
     error =
         function (e) {
             print (
                 paste (
                     "An exception was thrown -- details follow: ",
                     e,
                     sep=""
                 )
             )
         }
     )
 
## End(Not run)

Provides the top industries contributing to a specified politician.

Description

Provides the top industries contributing to a specified politician.

Usage

GetCandSectorData(params)

Arguments

params

Any parameter accepted by this web service call – see here.

Examples

## Not run: 
 SetAPIKey ("ENTER YOUR PRIVATE API KEY HERE.")
 params <- list (cid="N00007360", cycle="2012")
 tryCatch(
     candSectorData <- GetCandSectorData (params),
     error =
         function (e) {
             print (
                 paste (
                     "An exception was thrown -- details follow: ",
                     e,
                     sep=""
                 )
             )
         }
     )
 
## End(Not run)

Provides summary fundraising information for a specified politician.

Description

Provides summary fundraising information for a specified politician.

Usage

GetCandSummaryData(params)

Arguments

params

Any parameter accepted by this web service call – see here.

Examples

## Not run: 
 SetAPIKey ("ENTER YOUR PRIVATE API KEY HERE.")
 params <- list (cid="N00007360", cycle="2012")
 tryCatch(
     candSummaryData <- GetCandSummaryData (params),
     error =
         function (e) {
             print (
                 paste (
                     "An exception was thrown -- details follow: ",
                     e,
                     sep=""
                 )
             )
         }
     )
 
## End(Not run)

Provides summary fundraising information for a specific committee, industry and congress number.

Description

Provides summary fundraising information for a specific committee, industry and congress number.

Usage

GetCongCmteIndusData(params)

Arguments

params

Any parameter accepted by this web service call – see here.

Examples

## Not run: 
 SetAPIKey ("ENTER YOUR PRIVATE API KEY HERE.")
 params <- list (congno="112", indus="F10", cmte="HARM")
 tryCatch(
     congCmteIndusData <- GetCongCmteIndusData (params),
     error =
         function (e) {
             print (
                 paste (
                     "An exception was thrown -- details follow: ",
                     e,
                     sep=""
                 )
             )
         }
     )
 
## End(Not run)

Provides a list of legislators and associated attributes.

Description

Provides a list of legislators and associated attributes.

Usage

GetLegislatorsData(params)

Arguments

params

Any parameter accepted by this web service call – see here.

Examples

## Not run: 
 SetAPIKey ("ENTER YOUR PRIVATE API KEY HERE.")
 params <- list (id="NJ")
 tryCatch(
     legislatorsData <- GetLegislatorsData (params),
     error =
         function (e) {
             print (
                 paste (
                     "An exception was thrown -- details follow: ",
                     e,
                     sep=""
                 )
             )
         }
     )
 
## End(Not run)

Returns PFD information for a member of Congress.

Description

Returns PFD information for a member of Congress.

Usage

GetMemPFDprofileData(params)

Arguments

params

Any parameter accepted by this web service call – see here.

Examples

## Not run: 
 SetAPIKey ("ENTER YOUR PRIVATE API KEY HERE.")
 params <- list (year="2010", cid="N00007360")
 tryCatch(
     memPFDprofileData <- GetMemPFDprofileData (params),
     error =
         function (e) {
             print (
                 paste (
                     "An exception was thrown -- details follow: ",
                     e,
                     sep=""
                 )
             )
         }
     )
 
## End(Not run)

Provides organization data.

Description

Provides organization data.

Usage

GetOrgsData(params)

Arguments

params

Any parameter accepted by this web service call – see here.

Examples

## Not run: 
 SetAPIKey ("ENTER YOUR PRIVATE API KEY HERE.")
 params <- list (org="Microsoft")
 tryCatch(
     orgsData <- GetOrgsData (params),
     error =
         function (e) {
             print (
                 paste (
                     "An exception was thrown -- details follow: ",
                     e,
                     sep=""
                 )
             )
         }
     )
 
## End(Not run)

Provides organization summary data.

Description

Provides organization summary data.

Usage

GetOrgSummaryData(params)

Arguments

params

Any parameter accepted by this web service call – see here.

Examples

## Not run: 
 SetAPIKey ("ENTER YOUR PRIVATE API KEY HERE.")
 params <- list (id="123")
 tryCatch(
     orgSummaryData <- GetOrgSummaryData (params),
     error =
         function (e) {
             print (
                 paste (
                     "An exception was thrown -- details follow: ",
                     e,
                     sep=""
                 )
             )
         }
     )

## End(Not run)

Allows the user to set the OpenSecrets.org API key once thereby removing the need to pass it in for each function call in this package.

Description

Allows the user to set the OpenSecrets.org API key once thereby removing the need to pass it in for each function call in this package.

Usage

SetAPIKey(apiKey)

Arguments

apiKey

The OpenSecrets.org API key.

Examples

SetAPIKey ("Example API Key")