How to Get Writing API Documentation Right
Documentation that explains how developers use an API, including reference material, guides, examples and error handling.
On this page
Why does it matter?
Developers judge APIs by their documentation, and incomplete docs slow adoption and increase support load.
What are the numbers?
- Reference docs describe endpoints, parameters and responses
- Guides explain tasks and concepts
- Code samples should be tested and copyable
- OpenAPI a standard format for describing HTTP APIs
What should I do?
- Document authentication first
- Provide working code samples
- Explain error codes and fixes
- Keep reference docs generated from source where possible
- Test docs with new developers
What should I avoid?
Avoid:
- Untested code samples
- Missing error documentation
- Reference docs without context
- Outdated examples
When should I get help?
Short answer Bring in help when launching or opening an API.
Where this comes from
- Google for Developers — Technical writing courses
- Microsoft Learn — Microsoft Writing Style Guide
The figures and practices above come from the sources listed.
Working on something like this?
We take on Content Strategy work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.
Where to go next
Spotted something wrong? Report an error on this page. We correct on the page and say what changed.