Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
sakanamk authored May 29, 2024
1 parent c0ad778 commit dff42b6
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 0 deletions.
31 changes: 31 additions & 0 deletions php/amazon_bestsellers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
$url = "https://scraper-api.smartproxy.com/v2/scrape";

$payload = json_encode([
"target" => "amazon_bestsellers",
"query" => "sports-collectibles",
"page_from" => "1",
"num_pages" => "10",
"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;
?>
30 changes: 30 additions & 0 deletions php/amazon_pricing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
$url = "https://scraper-api.smartproxy.com/v2/scrape";

$payload = json_encode([
"target" => "amazon_pricing",
"query" => "B09H74FXNW",
"page_from" => "1",
"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;
?>
30 changes: 30 additions & 0 deletions php/amazon_product.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
$url = "https://scraper-api.smartproxy.com/v2/scrape";

$payload = json_encode([
"target" => "amazon_product",
"query" => "B09H74FXNW",
"parse" => true,
"autoselect_variant": false
]);

$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;
?>
29 changes: 29 additions & 0 deletions php/amazon_questions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
$url = "https://scraper-api.smartproxy.com/v2/scrape";

$payload = json_encode([
"target" => "amazon_questions",
"query" => "B09H74FXNW",
"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;
?>
30 changes: 30 additions & 0 deletions php/amazon_reviews.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
$url = "https://scraper-api.smartproxy.com/v2/scrape";

$payload = json_encode([
"target" => "amazon_reviews",
"query" => "B09H74FXNW",
"page_from" => "1",
"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;
?>
30 changes: 30 additions & 0 deletions php/amazon_search.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
$url = "https://scraper-api.smartproxy.com/v2/scrape";

$payload = json_encode([
"target" => "amazon_search",
"query" => "laptop",
"page_from" => "1",
"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;
?>

0 comments on commit dff42b6

Please sign in to comment.