Overviews, or descriptions, are crucial parts of every API reference documentation. However, a common challenge in writing an overview is deciding the right amount of content. How much is enough? What should be included or excluded? Should the overview be detailed or brief?
To answer the questions above, I reviewed several API reference websites to see how their authors approached reference descriptions. This write-up details my findings, alongside some best practices for writing effective API overviews.
What is an API Reference Overview?
In technical documentation, reference overviews are used to summarize an API’s functionality. They help developers—the primary consumers of reference documentation—and other stakeholders understand the role of an endpoint or group of endpoints. API overviews and API descriptions refer to the same concept and will be used interchangeably in this report.
Types of API Reference Overviews
Reference overviews can be categorized into three types: high-level, group-level, and path-level overviews. Let’s explore each of these.
High-level Overview:
This is a summary of all the endpoints in an API. It often provides information about the API’s underlying technology, how to structure requests, the expected response format, authentication details, available environments, and how to get started, among other things. Stripe’s API contains a perfect example of a high-level description. Here it is below:
This description provides a snapshot of the Stripe API and how users can start interacting with it.
Group-level Overview:
This summarizes endpoints that perform related functions. For example, in Mailchimp’s API, the Automations group—which includes endpoints like List Automation, Add Automation, Get Automation Info, and others—illustrates a group-level description.
The description above clearly indicates what can and cannot be achieved with the endpoints within this Automations group. The use of group-level descriptions depends on the structure of the API being documented; some API documentation sites may not include this category of reference overview.
Path-level Description:
This describes a specific endpoint or path. Here’s an example from X’s API:
The path-level description in the image above conveys what to expect from the
/2/tweets
endpoint.
The three categories of reference overviews outlined in this section play different, but critical, roles in communicating the purpose of an API to its users. In the upcoming section, I will present the findings from my research on how reference descriptions are utilized across various documentation sites.
An Analysis of Selected API Overviews
I examined twenty different APIs to see how reference overviews were implemented. In this section, I will detail my selection criteria, present the results obtained from the chosen samples, discuss the inferences drawn, and outline the challenges encountered during the analysis. First, the selection criteria:
1. Selection Criteria
To streamline the process, I based my selection of samples on the following criteria:
1.1. High-level Descriptions
The API documentation must have a straightforward information architecture.
A high-level description should include any or all of the following: the API’s underlying technology, request and response formats, minor authentication information, available environments, endpoint organization, and how to get started.
The information listed in point 2 must all be on one page but can be divided into separate sections.
Detailed authentication instructions should not be considered if provided on a different page or section.
Information about the available environment only counts if included on the overview page.
The getting started guide should not be considered, even if placed on the same page as the overview section.
1.2. Group-Level Descriptions
Each group must have an overview section.
Each group must contain one or more endpoints.
Objects with two or more endpoints are considered a group. For such APIs, only the object's overview section should be considered.
1.3. Path-Level Descriptions
The path or endpoint must have an overview section.
The description must be specific to a single endpoint.
Information that directs users to additional resources about the endpoint counts.
2. Results
After compiling my samples, I used a Python script to calculate the total number of words in each API overview. This file contains the data from which the figures in the following tables were generated:
2.1. High-level Descriptions
API Overview | Word Count |
Stripe | 111 |
Resend | 46 |
Thanx | 253 |
Dynamic | 24 |
Upstash | 243 |
Explo | 351 |
Pinecone | 216 |
SieveData | 43 |
Pylon | 58 |
Dolphin Flashcards | 69 |
Mage.ai | 115 |
Flipt | 94 |
Infisical | 61 |
Mindsdb | 100 |
Flatfile | 60 |
Bitski NFT APIs | 95 |
Bitski Web3 APIs | 94 |
Tolstoy | 62 |
Axle | 42 |
Sequence | 53 |
Average | 110 |
2.2. Group-level Descriptions
Group Name | Word Count |
Connected Sites - (Mailchimp API) | 8 |
Campaigns - (Mailchimp API) | 22 |
Landing Pages - (Mailchimp API) | 8 |
Template Folders - (Mailchimp API) | 5 |
Refund - (Plane API) | 64 |
Payment - (Plane API) | 83 |
Charge - (Plane API) | 53 |
Employment - (Plane API) | 164 |
Resource Endpoints - (Explo API) | 6 |
Customer Endpoints - (Explo API) | 6 |
Group Tag Endpoints - (Explo API) | 7 |
End User Endpoints - (Explo API) | 7 |
Blocks - (Mage API) | 15 |
Pipeline runs - (Mage.ai API) | 10 |
Backfills - (Mage.ai API) | 9 |
Logs - (Mage.ai API) | 7 |
Segments - (Radiant API) | 111 |
Reports - (Mailchimp API) | 44 |
The Policy object - (Axle API) | 43 |
Automations - (Mailchimp API) | 39 |
Average | 36 |
2.3. Path-level Descriptions
Path | Path Name | Word Count |
/v1/customers/:id/sources | Create a card - (Stripe API) | 62 |
/v1/customers/:id/cards/:id | Retrieve a card - (Stripe API) | 27 |
/assistant/assistants | List assistants - (Pinecone API) | 11 |
/query | Query vectors - (Pinecone API) | 34 |
/v1/text-to-speech/{voice_id} | Text To Speech - (Elevenlabs API) | 31 |
v1/text-to-speech/{voice_id}/stream | Streaming (Text-to-Speech) - (Elevenlabs API) | 17 |
/v2/redis/database | Create a Redis Database (Global) - Upstash API | 7 |
/v2/redis/database/{id} | Get Database - Upstash API | 7 |
/api/create-flashcard | Create flashcard - (Dolphin flashcard API) | 20 |
/api/edit-card-goal | Edit Card Goal - (Dolphin flashcard API) | 8 |
/api/pipelines/:pipeline_uuid/blocks/:block_uuid | Read block - (Mage.ai API) | 10 |
/api/pipeline_schedules/:pipeline_schedule_id/pipeline_runs/:token | Trigger pipeline - (Mage.ai API) | 13 |
/api/v1/identities | Create - (Infisical API) | 2 |
/api/v1/auth/kubernetes-auth/login | Login - (Infisical API) | 4 |
/api/projects/{projectName}/models | Create, Train, and Deploy a Model - (Mindsdb API) | 7 |
/api/projects/{projectName}/models/{modelName}/describe | Describe a Model - (Mindsdb API) | 7 |
/voices | List Voices - (Uberduck API) | 5 |
/voices/{voicemodel_uuid}/samples | List Voice Samples - (Uberduck API) | 7 |
/api/v2/users | List all Users - (Dots API) | 7 |
/api/customers/ | Create a customer - (Lotus API) | 3 |
Average | 14 |
3. Inference
With the average word count for the different categories of reference overviews now obtained, I compiled the results into a single table for a more comprehensive view.
Categories | Average Word Count |
High-level Overview | 110 |
Group-level Overview | 36 |
Path-level Overview | 14 |
From the table above, I made the following deductions:
High-level API reference overviews are the longest: This is expected, as this category of overviews aims to capture the entire API and provide important information on its usage.
Group-level API overviews have less content than their high-level counterparts: This is also expected. Group descriptions only cover a subset of endpoints that perform related functions.
Path-level reference descriptions are the shortest: As seen in Table 3 above, a path description can be as brief as three words. This is acceptable, provided it accurately conveys the function of the endpoint.
4. Challenges
I encountered the following challenges while carrying out this research:
There are no standard rules for structuring API reference information, which made it challenging to find samples that met my criteria.
Some documentation sites divided their high-level overview into multiple sections and pages.
Some API references listed endpoints without organization, while those that grouped their endpoints often lacked descriptive information for these groups.
The upcoming section will address the questions raised at the beginning of this article by highlighting the pitfalls to avoid when crafting API overviews.
Best Practices for Writing API Reference Overviews
The following are some best practices to adopt when documenting API overviews:
Keep descriptions brief and relevant.
Avoid listing endpoint parameters or response schemas in overviews.
Restrict each endpoint description to that specific endpoint.
Minimize the use of passive voice.
Group descriptions should summarize the functions of the endpoints within the group.
High-level overviews should include the API’s technology (REST, GraphQL, etc.), request/response format (JSON, XML, etc.), available environments (Test and Live mode), authentication information, and other key details about the API’s capabilities.
The recommendations above are non-exhaustive, but adopting them will benefit your reference descriptions.
Conclusion
APIs are unique, and their descriptions should reflect that uniqueness. My research is not devoid of flaws, so treat the information here as a flexible guide when writing reference overviews. The total word count for your overview content can vary from the figures in Table 4, provided you adequately cover what the user needs to know about an endpoint or group of endpoints.
By adhering to best practices for writing API overviews and using Table 4 as a benchmark, you can significantly enhance the quality of your documentation. This approach will help developers and other stakeholders have a seamless and productive experience with your API, ultimately leading to better adoption and fewer support issues.