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.

curl commands

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.

Frequently asked questions

Which Postman format does it accept?

Collection Schema v2.1, the current export format, plus single request items and bare request objects. Export from Postman with Export → Collection v2.1 and paste the JSON.

How are request bodies converted?

Raw bodies become --data (with a JSON Content-Type when the body language is JSON), URL-encoded bodies become --data-urlencode per field, and form-data becomes -F arguments, with file fields written as key=@filename. GraphQL bodies are serialised to a JSON query/variables payload.

What happens to {{variables}}?

With resolving on, placeholders are replaced using the values in the collection variable list. With it off, the placeholders are kept literally so you can define them as shell variables. Environment-level variables are not included in an exported collection, so define those yourself.

Does it expose my auth tokens?

Only within your browser. The conversion is local and nothing is uploaded, but tokens stored in the collection do appear in the generated commands. Replace real secrets with placeholders or shell variables before sharing or committing the output.

Can it convert nested folders?

Yes. It recurses through folders and emits a command for every request it finds, each labelled with its name so you can tell them apart in the output.