cURL to Python Converter

Paste a cURL command to generate Python code using the Requests library. Conversion happens in your browser; the tool does not send the request described by your command.

Loading interactive tool…

From a copied request to a script

Browser developer tools often offer “Copy as cURL” for a network request. Choose the Bash format when that option is available. Paste the command above, convert it, and inspect the generated arguments. The converter handles common headers and request bodies, including JSON submissions.

Install Requests in the Python environment where you intend to run the output, using python -m pip install requests. Replace temporary credentials before running a saved script. Pasted authorization headers can appear verbatim in the result, so remove those values before sharing the generated code.

Where translation needs review

Shell expansion depends on the environment where the original command runs. Complex substitutions and some cURL options cannot be represented faithfully in Requests. The underlying curlconverter library reports warnings; this page displays them together with the output rather than hiding potential differences.

A file reference such as @payload.json does not upload that file to this page. Generated code may expect to read it later on your computer. Review redirects and authentication behavior before executing the result against a real service. Converting successfully confirms that code was produced, not that a remote API will accept it.