Walmart Product API (Async)
This endpoint will retrieve information about a Walmart product.
Single query request:
<?php
$curl = curl_init();
$data = json_encode(array(
'apiKey' => 'APIKEY',
'productId' => 'PRODUCTID',
'output_format' => 'FORMAT',
'tld' => 'TLD',
'callback' => array(
'type' => 'webhook',
'url' => 'CALLBACK'
)
));
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://async.scraperapi.com/structured/walmart/product',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Error:' . curl_error($curl);
} else {
echo $response;
}
curl_close($curl);
?>
Multiple Query Request:
<?php
$curl = curl_init();
$data = json_encode(array(
'apiKey' => 'APIKEY',
'productIds' => array('PRODUCTID1', 'PRODUCTID2'),
'output_format' => 'FORMAT',
'tld' => 'TLD',
'callback' => array(
'type' => 'webhook',
'url' => 'CALLBACK'
)
));
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://async.scraperapi.com/structured/walmart/product',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Error:' . curl_error($curl);
} else {
echo $response;
}
curl_close($curl);
?>
Sample Response
For single query requests:
{
"id": "ee3aaa48-e630-487f-b6cb-ad85c7e2d4bd",
"status": "running",
"statusUrl": "https://async.scraperapi.com/jobs/ee3aaa48-e630-487f-b6cb-ad85c7e2d4bd",
"product_id": "65EDSZVED3NS",
}
For multiple query requests:
[
{
"id": "1cbf118f-54c8-41ae-94d4-b63cd1636000",
"status": "running",
"statusUrl": "https://async.scraperapi.com/jobs/1cbf118f-54c8-41ae-94d4-b63cd1636000",
"product_id": "65EDSZVED3NS"
},
{
"id": "9b346892-e9ad-4b19-a9e3-1e1364d12e9d",
"status": "running",
"statusUrl": "https://async.scraperapi.com/jobs/9b346892-e9ad-4b19-a9e3-1e1364d12e9d",
"product_id": "41FV2JGSJPXI"
}
]
After the job(s) finish, you will find the result under the response key in the response JSON object. The structure is the same as in the corresponding SYNC data endpoint.
Last updated