Amazon Scraper API vs Proxy: Choose a Product Data Source
Compare seller APIs, licensed Amazon product data and proxy page checks by record, access scope and reuse rights.
Read guideWe will use real tools like curlconverter, Postman snippets, and advanced.name’s cURL converter, and then harden the output so it works reliably with…

By the end of this tutorial, you will be able to take a proxy-enabled curl command and turn it into production-ready Python, Node, or PHP code that:
We will use real tools like curlconverter, Postman snippets, and advanced.name’s cURL converter, and then harden the output so it works reliably with residential proxy providers and AI pipelines.
This guide is the hands-on companion to our in-depth explainer, What a cURL converter is and how it works.
Before you start, you should have:
curl command (we’ll build one together in Step 1)fetch / Undici and Axios examples)Common failure at this stage
curl copied from DevTools that contains your real session cookies or Authorization headers. Never paste those into online tools or share them.To convert correctly, you first need a minimal, explicit cURL command that includes:
This example uses an HTTP residential proxy with username/password auth:
curl 'https://example.com/account' \
-x 'http://username:password@proxy.example.net:8000' \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)' \
-H 'Accept: text/html,application/xhtml+xml' \
-H 'Accept-Language: en-US,en;q=0.9' \
-H 'Referer: https://example.com/login' \
-b 'sessionid=abc123' \
--compressed \
--max-time 30
Key flags for proxy workflows:
-x / --proxy: sets proxy, including protocol-H: headers; often critical for bot detection-b: cookies; used for logged-in sessions--compressed: accept gzip/deflate--max-time: timeout in secondsIf you use a browser-based curl converter:
username, password, sessionid=...Authorization headers entirely, then reinsert them locally in code after conversionCommon failure
Cookie: and Authorization: headers, which can let others log in as you. advanced.name explicitly warns about this; treat your cURL just like a password.Modern cURL converters save time by generating starter code for you.
Popular options:
-x and adds SOCKS5 dependencies for Python/Node.python-requestsnode-axios or node-fetchphp-curlCurlconverter notes that:
curl arguments but ignores many that don’t map directly.http://user:pass@host:port) — this can override your -x flagCommon failure
-x or a proxy field. Always check that the output actually routes through your proxy.Python Requests is a strong default for production-grade scraping and AI-agent workflows because the Session object gives you:
Starting from the cURL in Step 1, a good Python translation might look like this:
import requests
from requests.auth import HTTPProxyAuth
proxies = {
"http": "http://proxy.example.net:8000",
"https": "http://proxy.example.net:8000",
}
proxy_auth = HTTPProxyAuth("username", "password")
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"Accept": "text/html,application/xhtml+xml",
"Accept-Language": "en-US,en;q=0.9",
"Referer": "https://example.com/login",
}
cookies = {
"sessionid": "abc123",
}
session = requests.Session()
session.headers.update(headers)
session.proxies.update(proxies)
session.auth = None # origin auth (if needed) goes here
response = session.get(
"https://example.com/account",
cookies=cookies,
timeout=30,
auth=proxy_auth, # proxy authentication
allow_redirects=False # match curl (no -L)
)
print(response.status_code)
print(response.text[:500])
Notes:
proxies maps scheme to proxy URL.HTTPProxyAuth is used when the proxy demands username:password.allow_redirects=False matches cURL’s default (cURL does not follow redirects unless you use -L).When converting authenticated flows:
session.headers.session.get() / post() or use session.cookies if you know they’ll change.Common failure
requests.Session(). Without a session, you lose cookie persistence and connection pooling, which breaks authenticated scraping and AI agents that need the same session over many requests.Node’s modern HTTP stack is built on Undici, which powers fetch in recent Node versions. For scraping and AI agents, two common clients are:
import axios from "axios";
const agent = axios.create({
baseURL: "https://example.com",
timeout: 30000,
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"Accept": "text/html,application/xhtml+xml",
"Accept-Language": "en-US,en;q=0.9",
"Referer": "https://example.com/login",
},
// Axios proxy config
proxy: {
protocol: "http",
host: "proxy.example.net",
port: 8000,
auth: {
username: "username",
password: "password",
},
},
maxRedirects: 0, // match curl without -L
});
async function main() {
const response = await agent.get("/account", {
headers: {
Cookie: "sessionid=abc123",
},
});
console.log(response.status, response.data.slice(0, 500));
}
main().catch(console.error);
Important Axios proxy details:
proxy config builds a CONNECT tunnel for HTTPS targets.auth inside proxy is for proxy authentication.auth option is for HTTP Basic to the origin server, not for bearer tokens. Use Authorization: 'Bearer ...' in headers for tokens.For longer-running AI agents, you may prefer native fetch with Undici’s agents:
import { ProxyAgent, fetch } from "undici";
const proxyUrl = "http://username:password@proxy.example.net:8000";
const proxyAgent = new ProxyAgent(proxyUrl);
async function main() {
const response = await fetch("https://example.com/account", {
dispatcher: proxyAgent,
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"Accept": "text/html,application/xhtml+xml",
"Accept-Language": "en-US,en;q=0.9",
"Referer": "https://example.com/login",
"Cookie": "sessionid=abc123",
},
});
console.log(response.status);
const text = await response.text();
console.log(text.slice(0, 500));
}
main().catch(console.error);
For SOCKS5 proxies, Undici also exposes SocksProxyAgent / Socks5ProxyAgent which support username/password auth and delegate DNS resolution to the proxy.
Common failure
HTTP_PROXY / HTTPS_PROXY environment variables and assuming your Node client respects them. Axios documents env var handling and NO_PROXY, but not all clients do; always verify proxy routing explicitly.PHP’s cURL extension is built directly on libcurl, so it maps closely to curl flags. You configure it via curl_setopt calls.
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://example.com/account',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '', // allow gzip/deflate
CURLOPT_MAXREDIRS => 0, // match curl without -L
CURLOPT_TIMEOUT => 30,
// Proxy settings
CURLOPT_PROXY => 'http://proxy.example.net:8000',
CURLOPT_PROXYUSERPWD => 'username:password',
// Headers
CURLOPT_HTTPHEADER => [
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)',
'Accept: text/html,application/xhtml+xml',
'Accept-Language: en-US,en;q=0.9',
'Referer: https://example.com/login',
'Cookie: sessionid=abc123',
],
]);
$response = curl_exec($ch);
if ($response === false) {
$error = curl_error($ch);
$errno = curl_errno($ch);
curl_close($ch);
die("cURL error $errno: $error\n");
}
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "Status: $httpCode\n";
print substr($response, 0, 500);
Key options:
CURLOPT_PROXY: proxy URL; supports HTTP, HTTPS, SOCKS5, etc.CURLOPT_PROXYUSERPWD: username:password for proxy authentication.CURLOPT_HTTPHEADER: explicit headers.CURLOPT_ENCODING: empty string means “any encoding”; allows gzip.Common failure
CURLOPT_RETURNTRANSFER. Without it, curl_exec prints the output directly instead of returning it, which makes debugging and structured scraping harder.Once you have code in Python, Node, or PHP, you must confirm that everything behaves like your original cURL run.
Use a simple “what is my IP” endpoint that you are allowed to hit, ideally from the same country as your residential IP.
Change your URL temporarily to something like:
https://api.ipify.org?format=json
Run your Python / Node / PHP script and confirm that:
On a test endpoint you control, log the incoming request:
User-Agent, Accept, Referer, and custom headersCookie header or any session behaviorIf you don’t control an endpoint, you can temporarily:
Remember:
Align behavior explicitly:
allow_redirects=False to match cURL without -LmaxRedirects: 0 to disable redirectsCURLOPT_FOLLOWLOCATION if you want redirectsCommon failure
Once your converted code works, you can connect it to a production residential proxy or mobile proxy service.
For authenticated workflows (logins, AI agents, e‑commerce), you typically want:
A provider like ProxyLane offers:
To try your converted code with real residential IPs, you can point your proxy settings at a gateway from a provider such as proxylane.dev and keep the rest of your code unchanged.
Common failure
Common causes:
-x flag or you removed it before conversionauth instead of proxy.auth)NO_PROXY environment variable to bypass the proxy for certain hostsFix:
proxies, Axios proxy, Undici ProxyAgent, PHP CURLOPT_PROXY)Because runtimes have different defaults:
-LmaxRedirects)Fix:
allow_redirects=FalsemaxRedirects: 0CURLOPT_FOLLOWLOCATION true/falseLikely issues:
User-Agent or Referer were dropped by the converterrequests.Session, Axios instance, or cookie jar)Fix:
Cookie and critical headersSession, Axios instance, PHP cookie jar if needed)In cURL:
curl 'https://example.com' \
-x 'socks5h://username:password@socks-proxy.example.net:1080'
In Python:
requests[socks] and socks5h:// in the proxy URLproxies = {
"http": "socks5h://username:password@socks-proxy.example.net:1080",
"https": "socks5h://username:password@socks-proxy.example.net:1080",
}
In Node:
SocksProxyAgent or community packages like socks-proxy-agentTreat any cURL containing Cookie:, Authorization:, or other secrets as sensitive:
Best practice:
With these steps, you have a repeatable process to convert a proxy-enabled cURL command into robust Python, Node, or PHP code that preserves your residential proxy settings, authentication, and headers for production-grade scraping and AI agent workflows.
Scale your workflows with the tools you already use. Rotating or sticky sessions up to 72 hours.
Compare seller APIs, licensed Amazon product data and proxy page checks by record, access scope and reuse rights.
Read guideChoose the right anti-detect browser proxy guide, map the shared verification steps, and keep account access separate from the network route.
Read guidePython BeautifulSoup scraping still starts with requests + bs4, but durable, logged‑in workflows now live or die on the proxy layer. This guide shows how to…
Read guide