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 |
Provides the top organizations contributing to specified politician.
GetCandContribData(params)
GetCandContribData(params)
params |
Any parameter accepted by this web service call – see here. |
## 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)
## 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.
GetCandIndByIndData(params)
GetCandIndByIndData(params)
params |
Any parameter accepted by this web service call – see here. |
## 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)
## 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.
GetCandIndustryData(params)
GetCandIndustryData(params)
params |
Any parameter accepted by this web service call – see here. |
## 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)
## 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.
GetCandSectorData(params)
GetCandSectorData(params)
params |
Any parameter accepted by this web service call – see here. |
## 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)
## 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.
GetCandSummaryData(params)
GetCandSummaryData(params)
params |
Any parameter accepted by this web service call – see here. |
## 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)
## 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.
GetCongCmteIndusData(params)
GetCongCmteIndusData(params)
params |
Any parameter accepted by this web service call – see here. |
## 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)
## 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.
GetLegislatorsData(params)
GetLegislatorsData(params)
params |
Any parameter accepted by this web service call – see here. |
## 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)
## 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.
GetMemPFDprofileData(params)
GetMemPFDprofileData(params)
params |
Any parameter accepted by this web service call – see here. |
## 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)
## 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.
GetOrgsData(params)
GetOrgsData(params)
params |
Any parameter accepted by this web service call – see here. |
## 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)
## 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.
GetOrgSummaryData(params)
GetOrgSummaryData(params)
params |
Any parameter accepted by this web service call – see here. |
## 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)
## 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.
SetAPIKey(apiKey)
SetAPIKey(apiKey)
apiKey |
The OpenSecrets.org API key. |
SetAPIKey ("Example API Key")
SetAPIKey ("Example API Key")