datamade / nmid-scrapers

Scrapers for NMID
MIT License
0 stars 0 forks source link

Scrape independent expenditure data #27

Open hancush opened 6 days ago

hancush commented 6 days ago

Scrape independent expenditure data from https://login.cfis.sos.state.nm.us/#/transaction/IE

To do this, page through the underlying API endpoint (https://login.cfis.sos.state.nm.us/api///Search/TransactionSearchInformation – use the Network tab in your console to see what those requests should look like). For each expenditure, get details and donors: https://login.cfis.sos.state.nm.us/api/Public/GetExpenditureDetails?transactionID=1284056&transactionVersID=1 https://login.cfis.sos.state.nm.us/api///Public/GetIEDonors?transactionId=1284056&transactionVersId=1

Combine these data sources into a single record that looks something like:

Transaction Date Reporting Entity Name Reporting Entity Type Payee Payee Type Payee Address Expenditure Amount Expenditure Description Election Type Election Year Reason Stance Donor Name Donor Address Donor Amount

Upload the final dataset to S3.

hancush commented 6 days ago

From https://www.fec.gov/help-candidates-and-committees/candidate-taking-receipts/understanding-independent-expenditures:

An independent expenditure is an expenditure for a communication that expressly advocates the election or defeat of a clearly identified candidate and which is not made in coordination with any candidate or their campaign or political party.

antidipyramid commented 4 days ago

@hancush

Each of these fields:

Transaction Date Reporting Entity Name Reporting Entity Type Payee Payee Type Payee Address Expenditure Amount Expenditure Description Election Type Election Year Reason Stance Donor Name Donor Address Donor Amount

other than the donor info look like they're recorded in the TransactionSearchInformation endpoint. Does that sound right to you? Is there anything in the transaction detail endpoint (i.e. GetExpenditureDetails) I'm overlooking?

hancush commented 3 days ago

I was working quickly, so it's very possible all of that info is in the main endpoint and we can save the request. Great spot, @antidipyramid.