How to create a C# API reference for a library or Unity plugin

Build a useful C# API reference with documented public types, signatures, parameters, examples, and links to task-based guides, then deliver it as searchable HTML.

Start with the supported public API

An API reference should describe the surface consumers are expected to use, not every implementation detail in the assembly. Decide which namespaces, types, members, extension methods, events, and constants are supported. Exclude internal helpers and obsolete members unless users still need migration information.

This review often exposes accidental public members and inconsistent naming. Fixing those issues before release is more valuable than generating a polished page for an API that was never intentionally designed.

Document what a developer needs at lookup time

Each public type needs a concise purpose. Each callable member needs its behavior, parameters, return value, side effects, relevant exceptions, and constraints. Properties should explain units, valid ranges, defaults, and whether they can change at runtime. Events should state when they fire and on which thread when that matters.

Avoid descriptions that only repeat the identifier. “Gets the timeout” adds little; “Gets the maximum time in milliseconds to wait for a server response” answers practical questions. Use the same terms across summaries, parameter descriptions, examples, and user guides.

Add examples without turning the reference into a tutorial

Short examples clarify construction, lifecycle, error handling, and combinations that are not obvious from a signature. Keep each reference example focused on one member or type and make it compilable when possible. Longer end-to-end scenarios belong in guides.

Link in both directions. A guide about loading data should link to the types it uses, while those types should link back to the guide. Readers can then move from “how do I complete this task?” to “what exactly does this method accept?” without losing context.

Generate and review the API reference

One File Docs supports an api section containing JSON produced by CSharpApiExtractor. The viewer turns that structured data into a C# API Reference alongside ordinary documentation pages. Generation removes repetitive page assembly, but it does not replace editorial review.

Check overloads, generic constraints, inheritance, links between types, code formatting, obsolete markers, and missing descriptions. Search for placeholder phrases and undocumented public members. Review the result with a developer who was not involved in designing the API.

Version the reference with the binary

An accurate reference for the wrong assembly version is still wrong. Generate or update documentation from the same source revision used to build the release, include the product version in the document, and archive the exported reference with the matching package.

Combine API Reference with installation, quick start, concepts, upgrade notes, and troubleshooting. One File Docs exports them as one searchable HTML file, which can accompany a NuGet package, SDK, desktop product, Unity asset, or GitHub release.