Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend lobbyist scrape to capture lobbyist employer expenditures and contributions #15

Open
hancush opened this issue Jan 17, 2024 · 0 comments

Comments

@hancush
Copy link
Member

hancush commented Jan 17, 2024

Likely to take place in Phase 2.

Start from https://login.cfis.sos.state.nm.us/api//ExploreClients/SearchClients

Payload:

{
    "ElectionYear": "2023,2022,2021",
    "BusinessType": null,
    "TransactionType": null,
    "TransactionAmount": "0.01",
    "EmployerName": null,
    "LobbyistOver": null,
    "IsCompliance": null,
    "PageNo": 1,
    "PageSize": 10,
    "SortDir": "ASC",
    "SortedBy": "",
    "IsWidgetDisplay": 0
}

Example response:

[{"ClientID":"FKuMVncaDIPPXu2BBY9jdYIAq4bYqsgWASqUMLp00XI1","ClientVersionID":2,"ClientName":"AFSCME Council 18","NumberOfLobbyists":3,"TotalCompensationAmount":0.00,"BusinessType":"Other","Address":"1202 Pennsylvania Street NE, Albuquerque, NM 87110","Members":null,"FilingYear":2021,"TotalRows":192,"RowNumber":null,"TotalContributions":10500.00,"TotalExpenditures":0.00,"IsCompliant":0,"CreatedBy":null,"CreatedDate":null,"CreatedIPAddress":null,"LobbyistClientID":null,"LobbyistClientVersionID":null,"LastModifiedBy":null,"LastModifiedDate":null,"LastModifiedIPAddress":null,"Message":null,"IsSuccess":0,"Action":null,"IsDirty":0,"PersonID":null,"PersonVersionID":null},{"ClientID":"FKuMVncaDIPPXu2BBY9jdYIAq4bYqsgWASqUMLp00XI1","ClientVersionID":3,"ClientName":"AFSCME Council 18","NumberOfLobbyists":3,"TotalCompensationAmount":0.00,"BusinessType":"Other","Address":"1202 Pennsylvania Street NE, Albuquerque, NM 87110","Members":null,"FilingYear":2022,"TotalRows":192,"RowNumber":null,"TotalContributions":10500.00,"TotalExpenditures":0.00,"IsCompliant":0,"CreatedBy":null,"CreatedDate":null,"CreatedIPAddress":null,"LobbyistClientID":null,"LobbyistClientVersionID":null,"LastModifiedBy":null,"LastModifiedDate":null,"LastModifiedIPAddress":null,"Message":null,"IsSuccess":0,"Action":null,"IsDirty":0,"PersonID":null,"PersonVersionID":null},{"ClientID":"FKuMVncaDIPPXu2BBY9jdYIAq4bYqsgWASqUMLp00XI1","ClientVersionID":4,"ClientName":"AFSCME Council 18","NumberOfLobbyists":3,"TotalCompensationAmount":0.00,"BusinessType":"Other","Address":"1202 Pennsylvania Street NE, Albuquerque, NM 87110","Members":null,"FilingYear":2023,"TotalRows":192,"RowNumber":null,"TotalContributions":10500.00,"TotalExpenditures":0.00,"IsCompliant":0,"CreatedBy":null,"CreatedDate":null,"CreatedIPAddress":null,"LobbyistClientID":null,"LobbyistClientVersionID":null,"LastModifiedBy":null,"LastModifiedDate":null,"LastModifiedIPAddress":null,"Message":null,"IsSuccess":0,"Action":null,"IsDirty":0,"PersonID":null,"PersonVersionID":null},{"ClientID":"jsUN_8A_FHbMEr9Hzrei74IAq4bYqsgWASqUMLp00XI1","ClientVersionID":2,"ClientName":"Allstate insurance Company","NumberOfLobbyists":6,"TotalCompensationAmount":0.00,"BusinessType":"Finance, Insurance","Address":"2775 Sanders Road, Ste. A2W, Northbrook, IL 60062","Members":null,"FilingYear":2021,"TotalRows":192,"RowNumber":null,"TotalContributions":198750.00,"TotalExpenditures":0.00,"IsCompliant":0,"CreatedBy":null,"CreatedDate":null,"CreatedIPAddress":null,"LobbyistClientID":null,"LobbyistClientVersionID":null,"LastModifiedBy":null,"LastModifiedDate":null,"LastModifiedIPAddress":null,"Message":null,"IsSuccess":0,"Action":null,"IsDirty":0,"PersonID":null,"PersonVersionID":null},{"ClientID":"jsUN_8A_FHbMEr9Hzrei74IAq4bYqsgWASqUMLp00XI1","ClientVersionID":5,"ClientName":"Allstate insurance Company","NumberOfLobbyists":6,"TotalCompensationAmount":0.00,"BusinessType":"Finance, Insurance","Address":"2775 Sanders Road, Ste. A2W, Northbrook, IL 60062","Members":null,"FilingYear":2022,"TotalRows":192,"RowNumber":null,"TotalContributions":198750.00,"TotalExpenditures":0.00,"IsCompliant":0,"CreatedBy":null,"CreatedDate":null,"CreatedIPAddress":null,"LobbyistClientID":null,"LobbyistClientVersionID":null,"LastModifiedBy":null,"LastModifiedDate":null,"LastModifiedIPAddress":null,"Message":null,"IsSuccess":0,"Action":null,"IsDirty":0,"PersonID":null,"PersonVersionID":null},{"ClientID":"jsUN_8A_FHbMEr9Hzrei74IAq4bYqsgWASqUMLp00XI1","ClientVersionID":9,"ClientName":"Allstate insurance Company","NumberOfLobbyists":6,"TotalCompensationAmount":0.00,"BusinessType":"Finance, Insurance","Address":"3100 Sanders Road, Ste. 201, Northbrook, IL 60062","Members":null,"FilingYear":2023,"TotalRows":192,"RowNumber":null,"TotalContributions":198750.00,"TotalExpenditures":0.00,"IsCompliant":0,"CreatedBy":null,"CreatedDate":null,"CreatedIPAddress":null,"LobbyistClientID":null,"LobbyistClientVersionID":null,"LastModifiedBy":null,"LastModifiedDate":null,"LastModifiedIPAddress":null,"Message":null,"IsSuccess":0,"Action":null,"IsDirty":0,"PersonID":null,"PersonVersionID":null},{"ClientID":"hzXS-mvFz84b0rI0of6p8oIAq4bYqsgWASqUMLp00XI1","ClientVersionID":1,"ClientName":"American Council of Life Insurers","NumberOfLobbyists":3,"TotalCompensationAmount":0.00,"BusinessType":"Finance, Insurance","Address":"101 Constitution Ave, NW, Washington, NM 20001","Members":null,"FilingYear":2021,"TotalRows":192,"RowNumber":null,"TotalContributions":12525.00,"TotalExpenditures":72.57,"IsCompliant":0,"CreatedBy":null,"CreatedDate":null,"CreatedIPAddress":null,"LobbyistClientID":null,"LobbyistClientVersionID":null,"LastModifiedBy":null,"LastModifiedDate":null,"LastModifiedIPAddress":null,"Message":null,"IsSuccess":0,"Action":null,"IsDirty":0,"PersonID":null,"PersonVersionID":null},{"ClientID":"hzXS-mvFz84b0rI0of6p8oIAq4bYqsgWASqUMLp00XI1","ClientVersionID":2,"ClientName":"American Council of Life Insurers","NumberOfLobbyists":3,"TotalCompensationAmount":0.00,"BusinessType":"Finance, Insurance","Address":"101 Constitution Ave, NW, Washington, NM 20001","Members":null,"FilingYear":2022,"TotalRows":192,"RowNumber":null,"TotalContributions":12525.00,"TotalExpenditures":72.57,"IsCompliant":0,"CreatedBy":null,"CreatedDate":null,"CreatedIPAddress":null,"LobbyistClientID":null,"LobbyistClientVersionID":null,"LastModifiedBy":null,"LastModifiedDate":null,"LastModifiedIPAddress":null,"Message":null,"IsSuccess":0,"Action":null,"IsDirty":0,"PersonID":null,"PersonVersionID":null},{"ClientID":"hzXS-mvFz84b0rI0of6p8oIAq4bYqsgWASqUMLp00XI1","ClientVersionID":5,"ClientName":"American Council of Life Insurers","NumberOfLobbyists":3,"TotalCompensationAmount":0.00,"BusinessType":"Finance, Insurance","Address":"101 Constitution Ave, NW, Suite 700, Washington, DC 20001","Members":null,"FilingYear":2023,"TotalRows":192,"RowNumber":null,"TotalContributions":12525.00,"TotalExpenditures":72.57,"IsCompliant":0,"CreatedBy":null,"CreatedDate":null,"CreatedIPAddress":null,"LobbyistClientID":null,"LobbyistClientVersionID":null,"LastModifiedBy":null,"LastModifiedDate":null,"LastModifiedIPAddress":null,"Message":null,"IsSuccess":0,"Action":null,"IsDirty":0,"PersonID":null,"PersonVersionID":null},{"ClientID":"_jMYCYbvcMwiCGfautTE3oIAq4bYqsgWASqUMLp00XI1","ClientVersionID":3,"ClientName":"American Federation of State, County and Municipal Employees","NumberOfLobbyists":1,"TotalCompensationAmount":0.00,"BusinessType":"Other","Address":"1625 L Street, NW, Washington, DC 20036","Members":null,"FilingYear":2021,"TotalRows":192,"RowNumber":null,"TotalContributions":426600.00,"TotalExpenditures":2041368.00,"IsCompliant":0,"CreatedBy":null,"CreatedDate":null,"CreatedIPAddress":null,"LobbyistClientID":null,"LobbyistClientVersionID":null,"LastModifiedBy":null,"LastModifiedDate":null,"LastModifiedIPAddress":null,"Message":null,"IsSuccess":0,"Action":null,"IsDirty":0,"PersonID":null,"PersonVersionID":null}]

You'll have to paginate through results, then walk the distinct list of lobbyist employers to retrieve filings for parsing. The filings look identical to individual lobbyist filings, so you should be able to reuse that code (and likely a lot of the scraping code, as well).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant