This Choreo retrieves the total amount of donations aggregated by a specified location (by state and/or zip code). The Choreo makes an HTTP request to the NYTimes Campaign Finance Service, which is described at http://developer.nytimes.com/docs/campaign_finance_api#h3-pres-state-zip.
Here's an example of acceptable inputs:
APIKey: {YOUR API KEY}
CampaignCycle: 2012
ResourceType: zips
Location: 10013
The following is a sample of the JSON information returned by this Choreo:
{
"results": [
{
"contribution_count": 278,
"zip": "10013",
"total": "269521.48",
"candidate": "/candidates/P80003338.json",
"full_name": "Barack Obama",
"party": "D"
},
{
"contribution_count": 109,
"zip": "10013",
"total": "161425.0",
"candidate": "/candidates/P80003353.json",
"full_name": "Mitt Romney",
"party": "R"
},
{
"contribution_count": 8,
"zip": "10013",
"total": "5256.0",
"candidate": "/candidates/P80000748.json",
"full_name": "Ron Paul",
"party": "R"
},
{
"contribution_count": 8,
"zip": "10013",
"total": "4998.0",
"candidate": "/candidates/P00003608.json",
"full_name": "Herman Cain",
"party": "R"
},
{
"contribution_count": 2,
"zip": "10013",
"total": "4500.0",
"candidate": "/candidates/P20003281.json",
"full_name": "Rick Perry",
"party": "R"
},
{
"contribution_count": 6,
"zip": "10013",
"total": "4150.0",
"candidate": "/candidates/P20003067.json",
"full_name": "Jon Huntsman",
"party": "R"
},
{
"contribution_count": 2,
"zip": "10013",
"total": "3000.0",
"candidate": "/candidates/P20002556.json",
"full_name": "Tim Pawlenty",
"party": "R"
},
{
"contribution_count": 1,
"zip": "10013",
"total": "2500.0",
"candidate": "/candidates/P20002671.json",
"full_name": "Gary Johnson",
"party": "R"
},
{
"contribution_count": 1,
"zip": "10013",
"total": "500.0",
"candidate": "/candidates/P60003654.json",
"full_name": "Newt Gingrich",
"party": "R"
}
],
"base_uri": "http://api.nytimes.com/svc/elections/us/v3/finances/2012/",
"copyright": "Copyright (c) 2012 The New York Times Company. All Rights Reserved.",
"cycle": 2012,
"status": "OK",
"offset": 0
}