API reference
Fern automatically generates interactive API reference documentation from your API specification. This starter template includes a sample Plant Store API to demonstrate the feature.
Supported specifications
Fern supports multiple API specification formats:
How it works
Place your API specification file in the fern/ directory and reference it in your docs.yml navigation:
Fern parses your specification and generates:
- Endpoint documentation with request/response schemas
- Interactive API Explorer for testing endpoints
- Code snippets in multiple languages
- Type definitions and examples
API Explorer
The API Explorer lets users test API endpoints directly in the documentation. Users can fill in parameters, send requests, and see responses without leaving the page.
For advanced API Explorer features like auto-populating API keys, see the API Explorer documentation.
Customizing the API reference
Control how your API reference appears using the api configuration in docs.yml:
You can also add custom content to API reference pages, organize endpoints into groups, customize section names, and control which endpoints are visible.
For detailed customization options, see the API reference documentation.
SDK code snippets
If you generate SDKs with Fern, code snippets automatically appear in your API reference showing how to call each endpoint using your SDK:
For more information on SDK generation, see the SDK documentation.