I have to say, this is cool and surreal in some way.
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).
software engineering is like steam engines were in their first 50 years - they could explode at any time, and had multiple spinning parts that will rip off your arm if you are in the wrong place
Way too complicated to implement securely, anonymously and transparently. Going physically somewhere to click on a button after a human identification is probably as technologically advanced as we're going to get in the near future.
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.
It'd be interesting to explore transparent/public voting combined with an in person way to correct/lock_in your vote. Instead of having a voting day let people vote over a month and be able to lock in their vote in person at any time.
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.
The closest we have to that is paper ballots. You can get your ballot a few weeks in advance and vote then. Then, until the “postmarked no later than” date, you can change your vote if so desired.
But at some point we're going to need to build an interplanetary civilization, so we might as well get started on governance experiments for that future now.
Maybe this is why US can't keep up its space program but China can.
The fact of the matter is: paper is still basically the most advanced voting technology around (from the perspective of auditability, which is crucial)
Just release make everyone's vote semi-public. You can look up what you voted for with a combination of your name + position/ballot-measure + password that's passed through a one-way hash, which generates anonymous voter ID. You can file a complaint what was counted doesn't match who you remember voting for.
Problem is you are incentivizing people to sell their vote or to threaten others to vote a specific way (abusive spouse wants to verify their SO voted a certain way).
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.
With widespread mail-in voting an abusive spouse could just fill in the ballot and drop it in the mailbox. No need to verify your spouse’s actions if you can just do it yourself.
The relevant threat model isn't the abusive spouse who has physical access to your ballot, the relevant threat model is someone without physical access to your ballot being able to verify that you voted the way they wanted you to.
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.
An interesting side-effect of universal mail-in ballots is the detection of fraudulent voter registrations. If ballots addressed to Tinker, Evers, and Chance arrive at 123 Elm Street, which is only occupied by the Smith family,
one should reasonably assume shenanigans, if not felonies.
Not really. My friend who just recently moved got 4 mail in ballots sent to his place this last election, in addition to his own.
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.
Yeah I took a class that talked about this - most people agree that what you'd end up with is companies or individuals forcing you to disclose a hash to prove you voted the way they wanted. Votes kinda need to be unrecoverable at an individual level for this. There's some cool research on "homomorphic encryption" if you want to learn more - it basically opens up the data in aggregate for analysis without being able to disclose information about any individual record in the data, but it's hard to pull off in practice
> Yeah I took a class that talked about this - most people agree that what you'd end up with is companies or individuals forcing you to disclose a hash to prove you voted the way they wanted.
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.
> 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.
Voter registration, not votes. They can tell if you’re registered Democrat or Republican, not if you actually voted for Biden or Trump (even if it could safely be inferred).
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.
GREAT, BUT! We need an API on who wrote which parts of the bill. Find lobbyists who wrote parts. Find when there is an evil part (where lobbyists get congress to sell out), and we need to find out WHICH congress person put it in there.
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)
The file/wire format can, but the official implementation doesn't handle it well. There is some work in progress to make it work, for this kind of historical work.
There is a project doing exactly this for German law.[1] I also once cobbled together a rather primitive Python script which commits Swiss federal law as MD-file into a repo through GitHub actions.[2]
For pieces that were added as amendments, it is at least possible to determine who proposed the amendment. Instances where the as-written initial bill is written on K Street will probably always be impossible unless Congress pass absurdly strict sunlight laws with teeth (i.e. make it illegal for congresspeople to have substantive meetings without livestreaming them) that inconvenience themselves.
yah, for that, we'd need complete social graphs for public servants, which would quickly run afoul the congressional staffs' civil liberties, because they'd try to hide as much as possible behind other people. you'd need that to appropriately apportion attributions back to the public servant.
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.
We do have this in the US! All laws should show who wrote them, when, who approved it, etc, we just don't have a great API for programs, and moreso we don't have the public appetite to consume it
No. The request is to show who wrote individual lines or sections. Currently the bill shows as being 'written' by legislators Smith & Johnson but lacks crediting/blaming who actually provided the wording for each section. The goal would be to see who slipped in which pieces of the bill.
Ah ok that makes a lot more sense. To be fair though that is the same as git, I might push up the code but that doesn't mean I "created" it - I'm just the one taking responsibility for it by introducing it into the system
True, but signing the commits with a key for a specific subsection would mean you attach responsibility for whatever was in that commit. Right now the system is, a bill is listed with who "sponsors it." That can mean they wrote it, it could mean a lobbyists gave it to them or that several people spread across the staff of different representatives wrote it. Sure, we could say who sponsors it bears full responsibility, but its not practical, especially when a bill grows to become a tome. Using a VCS system like git isn't full proof, a senator could just pass out their keys like candy, but I think it would mean a whole lot more if voters could go, "well here is your commit to this bill on X day at Y time, signed by your keys." It may also help correlate the wheeling and dealing that goes on and more importantly, how a bill changes as it goes through committees.
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."
Until you define a method/definition of "Evil" you're out of luck. What you can do, is use this to track changes, and then match it to a corpus of other data to get a better fidelity on what may influence legislation; financial transactions, public statements and where they were made, state visits, litigation, etc. Much of it in the public eye, hence scrapable and able to be put into a data lake/warehouse/cabana/dilapidated shack, and analytics applied to it. From there you may find emergent phenomena.
This is categorically false. If you want an understanding of what life in Congress is like, I highly recommend Mark Strand's "Surviving Inside Congress"
But then wouldn't the phrase I was referring to, "100% of it is written by lobbyists" be categorically false because it specifically emphasizes the percentage and therefore the claim is false? If they had said that sometimes phrases or even whole bills from lobbyists get introduced I wouldn't have quibbled with it.
While the phrase has become used more loosely, I believe (could be wrong, of course) that it is best used to explain that the cause of being false is a category error. It's like the distinction between a type error and a value error. In this case, I'd say it's a value error. The value 100 is false, not the type, because we know that a nonzero amount of prose in legislation is indeed written by lobbyists.
Ah okay, this was really helpful, thanks! Not quite as bad of a language faux pas as when I was a kid and thought 'per se' was persay but I'm glad to know the difference
We need WHICH congress-person approved it getting into the bill. We have to VOTE OUT the congress-person linked to the evil riders to bills (Budget bills, Defence bills, etc.)
No, 100% is not written, but yes some bills are written by lobbyists.
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?
It's a common misconception that increasing transparency reduces the power of lobbyists, when it actually does the opposite. [0] In short, the average voter doesn't care enough to find out who added a specific line to a bill, but lobbyists care a lot and they use the additional access to monitor and influence legislators. Legislator accountability is increased with more transparency, but they become more accountable to lobbyists than to their constituents.
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.
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.
I am skeptical, this sounds like 'trickle-down economics' where the theory is internally cohesive but the conclusions don't actually line up with reality.
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?
Just because the reckoning from citizens hasn't come yet, doesn't mean it isn't coming at all. The transparency is needed for citizens to find the bad actors in congress.
Would also wager a lot of us don't care. Government can do incredibly fucked up things, but as long as quality of life of is high and the money train keeps flowing, I'm not going to do anything.
You'd really have to fuck some stuff up real bad for me to wake up and give a shit.
You're not addressing the problem proposed in the parent's argument - that lobbyists will be the ones who will use this, to ensure that the politicians they bought and paid for are doing what they want.
> You're not addressing the problem proposed in the parent's argument - that lobbyists will be the ones who will use this, to ensure that the politicians they bought and paid for are doing what they want.
That's not a problem, despite the characterization. That's a helpful side-effect. Now you have more definitive traceability.
Not all lobbyists are out to do evil, and not all politicians who do their job are doing evil. The alternative to listening to lobbyists and legislating is politicians who don't do legislation at all and instead spend their time fund-raising and running culture wars. That's not the better-world alternative I'm here for.
I think GP is talking about creating an incentive system that doesn't encourage or require a reckoning. There are plenty of systems which were designed by people in good faith who were unable to understand that the incentives they thought they were creating were not in fact that actual incentives. Creating line by line attribution sounds like one such case.
The existence of lobbying isn’t a foregone conclusion. We can have transparency without the problem you’ve adeptly described if we eliminate or at least significantly diminish lobbying.
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.
Transparency is a logical necessity for accountability. If we don't know who wrote a law, then we can't hold somebody accountable for it. Even if we take for granted the truthfulness of the "transparency problem", the solution doesn't lie in finding the right "balance" of secrecy and transparency.
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.
> lobbyists care a lot and they use the additional access to monitor and influence legislators
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.
We need the ability to understand exactly who profits from any act/law/bill and excruiciating detail of the finances of anyone in congress, coupled with max age limit for any seat, including the Supreme Court.
Everybody has lobbyists, there's no public cause that lacks lobbyists in the USA and if you think it's only corporations with effective lobbyists it's probably because you're discounting a slew of causes and groups.
I think even before that we need an API to tell us who voted for or against each bill, and their party affiliation.
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.
I've thought about this (as an outsider who doesn't know anything) and wondered if plain old git would do the job. I've heard Germany already does this, but when I looked at https://github.com/bundestag/gesetze it didn't look like this was representative of what I would assume to be the full extent of German legislation.
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.
There's all sorts of cool data analysis that can be done with this data. I lead engineering for a company that ingests these open APIs and sells a service that enhances the metadata on these records and allows users to follow new changes in bills/legislation (think: following a PR). You'd be surprised how many organizations want it, and I don't just mean large corps (yeah, I know...but see the discussion around transparency below in the comments!). We have a lot of very cool institutions as well. If you're a Rails dev or like Data Science, we have some openings: https://careers.fiscalnote.com/
> if we could get this for every state and county legislature
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.
If you’re interested in bill data, open states maintains a federal scraper that outputs into a common format with our scrapers for all 50 states as well.
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.
I feel like there's all sorts of disappointing design decisions.
* 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.
It also helps when trying to put limits on greedy users or maintain a ban-list. Attribution is also important, like you said.
Granted, an abusive user could just keep creating new keys, but if they require something like email verification then it's a little bit costlier to circumvent than nothing.
EDIT: Based on other comments, there's no email verification.
There isn't currently, but they could add whatever requirements to generate new keys in the future they want. If they didn't have keys that would break every existing client.
If a "wikiocracy" is where shadowy, unaccountable hierarchies manipulate policy to their will while pretending to be democratic about it, then yeah we live in one but I'm not sure it's better than a representative system.
cool; had no idea this existed. Would be great to have each bill available as a git repo so that you can see the bill's draft history as it goes through revisions (with annotations as to the authors of the changes).
Most government departments have some form of api. Many use openapi (swagger) and have design decisions like this one, excepting the major APIs, like FDA. They enable projects like https://ofr.report/ or https://sec.report/
I don't know why, probably because DO is known to be cheap and originates a lot of spam. It's just super annoying because I use it as a cheap fairly reliable wireguard VPN since my ISP's seem to reset/kill my ssh connections otherwise.
I havn't seen this before but the .pagination.next url value is a great convenience. 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 havn't seen this before but the .pagination.next url value is a great convenience
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.
Yes, I see format in the query string here and there. It is in the medical web service spec FHIR.
* 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).*
220 comments
[ 589 ms ] story [ 2963 ms ] threadYou 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 :)
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).
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.
It also helps that their population and schooling system prioritizes coding and technical literacy.
Maybe this is why US can't keep up its space program but China can.
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.
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)
https://github.com/jessekphillips/usa-constitution
Edit: just noticed the dates aren't accurate, but still interesting and the authors are accurate
[1] https://github.com/bundestag/gesetze
[2] https://github.com/quadratecode/ch-law-tracker
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.
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."
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.
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
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.
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?
You'd really have to fuck some stuff up real bad for me to wake up and give a shit.
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!
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.
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.
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.
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.
This would require a lot of changes to how bills are literally shuffled around the building :)
That would be very cool.
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.
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.
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.
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...
404 would be Not Found
506 Variant Also Negotiates (you get pawned off on a staffer)
409 Conflict
And, of course, the most relevant: 402 Payment Required
Good point!
https://github.com/openstates/openstates-scrapers
It uses the GPO’s api though, not this one.
https://en.m.wikipedia.org/wiki/Swagger_(software)
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.
It's a intriguing hypothetical to think about. Imagine if all the discussion around a bill had to be as code review comments.
EDIT: Based on other comments, there's no email verification.
i would like to see a vote summary, similar to what you see on C-SPAN after a vote.
ProPublica took over a number of the Sunlight Foundation (Sunlight Labs') API projects: https://sunlightfoundation.com/2016/11/01/sunlight-labs-upda...
Some suggestions for missing interfaces:
DELETE/Representative POST/Bill
https://www.webfx.com/web-development/glossary/http-status-c...
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.
[0] https://en.wikipedia.org/wiki/HATEOAS
* 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).*
https://www.hl7.org/fhir/http.html#mime-type
https://www.theverge.com/2022/6/23/23180813/cryptocurrency-b...