I am developing a REST API. during development I have used postman (chrome extension) to use and document my API. It is a wonderful tool and I have most of my API endpoints in it. However, as we near release I would like to document this API in swagger, how would I do that? Is there a way that I can generate swagger based off of the postman export?
Asked
Active
Viewed 1.2e+01k times
111
-
For C#/DotNet, see these two: 1.[]c# - How to generate JSON Postman Collections from a WebApi2 project using WebApi HelpPages that are suitable for import - Stack Overflow ; ; stackoverflow.com/questions/23158379/ ; ; ; 2.[]; ; X.Introducing the Azure API Apps Tools for Visual Studio 2013 - The Visual Studio Blog - Site Home - MSDN Blogs ; ; http://blogs.msdn.com/b/visualstudio/archive/2015/03/24/introducing-the-azure-api-apps-tools-for-visual-studio-2013.aspx – AnneTheAgile Dec 23 '15 at 03:46
-
4You can use postman2openapi on the web: https://kevinswiber.github.io/postman2openapi/ – Arlemi Apr 07 '21 at 14:22
-
https://metamug.com/util/postman-to-swagger/ is most updated tool. – Sorter Sep 20 '21 at 12:04
-
you can use postman to swagger online tool https://www.workversatile.com/postman-to-swagger – Arshad Shaikh Aug 16 '22 at 11:44
3 Answers
110
As of 2022 my recommendation is the excellent Rust/Wasm tool from Kevin Swiber, which is available online, as a Rust crate and as an npm module. https://kevinswiber.github.io/postman2openapi/
APIMatic API Transformer can process a Postman collection (v1 or v2) as an input format and produce Swagger 1.2 or 2.0, and now OpenAPI 3.0.0 as output.
It has its own API and a Web front-end, and also a command-line version.

MikeRalphson
- 2,247
- 2
- 15
- 16
-
13
-
-
This works like a charm when I tried to convert my postman V2.1 json to swagger 2.0. But they ask you to sign up first. – Sathish Nov 22 '19 at 10:30
-
I have signed up and they have provided me a 14 days trial period, not sure if I would be able to convert the Postman collection to Swagger post the trial period is over. – Rito Jan 25 '21 at 05:22
-
2Why not try a free online converter like any other converter. All it takes is some javascript https://metamug.com/util/postman-to-swagger/ – Sorter Sep 20 '21 at 12:06
-
1
-
-
Maybe I'm missing something, but even on the github.io page there's a big link saying "Fork Me" so there's no need to signup for anything. Both the io and com links show how to download the binaries and run them locally without needing to create an account. Are you prompted from the command line??? – Bob Ramsey Jun 12 '23 at 15:21
18
Someone posted this link (and deleted it?): http://restunited.com/
It accepts postman JSON and converts it to swagger. This seems to be what I was looking for.

StuBob
- 1,490
- 2
- 10
- 13
-
5RestUnited is only free if one has <=5 endpoints per API and <=3 APIs. – AnneTheAgile Dec 22 '15 at 18:35
-
The export (to postman collection or swagger spec) has no limitation. The limitation you mentioned is only for generating SDKs and documentation. – William Cheng Aug 12 '16 at 13:18
-
6
-
1I just tried to import the default postman echo collection on restunited and it wouldn't work. Maybe they haven't been keeping up to date with postman? – daraul Apr 21 '18 at 16:07
-
2
-
Not able to find the upload postman collection option, maybe they have stopped the support. – Rito Jan 19 '21 at 11:48
14
You can use https://github.com/stoplightio/api-spec-converter with code
var transformer = require('api-spec-transformer');
var postmanToSwagger = new transformer.Converter(transformer.Formats.POSTMAN, transformer.Formats.SWAGGER);
postmanToSwagger.loadFile('/path/to/your.json.postman_collection', function(err) {
if (err) {
console.log(err.stack);
return;
}
postmanToSwagger.convert('yaml')
.then(function(convertedData) {
// convertedData is swagger YAML string
console.log(convertedData);
})
.catch(function(err){
console.log(err);
});
});

plotnik
- 372
- 2
- 5