HAR to OpenAPI Converter
har_to_openapiTurn a HAR file (a browser network export) into an OpenAPI 3.1 description of the API calls in it. Cleans the file first: drops cookies and login headers and replaces secret-named headers, query parameters, form fields and JSON keys with REDACTED. Groups calls by host, method and path template (numeric ids, UUIDs and long hex or base64 path parts become parameters), and infers query parameters, request body schemas and response schemas per status from the samples. Sign-in methods are named, never copied; example values are off unless asked for. Leaves out page loads, static files and preflights unless asked. Returns the OpenAPI document as JSON and the endpoint count. Pure standard library, no network, model or clock.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| har | Yes | Required. The HAR file's JSON text (a browser network export), at most 2,000,000 characters. | |
| host | No | Only describe calls to this host, such as api.example.com. | |
| examples | No | Add example values from the cleaned file to parameters and bodies. Default false. | |
| include_static | No | Also describe page loads, images, scripts, styles, fonts, media and CORS preflights. Default false. |