Congress.gov API
api.congress.gov
api.congress.gov
It's just surreal to think of international treaties as being objects with a "last updated time."
Given the massive human apparatus constantly parsing this information from Capitol Hill, I'm not sure what the use-case is for an app, but nonetheless, it's cool.
Now... if we could get this for every state and county legislature, that would enable some interesting use cases to track parallel legislative initiatives (usually advocated by corporations / non-profits).
We need to track the evil parts of bills to the congress person who is the sell out for lobbyists (and the corporations beind them)
There needs to be a balance. A democracy that operates completely in the dark isn't much of a democracy, but Congress currently has the problem off too much rather than too little transparency.
[0] https://congressionalresearch.org/TransparencyProblem.html
It sounds to me like transparency does always increase accountability full stop. It just turns out that accountability to lobbyists is a greater driver of legislator behavior than accountability to voters.
The problem is therefore neither accountability nor transparency, but the disproportionate influence of lobbyists.
1. If you organize a team behind a goal and persist in focusing on it, you are more likely to succeed than someone who does not allocate their attention thusly.
2. If you do the above, you need a way to pay for rent and groceries.
The title is a bit click-bait-y, but the argument is sound, I think. Forcing transparency changes how people do their work, especially what indicators of success they choose to focus on (which may be easy to relate, but bad indicators of success - like GPA).
Transparency does not automatically grant accountability.
I don't think we have a good handle on this problem, and we make the situation worse by assuming that transparency will solve the problems of corruption and government accountability.
This is ad tracking for lobbyists. If a lobbyist could prove they got a line into legislation, they’re worth an order of magnitude more than they are today, when one is left guessing if they did anything at all.
It seems like a pretty persuasive argument to me.
That's not a problem, despite the characterization. That's a helpful side-effect. Now you have more definitive traceability.
I don't know that lobbyist depends on an API for that!
You'd really have to fuck some stuff up real bad for me to wake up and give a shit.
Law is backed by threat of violence; what separates legitimate Law from the law of the jungle is its _justification_. Everyone who the Law applies to (that is to say, everyone) has a legitimate interest in knowing the justification, so that they can determine whether such Law is justified or whether their government has morphed into a violent gang. Ergo transparency is fundamental to legitimate law and governance.
The validity of a contract where a company, person, or community action group pays someone to lobby on their behalf is not.
Enshrining corruption in what’s practically holy law. What a coup.
Seems like the page you linked is an anti-trasparency advocacy org, what makes you trust them? Is there any data to back up this assertion?
https://github.com/jessekphillips/usa-constitution
Edit: just noticed the dates aren't accurate, but still interesting and the authors are accurate
i'd be ok pushing for a legal carve-out for this social graph however, as i'd posit that greater governmental transparency overrides the potential encroachments of the ~tens/hundreds of thousands of partisans and lobbyists (<0.1% of population; though slippery slope could be invoked here). you'd start with staffers and move out to anyone paid directly by the office and their affiliated political organizations, then move to large donors and their PACs. obviously the current supreme court would try to block this as an antecedent to the citizen's united case.
Their API leaves a lot to be desired, but the data is much easier to access and analyze than the raw data from the US House or Senate websites.
In theory, you probably wouldn't find lobbyists contributing directly, but you could find representatives and then link them to lobbyists they've associated with.
Edit: Actually it could have several other benefits. A senator could tag a "release" of the bill prior to the bill going to committee so the Senator could say, "look, this is the state of the bill now after going through committees, but here is a diff from when I tagged it before it going to committees. So no, my opponents are wrong when they say I put a provision in this bill to stock my favorite fishing hole, just check the difference."
Also an easy way to find all votes of each elected representative.
Then maybe an app that allows me to pick a few bills and a few representatives and produce a matrix of how they voted on those bills, also which proportion of each party voted yes or no on those bills.
And finally for each proposed bill who voted for or against to bring it onto the floor to be discussed and voted on, or not.
This would require a lot of changes to how bills are literally shuffled around the building :)
A good story my professor told me is when he took a trip to Congress, met his Congressperson, suggested a law that would help entrepreneurs, then sat down with him and they both drafted it in about 2 hours, then he took it to Congress to table it for a vote. It didn't pass, but that's how laws get written.
But then again, is lobbying bad? I mean, it's not stacks of money passed under a table, it's literally arguing your case. I mean isn't that what Congresspeople are there for? To hear their constituents concerns and desires?
Would anyone on HN argue that EFF shouldn't be allowed to spend donations they receive to do work that helps them lobby congress for say, privacy laws?
That's a good thing to me.
That would be very cool.
Not an official source but someone took the pain of creating a GitHub repo of Indian constitution with amendments as commits[1]. Here's one commit[2] for example that's about modifying some affirmative action details.
[1] https://github.com/prince-mishra/the-constitution-of-india/c...
[2] https://github.com/prince-mishra/the-constitution-of-india/c...
The only info we should provide electronically is that your vote was counted at all. Direct value verification would have to be done in person and under supervision.
In Russia all state employees, say school teachers, are told to vote the right way under no uncertain terms. But come the election day, and it is not physically possible to inspect what everyone is doing with paper ballots. If it was possible to digitally check voting, the regime would be even more repressive.
If you have an abusive spouse, voting is your last problem.
Just people who never bothered to update their voter registration.
Completed ballots are supposed to be verified by signature (at least in CA), but I have no idea how thorough this is.
And I imagine if they are mail in, could they even find people who completed all 4 ballots, then dropped them in some random mail box? From what I gather they just reject a vote if they can't match signatures.
That's what the one-way hash is for. If you're forced to provide a password beforehand, you can provide extra bogus passwords that cast ballots for both sides. The system can allow you to do this an arbitrary number of times.
As far as paper ballots go, nothing stops someone from bullying you into taking a video of you voting and dropping it into the ballot box.
And yet this doesn't happen in real life, so it's not a real problem.
Maybe because it's unmanageable and impractical to transfer, store anf watch 50 million videos of voting. But checking a hash is easy and automateable.
Impossible to prove. You don't want people changing their votes. People wouldn't accept results if they change after the fact.
nevertheless, you can tell that a voter is a registered D, I, or R. you can tell if they turned in a ballot in a given election.
in jurisdictions where registered voters cannot vote for candidates of the other party (many), then yes, you can then reasonably infer their vote, with a margin of error equal to rates of write-ins for that party in that election.
I mean sure, with the EU's NFC chips in passports and ID cards there can be an app that compares that to a 3D selfie (there are already apps that do that for lesser government services), but the risks associated in getting it wrong are still too great. Not to mention the lack of transparency which is paramount for a healthy democracy.
Maybe not use it for elections but maybe for polling on issues or a replacement for petitions and/or referendums. Enabling some aspects of direct democracy especially at local levels. But i think this would need to be public or overly transparent to enable people to trust the outcome or become aware of any attacks on the system.
Maybe this is why US can't keep up its space program but China can.
It also helps that their population and schooling system prioritizes coding and technical literacy.
https://github.com/openstates/openstates-scrapers
It uses the GPO’s api though, not this one.
Pagination seems to be limited to 250 on the endpoints and some of the data sets are quite large so I set a limit on pagination of 10 pages, if you want all the bills from all time, prepare to wait.
Full disclosure it uses a free addon myself and my cofounders created to easily push any api data into a google sheet. I just find it useful to play around in a spreadsheet very quickly vs setting up a db.
spreadsheet is here: https://docs.google.com/spreadsheets/d/1amnbqb_J9W2r-XaVsrue...
That one issue alone is a perfect example of why law is complex and experts in law are needed. Morals are subjective. Countries are large.
Edit: 2018, so not a few months ago
Not sure if any suggested changes got incorporated or even addressed, but it's a really interesting concept
There could be some sort of VM (state machine?) which executes these laws (programs). A queue accepts change requests from the edges, e.g. citizen1 wants to sell her car to citizen2 would generate a change request. The queue processor validates the change request, finds the appropriate reducer (= law) for it, applies the reducer to current world state + change request and derive the new world state.
The programs (laws) themselves could also be objects of the world state. Changing the law is then another change request (self-modifying code).
One big issue with this is that the reducers should probably also work at the edges. Paying with a credit card in a shop should work even if the Internet is down. Diverging state histories should be the norm not an exception. We should figure out how to ensure we can always resolve the merge conflicts.
To take this example I found off the NYS assembly website legalizing adultery (it was the first one I found, I swear)
https://nyassembly.gov/leg/?default_fld=&leg_video=&bn=A0010...
It's phrased as "Section 255.17 of the penal law is REPEALED", but if you try to find "the penal law", but if you look up a a copy of the penal code do you see 255.17 in it? If so, how can you find out what was actually repealed. If not, do you need to hunt through every possible amendment to figure out the state of the law is at the time of reading?
"New laws" have to quite literally be diffs of the existing law.
DELETE /congress HTTP/1.1
Host: api.congress.gov
Accept-Language: en
HTTP/1.1 200 OK
Wouldn't that be something?506 Variant Also Negotiates (you get pawned off on a staffer)
409 Conflict
And, of course, the most relevant: 402 Payment Required
Good point!
404 would be Not Found
https://api.congress.gov/v3/bill?format=json&api_key=...&limit=250(Added edit) I too agree with the sentiments that a v2 should have a finer grain resolution where the data model would recognize a bill as a collection of clauses or statements. And attribution and intent of those clauses would be transformative (I think) for regular citizens.
Because then the internet would be able to track unintended consequences by author. This is arguably what the internet does best.
For JSON-LD, this would basically look like this (from https://json-ld.org/spec/latest/json-ld/#the-context):
{
"@context": {
"name": "http://schema.org/name", ← This means that 'name' is shorthand for 'http://schema.org/name'
"homepage": {
"@id": "http://schema.org/url", ← This means that 'homepage' is shorthand for 'http://schema.org/url'
}
…
},
… data part using name, homepage, etc
}
Once you have stable places for information (identifiers), you can start building a real web as described by the semantic web, by bundling schemas with the data you can freely use information with human and machine understanding, until then you've got a muddle. jq '.pagination.next ' member.json
"https://api.data.gov/congress/v3/member?offset=20&limit=20&format=json"Reminds me of HATEOAS [0]. Definitely makes it easier to browse using a REST client.
>On the other hand, the OpenAPI documentation doesn't explicitly mention offset and limit for paginated services even though it lists format for each service
I could imagine that they use some kind of middleware for pagination which leads to it not being explicitly included in the OpenAPI spec, especially if they generate it from their DTO classes instead of going API first.
Also, am I the only one who thinks specifying the expected response format via query param is weird and they should just use the Accept header instead? Eh, I guess it’s better supported by OpenAPI.
* In order to support various implementation limitations, servers SHOULD support the optional _format parameter to specify alternative response formats by their MIME-types. This parameter allows a client to override the accept header value when it is unable to set it correctly due to internal limitations (e.g. XSLT usage).*
Consider someone with a legally recognized special need necessary for some bodily function.
For example, someone in a wheelchair wants to use a bathroom. Or two people who can't speak want to get a condom by communicating it non-verbally, by pointing at it or writing their request down on a piece of paper, but whose requests are ignored whereas speaking customers have their needs met.
In code you can just try:
try usebathroom()
catch
cant
or try buycondomnonverbally()
catch
cant
The exact function call that makes it fail becomes obvious.With an endpoint, you could apply the legal API to it and demand that the proprietor provide legally mandated accommodations until the failing function succeeds for the special case.
It's hard to deny you exist if there is a parking lot full of employees and you can serve them a notice by GPS lookup.
If someone made that service it would be an "oh shit, they actually mean it" moment for every unaccountable black box Establishment that skirts its accessibility obligations.
It would instantly improve the world for everyone.
You can enter whatever you want in the form.
benign use: love the fact that they are going to allow me to add a + address
malicious use: consider testing for injection attacks :)
https://www.theverge.com/2022/6/23/23180813/cryptocurrency-b...
https://govtrack.us – mentioned there – is an amazing resource for federal legislative data and continues to evolve.
There are a number of sites for tracking donations if you are concerned about money and politics. https://www.opensecrets.org is the one I check the most often – but I find that the journalists tend to make it more sensible. e.g. https://www.exposedbycmd.org/2022/08/15/kyrsten-sinema-has-m...
https://www.ballotpedia.org has great election related information as well as a bit of analysis around state trifectas in particular.
Likewise https://openstates.org/ has a ton of well indexed state legislative data as mentioned in a separate comment.
And after years of effort by the Free Law Project https://free.law/ big changes are a foot with PACER for legal dockets: https://www.reuters.com/legal/government/fed-judiciary-says-...
As for the Federal Register, where the federal executive rules live, they have a decent site: https://www.federalregister.gov/ an API https://www.federalregister.gov/developers/documentation/api... and someone made this handy quick view as well https://ofr.report/
Now, regarding municipal legislative data, many municipalities use a tool called Legistar which is a bit of pain for regular users – bad layouts, unintuitive search, many clicks to view the matters, links in PDFs – but lucky for us there's an API for read access. https://www.documenters.org out of Chicago has been scraping it and crowd-sourcing meeting coverage – pretty awesome to see, though I'm concerned about how they are managing their infrastructure tbh. A repo per city seems like it'll be a pain to manage.
So I've been working on a tool for browsing recent agenda and matters that makes it much easier to keep tabs on what's happening at council. I'm making weekly updates – not sure where it will lead but we've got 17 cities on it so far... https://www.legigram.com and if you have an in at the SF or Phila city clerk's office, please reach out to me. No donations so far but some very happy users. TBD whether there will be paid product on top of the free view or we will win any grant support.
From what I've learned, the SaaS ecosystem for municipalities is screwy. There's the lock-in, absurd upcharges, widening attack surfaces, stakeholder decay, etc – and now private equity entities like Vista Equity seem to be milking our cities without much of a fight. And it just feels a bit rich that their CEO in particular has been written up for some pretty intense tax fraud. https://www.wsj.com/articles/vistas-robert-smith-had-bigger-...
I saw a comment here about transparency enabling lobbyists over citizens, and I have given some thought to that concern recently as I have been building Legigram.
Maybe part of the challenge is that people outside of professional politics tend to be idealists – the better ideas are what should matter and I have them – whereas those in politics hew to a more realist perspective – that government is a matter of compromise between vested groups - whether lobbyists, donors, voting blocks, or interest groups - brokered by individual politicians and media. Meanwhile, scandal, crime, pandering, gross simplification, and heroicism make for better headlines, soundbites, and news segments – but we need to support budget balancing, zoning compromise, and school board recommendations, too.
There's certainly lots of room for skepticism around civic tech efforts generally – not to mention about how more engagement with politics should de facto lead to better outcomes. One would hope that the last few years would be proof enough to put that idea to bed. Consider further that the majority of FOIA requests are by gov't contractors seeking competitor research.
But if we can set our design goals past mere transparency, then we might see actually start to see better engagement and more agreeable outcomes. What sort of engagement might lead to better outcomes?
When civic duty, like trade work and social work, has been so devalued relative to financialization, tech, real estate – that makes it less and less rational to engage in until the problems are truly acute. But we are getting there: besides income inequality, the widening housing crisis, climate change, and the demographic shift, we need to keep the power on California, the water clean in Jackson, and the schools safe and effective in Texas – and that means in part supporting the people keeping the lights on when the mob with pitchforks show up – while also pushing towards progress.
I recently learned about Richard S. Childs, a widely forgotten 20th century reformer who successfully advocated for the council-manager municipal government format (aka the "weak" mayor format) and also helped usher in the "short ballot" based on the thinking that most people couldn't be bothered to make an informed decision about so many obscure administrative offices.
Along those lines, I think we can achieve better civic engagement by encouraging better decisions and more informed discourse. And while that doesn't just mean better end user dashboards, if I can make it so that literally millions of people can keep tabs on their city hall agenda because it'll take a minute a week instead of half an hour, that's a win enough for me.
Seems like almost all politicians - regardless of isle side - have plenty of questionable choices around there voting with donations/pacts, selling shares for monetary gain, etc.
Political contributions are open, as well as voting records. With a little work you could do this on your own.
Please share what you build!
It's a intriguing hypothetical to think about. Imagine if all the discussion around a bill had to be as code review comments.
edit: oh, it's just inline within the html source, strange
ProPublica took over a number of the Sunlight Foundation (Sunlight Labs') API projects: https://sunlightfoundation.com/2016/11/01/sunlight-labs-upda...
i would like to see a vote summary, similar to what you see on C-SPAN after a vote.
EDIT: Based on other comments, there's no email verification.
https://www.webfx.com/web-development/glossary/http-status-c...
What's the point without that?
Authentication seems to be done with a query string ?api_key=KEY instead of some kind of standard header.
Also, there is a query string "format" for changing the output, ?format=json. Instead of using the Accept header :/
Headers are harder to use than query string parameters. You can't start poking around in an API as easily using just a web browser if the API requires authentication and accept headers.
The downside of query strings for API keys is that they can inadvertently be exposed by log files. For this API, where the API key appears to be there purely for analytics reasons, I don't think that risk is particularly bad.
* All of the endpoints are singular, but then /summaries is plural for some reason
* You can enumerate the congresses, but non of the congress representations have a value which represents the numeric ID that should be used on other requests. Unless you request the congress data using that number, and then it does include it.
Oh well, hopefully it improves and becomes more consistent over time.
Some suggestions for missing interfaces:
DELETE/Representative POST/Bill