Lurker News
I used to be irrationally impressed when I saw good API design and docs.

Now I can't remember the last time I sat down and spent meaningful time reading docs for a platform. I've just gotten in the habit of pointing Claude at them or using a service like Context7 for the past year or so.
As a consumer, I've realized that I'm not even sure which services I use that have good or badly designed APIs.
If you maintain an API, have you changed how you write docs now that the main reader is probably an LLM?

Comments (3) 6 threads

vouchtest111912#
Any API where a GET request quietly changes state gets me every time. Inconsistent error formats are a close second.
austin-cheney#
I feel like HTTP is bad API design. It’s just too complex for these reasons:

* The context of subsequent requests differ whether the first request terminates with a slash.
* The relativity of a resource changes context relative a parent context depending upon the address starting with a slash.
* Subsequent requests occur both in parallel sockets and in reuse of existing sockets.
* HTTP suggests different actions to execute due to a method name irrespective of the specified resource.
* A resource does not need to resolve. The very address making use of URI as a unique identifier is an amazingly brilliant and correct idea, but this concept adds an extra layer of complexity to HTTP.
* The relationship between HTTP and HTTPS is complicated. You can send TLS encrypted traffic to an unencrypted port and easily forward that traffic to a HTTPS listening port and everything still works with the client none the wiser, but sending unencrypted traffic to a TLS listening port instantly fails.
* We should be using HTTPS so the HTTP protocol provides an upgrade header to try to automate this through additional traffic.
* The behavior and security contexts of either a primary or subsequent request can vary from the mixing of dozens of various headers both standard and de facto.
* HTTP 1.1, HTTP/2, and HTTP/3 each provide wildly different behaviors and requires unrelated parsing mechanisms.
* Proxies then complicate each prior point.
* As a contrast I look at WebSockets which just makes a connection to a port, which can even be an existing HTTP/HTTPS port. The resource path, HTTP method, WebSocket subprotocol, add additional headers are just extra identifiers that offer no direct functionality but can provide additional security contexts. Then data just flows. To proxy WebSockets you only need 2 lines of code:

    socket.pipe(proxy);proxy.pipe(socket);
* The performance improvement of WebSockets compared to HTTP comes only from the increased simplicity, and that performance difference is substantial.
talmr#
Sometimes the routes are confusing or not intuitive. I mostly work with REST APIs.

For SDKs and such sometimes the documentation is too dense, and without examples, so the explanation by itself is not as helpful and I have to go look up more information.

Load more comments