Skip to content

Instantly share code, notes, and snippets.

@quantumproxies
Created August 21, 2026 12:42
Show Gist options
  • Select an option

  • Save quantumproxies/7fede6d34cc427b58992f795f404f4ca to your computer and use it in GitHub Desktop.

Select an option

Save quantumproxies/7fede6d34cc427b58992f795f404f4ca to your computer and use it in GitHub Desktop.
Turn a copied curl command into Python, Node or Go — and into a QuanticData scrape call https://quanticdata.io/tools/curl-converter/

From a copied curl to working code

Chrome DevTools → Network → right-click a request → Copy as cURL is the fastest way to reproduce a request. Turning that into code by hand is the slow part.

Paste it here: quanticdata.io/tools/curl-converter — Python (requests), Node (fetch/axios), Go, PHP, Ruby, Java and more.

The part the converter cannot do for you

The copied curl carries your cookies, your session and your IP. It works once, from your machine, and then stops working — because the target was never answering "curl", it was answering "a logged-in browser on a residential connection".

Two ways to close that gap.

1. Keep your code, add a proxy

proxies = {"http": "http://USER-country-us:PASS@pr.quanticdata.io:7777",
           "https": "http://USER-country-us:PASS@pr.quanticdata.io:7777"}
requests.get(url, headers=headers, proxies=proxies, timeout=30)

Targeting lives in the username: -country-, -city-, -session-, -sessTime-. See QuanticData proxies.

2. Or hand the whole problem over

POST /v1/scrape does the fetch, the rendering, the retries and the exit selection, and gives you back Markdown or extracted JSON. One request, no headers to maintain:

curl https://api.quanticdata.io/v1/scrape \
  -H "Authorization: Bearer $QD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/page","format":"markdown","country":"us"}'

See curl-to-quanticdata.md in this gist for the field-by-field mapping from a copied curl to a scrape call — headers, cookies, method, body, and the render/actions options that replace "…and then I click the cookie banner".

More free tools

robots.txt tester · robots.txt generator · user-agent lookup · all tools

Copied curl → POST /v1/scrape, field by field

In the copied curl In the scrape body Notes
the URL "url" required
-H 'User-Agent: …' "headers": { "User-Agent": "…" } only send the ones that matter
-H 'Cookie: …' "cookies": "…" session cookies expire — prefer a fresh fetch
-X POST + --data '…' "method": "POST", "body": "…"
--compressed (nothing) handled for you
--socks5 / -x "country", "rotation", "sessionId" exits are selected server-side
"and then I accept the cookie banner" "render": true, "actions": [{"click":"#accept"}]
"the data loads after scrolling" "render": true, "scrollToBottom": true
"I read it from the JSON the page fetches" "xhr": true, then "actions": [{"fetchResource":{"pattern":"/api/items"}}] returns that response body instead of the DOM

Worked example

Copied from DevTools:

curl 'https://shop.example/api/products?page=2' \
  -H 'accept: application/json' \
  -H 'user-agent: Mozilla/5.0 …' \
  -H 'cookie: session=abc123; consent=1' \
  --compressed

As a scrape call:

{
  "url": "https://shop.example/api/products?page=2",
  "format": "text",
  "country": "us",
  "headers": { "accept": "application/json" }
}

Drop the user-agent (a real browser fingerprint is applied for you) and drop the cookie unless the endpoint genuinely needs your session. What is left is the request, not the accident of the browser it was copied from.

Converter: https://quanticdata.io/tools/curl-converter/ · Docs: https://quanticdata.io/web-scraping-api/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment