Home / Cost tools / cURL converter
cURL converter
Paste the cURL command from any API's documentation and get the same request in 15 languages, from Python and Node.js to Go, Java and Rust. It converts in your browser; nothing you paste is sent anywhere.
Converted in your browser. Nothing you paste is stored or sent, so a command with your API key in it stays on your machine.
import requests
headers = {
"Authorization": "Bearer YOUR_API_KEY",
}
response = requests.get("https://api.scraper.example/v1/scrape?url=https%3A%2F%2Fshop.example.com%2Fproducts%3Fpage%3D2&render_js=true&country=us", headers=headers)
print(response.status_code)
print(response.text) Install first: pip install requests
Every language
cURL to Python
With requests.
cURL to JavaScript fetch
With the browser's fetch.
cURL to Node.js fetch
With Node's built-in fetch (Node 18 and later).
cURL to Axios
With Axios.
cURL to Node.js request
With the request package (deprecated).
cURL to PHP
With PHP's cURL extension.
cURL to Go
With net/http.
cURL to Java
With java.net.http (Java 11 and later).
cURL to Rust
With reqwest (blocking client).
cURL to R
With httr.
cURL to Dart
With package:http.
cURL to Elixir
With HTTPoison.
cURL to MATLAB
With matlab.net.http.
cURL to CFML
With cfhttp.
cURL to JSON
The request as plain JSON, for fixtures and other tools.
What the converter reads
The method (-X), headers (-H, -A, -e, -b), a body (-d, --data-raw, --data-urlencode, --json), form fields and files (-F), basic authentication (-u), a proxy (-x), query parameters sent with -G, redirects (-L), compression (--compressed), a time limit (-m) and certificate checks turned off (-k). Flags that only change what curl does on your own machine, such as -s, -v, -o and --retry, are dropped; any other flag is named under the code so you know it was not carried over.
What calls like the example cost
The example is a scraping API call with JavaScript rendering on and a country chosen. 100,000 of them a month cost from $49.00 on ScrapeBadger, and the same pages without rendering from $19.00 on BrowserCloud, the cheapest complete bills across 27 web scraping APIs this site prices from their own pages.