eCommerce
Retrieve results from any eCommerce website by supplying a full URL of the website to the url parameter. In this case, additional parameters can be specified in the URL itself.
Parseable: mostly yes (Using AI parser)
Required parameters: url
Optional parameters: device_type, geo, headless, session_id, successful_status_codes, http_method, payload, headers, cookies
curl -u SPusername:SPpassword -X POST --url https://scraper-api.smartproxy.com/v2/scrape -H "Content-Type: application/json" -d "{\"target\": \"ecommerce\", \"url\": \"https://www.walmart.com/browse/electronics/tax-prep-tech/3944_4459033?povid=GlobalNav_rWeb_Electronics_TaxPrep_TaxPrepTech\", \"headless\": \"html\", \"http_method\": \"get\"}"
import requests
task_params = {
'target': 'ecommerce',
'url': 'https://www.walmart.com/browse/electronics/tax-prep-tech/3944_4459033?povid=GlobalNav_rWeb_Electronics_TaxPrep_TaxPrepTech',
'headless': 'html',
'http_method': 'get'
}
username = 'SPusername'
password = 'SPpassword'
response = requests.post(
'https://scraper-api.smartproxy.com/v2/scrape',
json = task_params,
auth = (username, password)
)
print(response.text)
<?php
$params = array(
'target' => 'ecommerce',
'url' => 'https://www.walmart.com/browse/electronics/tax-prep-tech/3944_4459033?povid=GlobalNav_rWeb_Electronics_TaxPrep_TaxPrepTech',
'headless' => 'html',
'http_method' => 'get'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://scraper-api.smartproxy.com/v2/scrape');
curl_setopt($ch, CURLOPT_USERPWD, 'SPusername' . ':' . 'SPpassword');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>
Note that to get a result with the AI parser, you will need to set the
parse
parameter as'true'
andparser_type
parameter asecommerce_product
.
Updated about 1 month ago