Postman to cURL
Turn a Postman collection into curl commands you can run in any terminal or paste into a script. Every request in the collection — across nested folders — becomes a labelled curl command with the right method, headers, query string, auth, and body, whether the body is raw JSON, URL-encoded, form-data, or GraphQL. Optionally resolve {{variables}} from the collection's variable list. Converted entirely in your browser; no collection or token is uploaded.
How to use the Postman to cURL
Export a collection from Postman (… → Export → Collection v2.1) and paste the JSON, or paste a single request object. The tool walks the collection — descending into folders — and emits one curl command per request, prefixed with a comment showing the request name. Each command uses -X for the method, -H for headers, --data or -F for the body depending on its mode, and -u for basic auth, formatted with line continuations so it's readable and runnable.
Leave Resolve variables on to substitute {{baseUrl}} and similar placeholders with the values defined in the collection's variables; turn it off to keep the placeholders literal, which is handy when you'll set them as shell variables instead. Bearer tokens and API keys are emitted as headers using the collection's stored values or a placeholder — review and replace any real secrets before sharing the commands.
From collection to command line
Postman collections and curl are two ways of expressing the same thing: an HTTP request. A collection is a structured JSON document — Postman's Collection v2.1 schema — that stores requests with their method, URL parts, headers, auth, and body, organised into folders. curl is the universal command-line HTTP client. Converting between them lets you take a request you built and tested visually in Postman and drop it into a shell script, a CI job, a Dockerfile, a bug report, or documentation, where a self-contained curl command is far more portable than a collection file.
The translation maps each piece of the collection to a curl flag. The request method becomes -X; headers become repeated -H arguments; a raw JSON body becomes --data with a Content-Type: application/json header; URL-encoded bodies use --data-urlencode; and multipart form-data uses -F, with file fields written as @filename. Authentication is handled per type — basic auth maps to -u user:pass, while bearer and API-key auth become the appropriate header. Values are single-quoted for the shell so payloads with spaces or special characters survive intact.
Variables are where collections and scripts diverge. Postman resolves {{baseUrl}} and other placeholders from environments and collection variables at send time; a curl command has no such layer. You can either bake the values in — convenient for a one-off command — or keep the placeholders and define them as shell variables for reuse across environments. Because collections can embed tokens and credentials, doing the conversion in the browser keeps those secrets local, and you should still scrub any real keys from commands before committing or sharing them.
Common use cases
- Scripting and CI. Move a tested Postman request into a shell script or pipeline step.
- Documentation. Show a runnable curl example in a README or API guide instead of a collection file.
- Bug reports. Share a single self-contained command that reproduces an API call.
- Quick reruns. Fire a saved request from the terminal without opening Postman.