-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathamazon.php
More file actions
29 lines (24 loc) · 699 Bytes
/
amazon.php
File metadata and controls
29 lines (24 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
$url = "https://scraper-api.decodo.com/v2/scrape";
$payload = json_encode([
"target" => "amazon",
"url" => "https://www.amazon.com/dp/B08JD3Z1BP/",
"parse" => true,
]);
$headers = [
"Accept: application/json",
"Content-Type: application/json",
"Authorization: Basic [your basic authentication token]"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
echo $response;
?>