Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It might technically look like an API - but it could still not count as an API legally (for the constitutional trick) if the interface was not intended to be public.

If you want to stretch the terms, everything on and off the web that does communication is basically an API - it's just that some of those APIs use JSON to encode their data and make it really easy to access... and some of them bury it in mountains of HTML - but if the data is there the data is there. There really isn't a functional difference between a scraper that goes from TEXT => DATA and a json decoder that goes from TEXT => DATA except how easy it is to write and maintain it.

One outcome of this fight might be that government organizations are directed to use more proprietary communication methods which would be a poor outcome for everyone involved.



The law is not specific at all in regards to the format of the document. So to talk about an “API legally” has no meaning. In a private scenario it makes sense but what we are talking about here is public documents which are sent through an API. The city has responsibility to only send information I have (as a parent) legally right to see. How I parse it and present it is up to me as citizen (through an app or save it as json and upload to an excel file or such)

One implication of this project could be that government agencies in Sweden can not have private API:s.

To use more proprietary methods (private api:s) will have no effect on the constitutional law. You still have received a public document as a citizen.


> How I parse it and present it is up to me as citizen

I know technologists like to think that way but very often the law doesn't work like that. They will think about intent - was the intent to give you the raw data or was the intent to convey a specific representation of it that may omit some parts or further transform or presentation layer changes to achieve a different final result to what the raw data would have conveyed?

If it is the latter then that is the "public document" you have access to, not the raw data from the API.


> convey a specific representation ... is the "public document" you have access to, not the raw data

Seems you're saying it might be illegal to convert a HTML file to PDF format, or to use a screen reader to read the text.

I wonder in which country you are (where apparently there can be laws like that)


Or even just print it out. Or put it in a binder. Or make it your desktop wallpaper. Or print it on your toilet paper rolls. Or make paper airplanes out of it. Hmmm it seems like this is a bit of a ridiculous argument. I highly doubt any free government would/could make it illegal for me to print the laws on toilet paper, downloaded via their API.


An app that parses a news sites articles, removes all advertisements from it, and adds its own might very well be illegal in some jurisdictions.


that would be a bit less clear I think .... perhaps it may make it more concrete to think about an example.

Say the education department has a requirement that where ever a student's grades are displayed, the legend to explain their meaning and a disclaimer about limitations is included. It could even be a hard requirement (like, they got sued once for not doing it so their lawyers have told them they must enforce this). So they are careful that in their app, that requirement is always satisfied, since failing to do that could lead to harmful confusion that could impact a student.

So in their view the "document" they made public is the fully rendered version of that. If you print it out you are effectively doing a transformation that preserves its form and essential characteristics. If you screen shot it, cut out the disclaimers and legend and then paste it on a public web site ... you could create the same problems that you are by taking raw data out of the API.


Here's one possible issue though - I asked (in another sibling comment) if `ls` could be considered a filesystem API - I strongly believe it is. That means we probably (for sanity's sake) need to differentiate internal vs. external APIs and provide a method for safely allowing this public document method to be well defined.

If a spy is filling out an expense report via secure email after an undercover mission to Norway (trying to figure out if Norway is hording lutefisk, I assume) which ends up resulting in a bombshell report to the public about international lutefisk accessibility then that report is clearly public - but the spy's expense report (including, I'd assume, their identity) is something that should logically be kept secret. There's some press secretary in the middle that takes the raw information and turns it into the scandal we all know it would be.

The data being transmitted over an API is not intended to be directly consumed by the public - there is, instead, an application that exists to take that raw data and transform it into something that is publicly viewable. That application is the corollary for our press secretary here.

I am concerned this might be a bigger rabbit hole than you expect. I totally agree that the town shouldn't flip out and be stupid calling in legal authorities like it currently is - but I think this might be more complex.


In this particular example, It’s likely none of that would be digital (over the web) and it would be classified.


Possibly? Or maybe they use a web based expense reporting system like almost everybody in the modern world. I also think it's a pretty open argument whether the definition of what is and isn't an API relies on things being served on the web.


Privately documented APIs are still APIs.


I don't disagree (though when it comes to this particular case it's a question of what the opinion of Swedish courts is) but there's just a lot of grey area there.

Would you consider `ls` an API for exposing your filesystem?


> Would you consider `ls` an API for exposing your filesystem?

I don't see why not.

It has an interface for input and output, conforms to well known specifications and is publicly documented.

There's also multiple implementations behind the API.


I would consider "ls" a presentation tool that uses an API to present information about a file system. I would consider stat/lstat/opendir/readdir/closedir the API that "ls" use to gather the information.


When you combine it with shell scripts, I'd say that ls is an API to itself.


> One outcome of this fight might be that government organizations are directed to use more proprietary communication methods which would be a poor outcome for everyone involved.

I agree with the rest of your argument, but I think that this part is not necessarily a good example of the risks. Far easier would be to use a shared key between the app and the site, and thus use encryption to prevent reading the data, while still sending it in JSON over HTTPS. A pinned certificate would do the trick, at least on phones which prevent the user from inspecting app bundles.


I think it depends on the outcome of the case - I could see some possible resolution like the Swedish supreme court declaring that JSON counts as a public record and that forcing a block on prohibitive encryption of JSON endpoints offered by the government (assuming everything the OP said about constitutionality is correct).

We've seen such bizarre technical decisions from high courts before.


I dont think the swedish legal system uses precedents though. Does that matter?


I don't know - I think all legal systems use precedents to a certain extent - they're just extremely formalized in America and Britain. Sorry but I'm not familiar enough with their system to reply with confidence but I would say that if a high court in a country rules a certain way, even if that isn't binding to future rulings, it will cause people to adjust their behavior to avoid falling into a trap that's been clearly called out already.

Uh, also, IANAL.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: