Browser-based API tool · collections and secrets stay in this tab

Postman Collection Converter

Drop a Postman collection export and get an OpenAPI 3.0 document, a runnable list of curl commands, a .http file for VS Code or JetBrains, or Markdown docs. Add an environment file to fill in {{variables}}.

Input

Drop a collection .json export

Collection v2.0 or v2.1, up to 10 MB

Environment file (optional)

Postman environment export or a plain {name: value} object

Output

Load a collection to see the converted output.

Postman Collection Converter to OpenAPI, curl, .http and Markdown

Operator: Abdulla Al Fahad. How tools are built and checked

A Postman collection is a good record of how an API is really called: real URLs, real headers, bodies that work. It is a poor format for everything else. A gateway wants an OpenAPI file, a runbook wants curl, a repository wants plain text that diffs well, and not everyone on the team has Postman installed.

This converter reads a collection export, flattens the folders, works out which auth applies to which request, substitutes variables, and writes the result as OpenAPI 3.0.3, a list of curl commands, a .http file or Markdown. The openapi output can be opened in the OpenAPI docs generator on this site to see it rendered as reference pages.

Key features

  • Collection v2.0 and v2.1, including a bare request string and the collection wrapper some exports add
  • Folders become OpenAPI tags, named by their path (Orders / Refunds), with folder descriptions carried over
  • Auth inheritance from collection to folder to request, with noauth overriding; bearer, basic and API key are converted
  • Environment files in Postman export form or as a plain name and value object
  • Raw JSON, XML and text bodies, urlencoded, multipart (including file parts) and GraphQL bodies
  • Saved example responses become OpenAPI responses with schemas inferred from the JSON

How requests, folders, auth and variables are mapped

Variables are replaced wherever {{name}} appears: URL, headers, bodies and auth fields. Values are looked up first in the environment file and then in the collection's own variables, which matches Postman's rule that an environment overrides a collection variable. Nested references (a variable whose value contains another {{name}}) are followed up to five levels. Names with no value, including dynamic ones such as {{$guid}}, are left in place and counted in the Unresolved box. Turn the checkbox off to keep every {{name}} and, in the .http output, get @name = value lines at the top so VS Code REST Client or JetBrains can fill them.

Request bodies are typed from their mode. A JSON body is parsed, and its shape is inferred into a schema with the original as the example; an unquoted variable such as {"owner":{{ownerId}}} is tolerated for inference. Inference looks at one sample, so a field that is a string in the example is documented as a string, an array's items come from its first element, and nothing is marked required. Only one operation can exist per method and path, so a second request to the same pair is left out with a warning naming it.

Common use cases

  • A 60-request collection is the only record of how a payments API is called: export it with the staging environment and hand the OpenAPI file to the gateway team as a starting contract.
  • An incident runbook needs the 8 requests of a Support folder as curl commands that an on-call engineer can paste without opening Postman.
  • A repository gets the same requests as one .http file, so a pull request that changes a header shows up as a one-line diff.
  • A partner without Postman receives a Markdown reference: folders as headings, each request with its method and URL, headers table and the saved example responses.
  • A collection is moved between workspaces and the baseUrl variable changed: convert with variable filling off to keep {{baseUrl}} intact and get the @baseUrl line at the top of the .http file.

How to use this tool

  1. In Postman, export the collection as Collection v2.1 and, if you use variables, export the environment too.
  2. Drop the collection here, then the environment, and leave Fill in variables ticked.
  3. Pick OpenAPI, curl, .http or Markdown, check the warnings, and copy or download the result.

Example

Collection fragment

variable baseUrl = https://api.pets.test/v1
folder Pets > request List pets: GET {{baseUrl}}/pets?limit=10
Collection auth: bearer {{token}}
Environment: token = T0K, baseUrl = http://localhost:3000

curl output

# Pets / List pets
curl --request GET \
  --url 'http://localhost:3000/pets?limit=10' \
  --header 'Authorization: Bearer T0K'
(the environment's baseUrl beats the collection's; in OpenAPI the same request is GET /pets under the tag Pets with a bearerAuth security requirement)

Edge cases to watch

Path variable values defined in a request's URL variable list are not read, so :petId stays as :petId in curl and .http output.

OAuth 1, OAuth 2, AWS Signature, Digest and other auth types are not converted; the converter says which request used them.

Collection scripts (pre-request and test events) are ignored. Anything those scripts add, such as a computed signature header, will be missing from the output.

A schema inferred from one example is a draft. Review required fields, enums and formats before using it for validation.

  • Keep secrets out of the export. Put tokens in an environment file you do not commit, convert here, and share only the curl or OpenAPI result with placeholders restored by turning variable filling off.
  • Name requests the way you want operation IDs to read; each name is camel-cased into operationId, so List pets becomes listPets.

Common errors and how to fix them

"This does not look like a Postman collection: there is no top-level item list"
You may have exported an environment or a Postman Dump file. Export a single collection with Export, then Collection v2.1.
"GET /pets already exists, so this request was left out"
OpenAPI allows one operation per method and path. Postman collections often hold several variants (with and without filters); keep the one you want as the documented operation.

How requests become OpenAPI operations

For OpenAPI, the most common origin across requests becomes servers[0]. If that origin is itself an unresolved variable such as {{baseUrl}}, the server is written as {baseUrl} with a server variable and a placeholder default, and a warning says so. Requests whose origin differs get an operation-level servers entry. Path segments written as :id or {{id}} become {id} path parameters. Query parameters become optional parameters (disabled ones are included and say so); custom headers become header parameters, while Content-Type, Accept and Authorization are left out because OpenAPI does not allow them as parameters.

What the curl, .http and Markdown outputs contain

The curl output uses --request, --url, --header and --data-raw with each value shell-quoted for POSIX shells, --user for basic auth, --data-urlencode for urlencoded forms and --form for multipart. The .http output separates requests with ### lines and writes multipart bodies with an explicit boundary. The Markdown output escapes every collection string, so a request description containing angle brackets or pipes cannot break the layout.

Frequently asked questions

Why does the OpenAPI output say every parameter is optional?

A collection records one call, not the rules for it. Nothing in the file says whether limit is required, so only path parameters are marked required.

Does it handle Postman collections exported in the v1 format?

No. v1 had a different layout (requests in a flat list with an order array). Open it in Postman and export again as v2.1.

How are nested folders named in OpenAPI?

The tag is the whole folder path joined with a slash, such as Orders / Refunds, so two folders with the same name under different parents stay separate. Folders nested more than 20 levels deep are skipped with a warning.