New routeman for Node.js is on npm Read the announcement →

Postman collections, generated from your API code.

routeman reads the routes, schemas and models your API already has, in Python or in JavaScript and TypeScript, then writes a complete Postman collection: request bodies, authentication, environments and a login request that saves the token. One command. No OpenAPI schema.

Get started →
Python$ pip install routeman
Node$ npx routeman-cli
  • Free & MIT licensed
  • Python 3.9+ · Node.js 18.3+, Bun, Deno
  • Zero dependencies
  • Runs locally, read-only
~/shop-api
Terminal0.26s
$ pip install routeman
$ routeman generate
✓ django: 10 requests (4 POST, 3 GET, 1 PUT, 1 PATCH, 1 DELETE)
✓ auth: bearer (login: POST /api/v1/auth/token/)
✓ wrote postman/shop-api.postman_collection.json
✓ wrote postman/shop-api.local.postman_environment.json
  done in 0.26s - import the files in Postman (File → Import)

$ routeman routes | head -4
GET     /api/v1/                        🔒
POST    /api/v1/auth/token/               json: username, password
POST    /api/v1/auth/token/refresh/       json: refresh
GET     /api/v1/products/               🔒
shop-api.postman_collection.jsonv2.1
  • Auth
  • POSTToken obtain pair saves token
  • POSTToken refresh
  • Shop
  • GETList products ?page&search
  • POSTCreate product form-data
  • GETGet product
  • PUTUpdate product
  • PATCHPartially update product
  • DELDelete product
  • POSTPublish

01 How it works

From codebase to collection in under a minute.

No annotations, no spec to maintain, no documentation library. The Python edition loads your app the way your server does. The Node.js edition reads your source files and never runs them.

01

Install

Python: add routeman to your project's virtualenv. Node.js, Bun or Deno: run it with npx, nothing to install. Neither has dependencies.

$ pip install routeman      # Python
$ npx routeman-cli          # Node.js
02

Generate

The framework, entry point, auth scheme and login route are detected automatically, and .env is read for you.

$ cd your-project
$ routeman generate
03

Import & send

In Postman, choose File → Import, drop both files, select the environment and send Login. They open in Swastik Codes too.

postman/
├─ shop-api.postman_collection.json
└─ shop-api.local.postman_environment.json

02 The output

A collection you can actually send requests with.

Most generated collections are a list of URLs. routeman fills in everything you would otherwise type by hand, so the first Send works.

Every route, organised

Every route across all files, routers and mounts, with prefixes and versions applied. One folder per app, blueprint, tag or resource. Admin, static and catch-all routes are left out.

Bodies that pass validation

JSON, form-urlencoded or multipart with file pickers. Example values respect choices, ranges, lengths, patterns and field names, so an email field gets user@example.com.

Auth detected, login automated

Bearer/JWT, DRF Token, Knox, Passport, NestJS guards, Basic, API key or session. The login request stores access_token and refresh_token for every other request.

Path & query parameters

{{product_id}} or {{productId}} variables, typed from your models, pipes and schemas, plus pagination, search and filters. Optional parameters are added but switched off.

Smoke tests built in

Every request asserts the response is not a 5xx, so the Collection Runner or Newman can check your whole API in CI.

Environments per server

One file each for local, staging and production, with tokens and passwords marked as secrets.

Docs inside every request

The view's docstring or JSDoc comment and a field table (type, required, allowed values) appear in each request's description.

Stable ids, clean re-imports

Regenerate whenever the API changes. Ids don't change, so re-importing replaces the collection instead of duplicating it.

Read-only and offline

routeman never touches your database, never sends requests and never uploads your code. The Node.js edition doesn't even run it. It writes two JSON files.

03 Under the hood

It reads your code, not a schema.

routeman works from what your code already declares. When a handler declares nothing, it reads the handler's source, for example request.data.get('email') or const { email } = req.body, and still builds the body.

Python

pip install routeman · imports your app read-only
FrameworkRoutes fromBodies & parameters from
Django REST frameworkURLconf: routers, ViewSets, @action, APIViews, @api_viewSerializers (nested, many=True, relations, choices, files), pagination, SearchFilter, OrderingFilter, django-filter, permission and authentication classes
DjangoURLconf: path, re_path, include, CBVs and FBVsform_class, ModelForms, require_http_methods, request.POST/GET/FILES, json.loads(request.body)
Flaskapp.url_map: blueprints, MethodView, Flask-RESTfulrequest.json, get_json(), form, args, files, marshmallow, flask-smorest, Pydantic, @jwt_required, @login_required, Flask-HTTPAuth
FastAPIFastAPI's built-in OpenAPI plus include_in_schema=False routesPydantic models, Query, Form, File, Header, Depends() security (OAuth2, HTTP Bearer, API key)

JavaScript & TypeScript

npx routeman-cli · static analysis, never runs your code
FrameworkRoutes fromBodies & parameters from
Express 4 / 5Router(), app.use(prefix, router), router.route(), sub-apps, router factories, routes registered in loopszod, Joi / celebrate, yup, express-validator, TypeScript types, req.body / req.query usage, multer uploads
NestJSControllers, global prefix, URI versioning, RouterModuleclass-validator DTOs, @ApiProperty, PartialType/PickType/OmitType, pipes, FileInterceptor, guards incl. APP_GUARD + @Public()
Fastify 4 / 5register(plugin, {prefix}), @fastify/autoload, fastify-plugin, route({...})JSON Schema and TypeBox, addHook / decorate auth, schema.summary
Next.js, Nuxt, SvelteKit, Astro, RemixFile routing: App Router route.ts, pages/api, server/api, +server.ts, resource routesrequest.json(), formData(), searchParams, readBody, getQuery, zod and valibot schemas
Hono, Koa, Elysia, Hapi, AdonisJS + moreSub-apps, basePath(), @koa/router, group, plugins with prefixes, resource().apiOnly()@hono/zod-validator, Elysia t.*, Joi validate, VineJS, Mongoose / Prisma / Sequelize / TypeORM models

Also Restify, Polka, tinyhttp, hyper-express, ultimate-express, itty-router, h3, Feathers, Oak, routing-controllers, tsoa, inversify-express-utils, LoopBack 4, Bun.serve, Deno.serve and plain node:http. See every framework →

04 Why routeman

Compared with the usual ways.

Hand-written requests drift from the code. An OpenAPI import needs a working schema setup first. routeman starts from the code you already have. Read the full comparison →

routemanOpenAPI → Postman importHand-written
Needs a schema library (drf-spectacular, flasgger, swagger-jsdoc, @nestjs/swagger…)NoYes, for most frameworksNo
Bodies from serializers, DTOs, zod / Joi schemas or handler codeYesOnly what the schema declaresTyped by hand
Login request that stores the tokenYesNoWritten by hand
Environments per serverYesPartly (from servers)By hand
Smoke test on every requestYesNoBy hand
Stays in sync with codeRe-run one commandRe-export and re-importManual upkeep

05 Who it's for

Built for teams that ship Python and Node.js APIs.

One generated collection serves everyone who touches the API, from the engineer who wrote the view to the pipeline that deploys it.

Backend engineers

Ship a complete, working collection with every pull request instead of a list of URLs in a chat message.

Frontend & mobile

Get example bodies, auth and environment switching without reading the back-end code.

QA & testers

Start exploratory and regression testing straight away, then build on the generated tests.

DevOps & CI

Generate in the pipeline and run with Newman as a 5xx smoke test after every deploy.

07 FAQ

Questions, answered.

Something else? Email routeman@swastik.ai or call +91 76545 31678.

All questions →

How do I generate a Postman collection from my API code?

Python (Django, DRF, Flask, FastAPI): install routeman in the virtualenv your project runs in, then run pip install routeman and routeman generate from the project folder. Node.js, Bun or Deno (Express, NestJS, Fastify, Next.js and more): run npx routeman-cli in the project folder. Both write postman/<name>.postman_collection.json and a local environment file. Import both in Postman with File → Import.

Do I need OpenAPI, Swagger, drf-spectacular or @nestjs/swagger?

No. routeman reads your application's real routes and its serializers, DTOs, schemas and models directly. You don't need an OpenAPI schema or any documentation library: no drf-spectacular, drf-yasg, flasgger, swagger-jsdoc or @nestjs/swagger. For FastAPI it uses the OpenAPI document that FastAPI already builds in memory, and it also picks up routes hidden with include_in_schema=False. If you do have a spec, routeman-cli --openapi can build from it.

Is routeman free?

Yes. routeman is open source under the MIT licence and free for personal and commercial use. It is published on PyPI as routeman and on npm as routeman-cli.

Does routeman send requests to my API or touch my database?

No. The Python edition imports your app to read its URL configuration, the same way manage.py or your WSGI/ASGI server does. The Node.js edition doesn't run your code at all: it parses the source files. Neither runs queries or migrations or sends HTTP requests. The output is JSON files on disk.

Which frameworks and versions are supported?

Python (routeman, Python 3.9+): Django 3.2 to 6, Django REST framework 3.12+, Flask 2.0 to 3.x (including blueprints, MethodView, Flask-RESTful and flask-smorest) and FastAPI 0.95+ with Pydantic v1 or v2. Node.js (routeman-cli, Node.js 18.3+, Bun or Deno): Express 4/5, Fastify 4/5, NestJS, Koa, Hono, Elysia, Hapi, AdonisJS 6, Next.js, Nuxt/Nitro, SvelteKit, Astro, Remix, routing-controllers, tsoa, LoopBack 4 and more. See all frameworks.

Does routeman work with Express, NestJS, Fastify or Next.js?

Yes, through routeman-cli on npm. Run npx routeman-cli in the project folder (or pnpm dlx, yarn dlx, bunx, deno run -A npm:routeman-cli). It follows routers, mounts, plugins, controllers and file-based routes, and reads zod, Joi, yup, TypeBox, class-validator and other schemas. See the Express, NestJS, Fastify and Next.js guides.

How does routeman handle authentication like JWT or DRF tokens?

It detects the scheme from your code: Bearer/JWT (SimpleJWT, flask-jwt-extended, FastAPI OAuth2, jwt.verify, Passport, @fastify/jwt, NestJS guards), DRF Token and Knox, Basic, API key headers and session auth. It sets collection-level auth, marks public endpoints as No Auth and adds a test script to the login request that saves access_token and refresh_token into the environment automatically.

Stop writing Postman requests by hand.

Run one command, import the result. Your whole API is ready to send requests within a minute, whether it's written in Python or TypeScript.