Converter
Convert curl to Python
Paste any curl command and get a ready-to-run Python requests equivalent — headers, auth, JSON body, all of it. Credentials are automatically moved to environment variables.
Open curl explainer →Example
curl input
curl -X POST https://api.stripe.com/v1/charges \
-H "Authorization: Bearer sk_test_…" \
-H "Content-Type: application/json" \
-d '{"amount":2000,"currency":"usd"}'Python output
import requests
import os
response = requests.post(
"https://api.stripe.com/v1/charges",
headers={
"Authorization": f"Bearer {os.environ['STRIPE_API_KEY']}",
"Content-Type": "application/json",
},
json={"amount": 2000, "currency": "usd"},
)
print(response.json())How it works
01
Paste your curl
From the terminal, Postman, or Chrome DevTools → Network → Copy as cURL.
02
Explain it
curlwtf parses every flag, header, and body parameter.
03
Copy the Python
The Python tab shows a requests equivalent. Credentials use os.environ so you don't leak keys.