Postman collections store hundreds of API requests, but they're locked inside a proprietary format. When you need to share requests with teammates who don't use Postman, embed them in shell scripts, or add them to CI pipelines, cURL is the universal format.
What Is Postman to cURL?
This tool takes Postman collection exports (JSON) and converts each request into a standalone cURL command with all headers, authentication, body data, and query parameters preserved. It handles collection variables, pre-request auth, and environment-specific values.
How to Use Postman to cURL on DevToolHub
- Open the Postman to cURL tool on DevToolHub — no signup required.
- Export your Postman collection as JSON (Collection v2.1).
- Paste the JSON into the input panel.
- View the generated cURL commands — one per request.
- Copy individual commands or download all as a shell script.
- Replace Postman variables (
{{base_url}}) with actual values.
Converting a Simple GET Request
Postman stores requests in a nested JSON structure:
// Postman JSON:
{
"method": "GET",
"url": "{{base_url}}/api/users",
"header": [
{ "key": "Authorization", "value": "Bearer {{token}}" },
{ "key": "Accept", "value": "application/json" }
]
}
// Output:
curl -X GET 'https://api.example.com/api/users' \
-H 'Authorization: Bearer tok_abc' \
-H 'Accept: application/json'Clean, portable, and ready for any terminal.
Converting POST Requests with JSON Bodies
Requests with payloads translate naturally:
curl -X POST 'https://api.example.com/api/orders' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer tok_abc' \
-d '{
"product_id": "prod_42",
"quantity": 2,
"shipping": "express"
}'The body is properly escaped and formatted for shell execution.
Batch-Converting an Entire Collection
Convert a collection with 20+ requests into a shell script:
#!/bin/bash
# API Health Checks — generated from Postman
echo "Testing user endpoints..."
curl -s -o /dev/null -w "%{http_code}" https://api.example.com/users
echo "Testing order endpoints..."
curl -s -o /dev/null -w "%{http_code}" https://api.example.com/orders
echo "Testing auth endpoints..."
curl -s -o /dev/null -w "%{http_code}" https://api.example.com/auth/statusUse this script in CI/CD to verify all endpoints are reachable after deployment.
Pro Tips
- Export as v2.1 — older Postman formats may lose header or body details.
- Handle environment variables — replace
{{variable}}placeholders before using the commands. - Preserve auth — Postman's inherited auth (set at collection level) must be explicitly added to each cURL command.
- Script health checks — converted commands make excellent deployment smoke tests.
When You Need This
- Sharing API requests with teammates who prefer terminal over GUI tools
- Building CI/CD health-check scripts from existing Postman collections
- Documenting API usage in README files and wikis
- Migrating from Postman to a code-first API testing approach
Free Tools Mentioned in This Article