HAR to OpenAPI 3 Spec Generator avatar

HAR to OpenAPI 3 Spec Generator

Pricing

from $20.00 / 1,000 openapi spec generateds

Go to Apify Store
HAR to OpenAPI 3 Spec Generator

HAR to OpenAPI 3 Spec Generator

Turn a HAR recording of an API you own or are authorized to use into an OpenAPI 3 spec: templated paths, typed parameters, auth scheme, pagination and response schemas. Secrets redacted by default. YAML + JSON output.

Pricing

from $20.00 / 1,000 openapi spec generateds

Rating

0.0

(0)

Developer

Kobi Mozgori

Kobi Mozgori

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 days ago

Last modified

Features

Limited permissions

Share

Turn a HAR recording of an API you own or are authorized to use into a ready-to-edit OpenAPI 3.0.3 spec: templated paths, typed parameters, the auth scheme, pagination hints and response schemas. Secrets are redacted by default.

Typical uses:

  • Document an internal or legacy API that never had a spec, from traffic your own app or test suite already produces.
  • Bootstrap a spec for your own service before writing it by hand, then import it into Swagger UI, Postman, Insomnia, Stoplight or a code generator.
  • Diff what your client actually calls against the official spec of an API you have access to.

Acceptable use. Use this Actor only on traffic you are allowed to record and analyze: your own APIs, APIs of your employer or client with their permission, or third-party APIs whose terms allow it. It is a documentation tool, not a tool for reverse-engineering or bypassing access controls of sites you are not authorized to use. Do not upload HARs that contain other people's personal data. You are responsible for complying with the terms of every API that appears in your HAR.

What you get

OutputWhere
OpenAPI spec (JSON, or YAML when format is yaml)Key-value store record OUTPUT
openapi.yaml / openapi.jsonKey-value store records (per outputFormat)
One row per endpoint (method, path, params with types, status codes, auth, pagination)Default dataset, view Endpoints
Run summary (requests used/dropped, redaction counts, timing; never secret values)Key-value store record RUN_SUMMARY

The spec contains:

  • Templated paths: /users/101, /users/202 → /users/{userId} (integers, UUIDs, hex ids, dates, slugs, composite segments), using URLs found in response bodies as extra evidence.
  • Typed parameters: path and query params with integer, number, boolean, array, date, date-time, uuid; required vs optional from how often they appear.
  • Request bodies: JSON and form-urlencoded schemas.
  • Responses: one entry per observed status code with an inferred JSON schema.
  • Auth: securitySchemes for bearer, basic, API key in header or query, applied per operation.
  • Pagination: x-pagination with offset/page/cursor params, Link: rel="next" headers and next/total fields.

Secret redaction (on by default)

Before inference, and again on the final output, the Actor replaces with REDACTED:

  • values of Authorization / Proxy-Authorization (keeping the scheme word, so Bearer REDACTED still yields a bearer scheme), Cookie, Set-Cookie and HAR cookie lists;
  • API-key and token headers (X-API-Key, X-Auth-Token, CSRF tokens, …) and any header, query, form or JSON field whose name looks like a secret (token, secret, password, api_key, session, signature, …);
  • bearer/basic credentials, JWT-looking strings and common key formats (for example sk_live_…, ghp_…, AKIA…, AIza…) anywhere in URLs, headers or bodies;
  • user:password@ in URLs.

A final pass re-checks the serialized spec, the dataset rows and the summary for every secret value collected from the HAR. The test suite proves that no secret from a sample HAR full of fake credentials appears in any output. Redaction is best-effort pattern matching: review the spec before sharing it, and prefer HARs recorded with test accounts.

Input

FieldDescription
harFileUpload a .har file (stored in a key-value store).
harUrlOr give a direct http(s) link to a HAR. Prefilled with a small synthetic demo HAR (fake credentials). With no HAR at all, the Actor runs its built-in demo HAR.
outputFormatboth (default), yaml or json.
baseUrlKeep only one API: URL prefix (https://api.example.com/v1) or host (api.example.com, *.example.com). Default: the most frequent origin in the HAR.
redactSecretsDefault true.
skipStaticAssetsDefault true: ignore images, fonts, CSS, JS.
titleOptional info.title.
maxHarMbDownload limit, default 100 MB.

Example:

{
"harUrl": "https://example.com/my-own-app.har",
"baseUrl": "api.my-company.example",
"outputFormat": "both",
"redactSecrets": true
}

How to record a HAR: Chrome/Edge/Firefox DevTools → Network → reproduce the flows you want documented → Export HAR. Exercising more variety (several ids, pages, error cases) gives better templating and response schemas.

Accuracy

We benchmarked the inference engine against official OpenAPI specs. On a holdout set of 3 public APIs (25 operations) that were generated only after the engine was frozen, it scored a combined endpoint+parameter F1 of 0.990, versus 0.559 for mitmproxy2swagger. Inference runs in under 0.12s per HAR on the benchmark machine (a full Actor run also includes container start-up). Results are deterministic: the same HAR always gives the same spec.

Known limits: the spec only covers what the HAR contains; parameter names for templated segments are inferred ({userId}, {order}) and may need renaming; an identifier with a raw / inside it can be split into several segments; info.version is 0.0.0-inferred.

Pricing

Pay per event: $0.02 per generated spec (one HAR = one spec), plus Apify's standard synthetic Actor-start event. Dataset rows are free. See the Pricing tab for the current numbers.

Integrations

Use the Apify API, CLI, Make, Zapier or n8n to run the Actor and fetch openapi.yaml from the run's key-value store, for example in CI after your end-to-end tests record a HAR.

Support

Open an issue on the Actor's Issues tab with a description of the problem. Please never attach a HAR that contains real credentials or personal data.