How to Quickly Generate API Documentation Using Apidog & Packet Capture Tools?

Many legacy projects lack proper API documentation, making it difficult to import specs directly into tools like Apidog for API testing. A simple workaround is to capture real HTTP/HTTPS traffic using tools like Charles, export it as HAR or cURL, and import it into Apidog.

Oliver Kingsley

Oliver Kingsley

5 December 2025

How to Quickly Generate API Documentation Using Apidog & Packet Capture Tools?

Apidog is an API collaboration and management platform that supports importing API specifications in many formats. It can directly import almost all mainstream API spec formats, including OpenAPI/Swagger, Postman Collections, HAR files, and cURL commands.

supported data formats in Apidog

However, in many real projects, the main challenge isn't about how to import API specs — it's that there are no API specs available to import in the first place. Some older or legacy systems never maintained API documentation and do not have OpenAPI or Swagger files.

In these cases, if you need to quickly rebuild missing API documentation or create test cases so testers can work with real data, using a packet capture tool is often the fastest approach.

By capturing the application's HTTP/HTTPS traffic, filtering useful requests, exporting them as HAR or cURL, and then importing them into Apidog, you can quickly generate API documentation and lay the groundwork for further API testing.

capture tools and Apidog workflow

There are many tools available for traffic recording. This article uses Charles Proxy as an example to demonstrate the specific operations involved, but you can also use alternatives such as Proxyman, Fiddler, or the developer tools built into your browser for packet capture. The core workflow is essentially the same across these tools.

packet capture workflow

Charles Installation and Basic Configuration

Charles offers a 30-day free trial. You can download the latest version from the official website and install it on your system.

When you launch Charles for the first time, it may ask whether to automatically configure the Network settings. It is recommended to select "Grant Privileges" to grant the necessary permissions. This allows Charles to automatically capture HTTP traffic from your system.

Charles Network settings

Installing Charles Root Certificate for HTTPS Capture

To capture HTTPS traffic, you need to install Charles's root certificate. This step is essential because most modern APIs use HTTPS.

On macOS:

  1. Click "Help → SSL Proxying → Install Charles Root Certificate" from the menu bar
  2. The Keychain Access application will open automatically
  3. Search for and locate the Charles Proxy certificate
  4. Double-click it and change the trust setting to "Always Trust"

On Windows:

  1. Click "Help → SSL Proxying → Install Charles Root Certificate" from the menu bar
  2. During the installation process, install the certificate to the "Trusted Root Certification Authorities" store

Enabling SSL Proxying

After the certificate is installed, you need to enable SSL proxying:

  1. Select Proxy → SSL Proxying Settings from the Charles menu bar
  2. Check the "Enable SSL Proxying" option
enabling SSL proxying

3. Add the domain names (Host) and ports (Port 443) you want to capture to the list

adding capturing domain to the list

4. You can also use * to monitor all domains

After the configuration is complete, Charles can capture full HTTP/HTTPS requests and responses.

Tip: If you're unsure which domains your application uses, you can first operate the application freely and then observe the requests under "Encrypted" in the Charles session list. Note the corresponding domains and then add them to Charles's SSL Proxying settings.

Recording API Traffic from Your Application

Launch the application or webpage you want to analyze and interact with various features, such as logging in, querying data, submitting forms, or uploading files. The session tree on the left side of Charles will update in real-time, grouping requests by domain and URL.

When you select a specific request, the right panel displays the basic information and response content of that request. In the Contents tab, JSON and other responses are collapsed into a tree structure, making it easy to quickly understand the data structure and fields.

Charles panel display

Filtering and Exporting API Endpoints

After recording is complete, you may find that a large number of requests have been captured. In addition to actual API calls, there are various static resource requests, third-party service calls, and other network traffic. At this point, you need to filter and retain only the endpoints you care about.

Filtering Options

1. Focus on specific domains or paths:

2. Remove unrelated requests:

3. Handle caching issues:

Charles filtering options

Exporting as HAR File

After filtering is complete, export your selected sessions:

  1. Select the sessions you want to export:
  1. Select File → Export Session from the menu bar

  2. In the export dialog, choose to export in "HTTP Archive (.har)" format to create a HAR file

exporting HTTP Archive file

Importing into Apidog to Auto-Generate API Documentation

Now it's time to import your captured traffic into Apidog:

  1. Open the Apidog client

2. Go to Project Settings → Import Data → .har File

3. Select the HAR file you exported from Charles

impoting HAR file into Apidog

Apidog will automatically parse the file content and display the detected endpoint information in the preview area, including:

During the import process, you can configure options such as:

import preview panel

After the import is complete, you can view the endpoints in the corresponding module.

Refining and Optimizing API Documentation

Auto-generated API documentation is a great starting point, but it usually requires further adjustments to meet your business requirements. Here are some common improvements:

Final Take-away

By recording HTTP/HTTPS traffic using packet capture tools and then importing into Apidog, you can quickly generate API documentation and provide real data support for testing.

Whether it's a browser, desktop client, or mobile application, this method can significantly reduce the time spent preparing API documentation and allow your team to quickly get started with API testing and development.

Explore more

How to Use the Facebook (Meta) Ad Library API

How to Use the Facebook (Meta) Ad Library API

Explore how to access Meta’s Ad Library API: setup a developer app, generate tokens, query ads via /ads_archive, test with Apidog, and build tools for ad research, analytics, or competitive intelligence.

3 December 2025

How to Run Mistral 3 Locally

How to Run Mistral 3 Locally

Discover how to run Mistral 3 locally with Ollama for efficient AI inference. This technical guide covers installation, setup, optimization, and integration tips for the open-source Ministral 3 models.

3 December 2025

How to use DeepSeek-V3.2 and DeepSeek-V3.2-Speciale in Claude Code

How to use DeepSeek-V3.2 and DeepSeek-V3.2-Speciale in Claude Code

Unlock the potential of DeepSeek-V3.2 and DeepSeek-V3.2-Speciale in Claude Code for advanced coding workflows. This guide details open-source setup, API access, pricing, and integration steps using tools like Apidog to streamline API testing and development.

2 December 2025

Practice API Design-first in Apidog

Discover an easier way to build and use APIs