$devtoolkit.sh/templates/readme/api-project

REST API Project README Template

A REST API project README serves a dual audience: developers who will consume the API (integration developers) and developers who will contribute to or deploy the API service (backend developers). Both audiences need different information, and a good API README addresses both without becoming an unnavigable wall of text.

For API consumers, the most critical information is: the base URL (both development and production), authentication mechanism (API key header, OAuth 2.0 bearer token, HTTP Basic), and a quick-start example showing a complete request and response pair. If someone can make their first successful API call in five minutes using your README, they will continue integrating. If they are confused at the authentication step, they may give up and look for an alternative.

Endpoint documentation in the README should focus on the most important 20% of endpoints that account for 80% of usage. Comprehensive endpoint reference belongs in OpenAPI/Swagger documentation generated from your code. In the README, show the critical paths: authentication flow, the primary resource creation endpoint, and the primary data retrieval endpoint. Link to the full API reference for the rest.

Request and response examples must be real and complete. Show the actual HTTP verb, the full URL path with parameters, all required headers, the request body with content-type, and the full response body including status code and all response fields. A truncated example with "..." is worse than no example at all because it forces the reader to guess what the real structure looks like.

Error handling documentation is often omitted and always regretted. List your error response format (including the shape of error objects), the most common HTTP status codes you return and what they mean in your API's context, and any application-specific error codes that appear in the response body. API integrators spend a significant portion of their time handling errors; good error documentation dramatically reduces support requests.

Local development setup must specify exact prerequisites: runtime versions, database requirements, required environment variables (provide a .env.example file), seed data setup if needed, and commands to start the development server and run tests.

Template Preview

{"projectType":"api","language":"Node.js","includesAuthentication":true,"includesEndpoints":true,"includesErrorCodes":true,"includesLocalSetup":true,"includesDocker":true,"license":"MIT"}

Customize this template with your own details using the free generator:

Open in Generator

FAQ

Should I put my full API documentation in the README or in Swagger?
Use both for different purposes. The README should cover project setup, authentication, and a handful of key examples — the information needed to get started. Swagger/OpenAPI provides the complete, machine-readable endpoint reference used by API clients, testing tools, and code generators. Generate the Swagger docs from your code annotations so they stay synchronized automatically.
How do I document authentication in my API README?
Start with the authentication flow in a numbered step list: (1) how to obtain credentials or generate an API key, (2) where to include the credentials in requests (header name and format), and (3) an example curl command with the authorization header. For OAuth flows, include a sequence diagram link or a minimal diagram showing the redirect flow. Never include real credentials — use placeholder values like YOUR_API_KEY.
What is the best way to show request/response examples?
Show both the raw HTTP format and a curl command for each example. Use fenced code blocks with the http language hint for HTTP examples and the bash hint for curl. Include realistic placeholder data rather than meaningless "foo" and "bar" values. A complete example with real-looking data helps integrators understand the expected format far better than abstract schemas.

Related Templates

/templates/readme/api-projectv1.0.0