HAR to Swagger — screenshot of github.com

HAR to Swagger

This is a neat little tool for converting HAR exports or mitmproxy captures into OpenAPI 3.0 specifications. It allows you to reverse-engineer REST APIs by simply capturing traffic, enabling you to generate API documentation from website interactions.

Visit github.com →

Questions & Answers

What is mitmproxy2swagger?
mitmproxy2swagger is a tool that converts captured HTTP traffic, either from mitmproxy or HAR exports, into an OpenAPI 3.0 specification. It helps in automatically reverse-engineering REST APIs.
Who can benefit from using mitmproxy2swagger?
This tool is beneficial for developers, testers, and security researchers who need to understand or document existing REST APIs without direct access to source code or formal specifications. It is particularly useful for reverse-engineering unknown APIs.
How does mitmproxy2swagger create API documentation?
Unlike manual documentation or tools requiring direct API access, mitmproxy2swagger generates OpenAPI specifications by observing actual network traffic. It processes HTTP requests and responses captured during application usage to infer API endpoints, parameters, and schema.
When should I use mitmproxy2swagger?
You should use mitmproxy2swagger when you need to generate API documentation for a web application or service where no formal OpenAPI specification exists, or when you want to update an existing one based on real-world usage. It is ideal for quickly understanding an API's structure by simply interacting with it.
What capture formats does mitmproxy2swagger support?
mitmproxy2swagger supports traffic captured by the mitmproxy tool (flow files) and HAR (HTTP Archive) files exported from browser DevTools. It can also merge data from multiple captures into a single schema.