- Home
- Developer Tools
- cURL Generator
cURL Command Generator
Build a curl command from a form — method, query params, headers, auth, JSON or multipart body. Or paste a command you already have to edit it and export it to JavaScript fetch, Python requests, Axios or Go.
Appended to the URL and percent-encoded for you.
curl \
'https://api.example.com/v1/users?limit=10' \
-H 'Accept: application/json'How to use cURL Generator
Set the method and URL
Query parameters go in the Params tab and get percent-encoded for you.
Add headers, auth and a body
Bearer, Basic or API key auth, plus JSON, form, multipart or raw bodies. Content-Type is filled in automatically.
Copy the command
One click. Turn off multi-line if you need a single line for Windows CMD or a CI step.
Or go the other way
Paste an existing curl command to load it into the form, then export it as fetch, Python, Axios or Go.
Frequently Asked Questions
What is a cURL command?
cURL is a command-line tool for making HTTP requests. A curl command is the whole request expressed as one line of shell: the URL, the method, any headers, and the body. Because it is plain text it is the standard way to share a reproducible API call — in documentation, in a bug report, or between a browser and a terminal. Every browser can export a network request as one, and every API vendor documents endpoints with one.
How do I convert a cURL command to Python, JavaScript or Go?
Paste the command into the import box at the top of this page and press Parse & load, then switch the output tab to Python, JS fetch, Axios or Go. The command is parsed into its parts — method, URL, query string, headers, auth and body — and each language is generated from those parts rather than by string substitution, so the JSON body arrives as a real object (a dict in Python) instead of a quoted string.
Does curl follow redirects by default?
No. curl stops at the first 3xx response and prints it unless you pass -L (--location). This is the single most common reason a curl command "works" but returns an empty body: the endpoint moved and curl showed you the 301. Note that most HTTP libraries do the opposite and follow redirects automatically, so a faithful translation of a curl command without -L has to disable redirects — that is why the generated code here adds redirect: "manual", allow_redirects=False or a CheckRedirect function when you leave -L off.
How do I send JSON with curl?
Pass the body with -d and set the content type yourself: curl -X POST 'https://api.example.com/users' -H 'Content-Type: application/json' -d '{"name":"Ada"}'. curl does not infer the type — without that header it sends application/x-www-form-urlencoded and most APIs reply 400 or 415. Selecting the JSON body type on this page adds the header for you.
What is the difference between -d, --data-urlencode and -F?
-d sends the body exactly as you typed it, so you have to escape it yourself. --data-urlencode percent-encodes each name=value pair for you, which is what you want for form fields containing spaces, ampersands or plus signs. -F sends a multipart/form-data body and lets curl generate the boundary; it is the only one of the three that can upload a file, using -F 'file=@/path/to/report.pdf'. Never set Content-Type by hand with -F — you will overwrite the boundary and the server will fail to parse the body.
Why does my curl command fail on Windows?
Two reasons. First, the line continuation character: Unix shells use a trailing backslash, Windows CMD uses a caret, so a multi-line command copied from documentation breaks. Turn off "Break onto multiple lines" here to get a single-line command that runs anywhere. Second, quoting: CMD does not treat single quotes as quotes, so a JSON body wrapped in them arrives mangled. In CMD, wrap the body in double quotes and escape the inner ones; in PowerShell, prefer the one-line form or use curl.exe explicitly, since curl is an alias for Invoke-WebRequest in older versions.
Is it safe to paste a command containing an API key?
Yes. Everything on this page runs in your browser — parsing, generating and copying all happen in JavaScript on your machine, with no network request and no logging. Nothing you type or paste is uploaded or stored. That said, treat any token you paste anywhere as worth rotating if you are unsure, and never commit a generated snippet with a live key in it.
Read next
JSON Formatter & Validator
Clean up a request or response body before you paste it into the generator.
JWT Decoder
Inspect the bearer token you are sending — check its claims and expiry before blaming the API.
SSL Certificate Checker
If you only got a response with -k, check what is actually wrong with the certificate.
REST API vs GraphQL
When a single POST to /graphql beats a handful of REST calls — and when it does not.
