Back to articles
Building a Political Donor Tracker with FEC Campaign Finance Data
How-ToSystems

Building a Political Donor Tracker with FEC Campaign Finance Data

via Dev.to Tutorialagenthustler

Campaign finance data is public by law. The FEC publishes every donation over $200 to federal candidates. This data powers investigative journalism, civic tech, and political research. Here's how to build a donor tracking system. FEC Data Sources Bulk data : Downloadable CSV files updated nightly API : REST API at api.open.fec.gov (free API key required) Website : fec.gov with searchable database Using the FEC API import requests import time from collections import defaultdict class FECTracker : BASE_URL = " https://api.open.fec.gov/v1 " def __init__ ( self , api_key ): self . api_key = api_key self . session = requests . Session () self . session . params = { " api_key " : api_key } def search_donors ( self , name = None , employer = None , state = None , min_amount = None , cycle = 2024 ): params = { " two_year_transaction_period " : cycle , " per_page " : 100 , " sort " : " -contribution_receipt_amount " , } if name : params [ " contributor_name " ] = name if employer : params [ " c

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
2 views

Related Articles