Live data from Hacker News

Ask HN: What is the best API documentation you have ever seen?

news.ycombinator.com

21–30 of 64 posts

Re: Ask HN: What is the best API documentation you have ever seen?

#21

Side note, how do I volunteer or work part time writing technical documentation? I feel like my writing skills and my ability to make code understandable and explicit to other readers would be a perfecy use for producing great documentation.

I need some docs, would compensate, contact in my profile

Re: Ask HN: What is the best API documentation you have ever seen?

#24
post #5
post #2

Qt docs, python docs, cppreference, code synthesis odb

Python? I find the documentation to be confusing and difficult to search. Many of the arguments to standard functions are not explicitly documented nor do they have obvious enough names for me to guess what they mean. As I was learning Python over the past few years, I inevitably turned to blog posts and Stack Overflow for clearer examples and more explicit descriptions of optional parameters. I'd be curious to know…

Absolutely. I had a hard time going through Python documentation during the early days.

Re: Ask HN: What is the best API documentation you have ever seen?

#25
post #12

What are people's thoughts on Swagger?

I feel like people want swagger to generate good docs for them, so they jam all the auto-gen annotations and what not into their code base and pump out the default generated docs and more or less leave it at that. And it's awful. The code base swells up with annotations and the docs are permanently neglected.

I haven't come across many swagger-based docs that I liked.

Having said that, I agree that it's a problem with the user, not the tool. Swagger is fine, you should just put some effort into using it well.

Re: Ask HN: What is the best API documentation you have ever seen?

#27
post #4

Stripe API docs. There have probably been many past threads about this.

I'm very impressed by those docs. Anyone has insights how they were made?

Looks like they were partly generated, otherwise it would be impossible to keep everything consistent - especially with the many language examples. They also seem to generate an OpenApi Spec (or use this as a basis for generating the docs?): https://github.com/stripe/openapi

Re: Ask HN: What is the best API documentation you have ever seen?

#28

Lodash.js every single piece is explained with complete lucidity, and even if it weren't the examples are concise and illustrative.

A small detail, but Lodash is also globally available on their doc page. So if you see a piece of documentation and want to experiment with it, you just hit Ctrl-Shift-I and start typing.

It's a tiny thing that saves me a lot of time.

Re: Ask HN: What is the best API documentation you have ever seen?

#29
post #12

What are people's thoughts on Swagger?

OpenApi 3.0 is quite nice to work with. Its verbose to write by hand, though and you also need to know JSONSchema. With the Swagger UI we've had some mixed experiences. Not everything you can express in the Spec is displayed very well. But for developers, it's a nice playground / entrypoint for backend projects. We wouldn't want to miss that. (You also get this for GraphQL with the GraphQL Playground)

One of the most important features of an API Doc is that it tells the complete truth and is always up to date. An OpenApi Spec therefore really "wants" to be auto-generated. There we've had mixed experiences, aswell. If the generator is not working as expected or missing a feature important to you, you're either limited or you take on generating it yourself.

I've used an approach a while ago, I was quite happy with, but it took some effort: Everything API related has one definitite source of truth. Out of that, generate the docs, example and specs you need. Also use this for validation. For Documentation, I've used a wiki. The generated docs or code snippets were generated as Templates, and could be embedded/transcluded in the documentation, which was otherwise hand-written. This provided a nice mix of written and generated content with full flexibility.

Re: Ask HN: What is the best API documentation you have ever seen?

#30

Auth0's is pretty damn good. Clear docs, inline sample code...Auth0 even inlines your credentials into the example code if you're logged in. [1] Auth0 - https://auth0.com/docs/api/authentication

I thought the same about those until I tried to follow the examples. First in ruby and then in Vue, neither worked without a lot of hacking/changes. Really cool idea though to put the credentials in the examples.
Post reply on HN