Open ChrisCioffi opened 4 years ago
Investigating. The API looks to now be returning null values for candidate_name, committee_name, etc where there were previously appropriate values.
Example raw query: https://api.open.fec.gov/v1/schedules/schedule_a/?committee_id=C00638973&api_key=DEMO_KEY&per_page=100
I don't think I want to overwrite the NULL values the FEC is providing right now. I'll shoot a question to the mailing list to get a full explanation for why most of those values are NULL (upon further investigation, some do return candidate names and I was wrong in my initial assessment about previous API behavior).
For now to be safe, I would only send one committee into get_itemized_contributions. Example:
`#select all candidates running for Senate, unnest the data, deliver it in a df, and make sure they raised money
SD_senate_BORGLUM <- search_candidates(state = "SD", election_year = "2020", office = "S", candidate_status = "C" , has_raised_funds = TRUE, unnest_committees = TRUE ) %>%
filter(str_detect(name, "BORGLUM")) %>%
get_itemized_contributions(data_structure = "tidy") %>%
filter(is_individual == TRUE, is.na(memo_code))`
Hi when I run this:
select all candidates running for Senate, unnest the data, deliver it in a df, and make sure they raised money
SD_senate <- search_candidates(state = "SD", election_year = "2020", office = "S", candidate_status = "C" , has_raised_funds = TRUE, unnest_committees = TRUE ) %>%
get all their itemized contributions
get_itemized_contributions(data_structure = "tidy")
The candidate_name/committee_name/ columns render NAs, and there is no party column. But the committee column contains a nested list with this and other information.
Any way to resolve this?