Convert cURL to Python Requests

Paste a cURL command and get equivalent Python requests code with headers and body.

How to use

  1. Paste your cURL command in the input box.
  2. Python requests code appears automatically.
  3. Click Copy to copy the generated code.

Frequently asked questions

What Python library is used?

The requests library — the standard for HTTP in Python. Install with pip install requests.

What cURL flags are supported?

Common flags: -X method, -H headers, -d/--data body, --json, and URL.

Does this send the request?

No. This only converts the command. Run the Python code to execute the request.

Is my data sent to a server?

No. Conversion happens entirely in your browser.

Last updated

Powered by maratool