From 597e48a04abdb505d4720effcf839be59c75a857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDilvinas?= <159907476+ZilvinasSP@users.noreply.github.com> Date: Wed, 29 May 2024 14:33:20 +0300 Subject: [PATCH] Add files via upload --- nodejs/amazon_pricing.js | 25 +++++++++++++++++++++++++ nodejs/amazon_product.js | 25 +++++++++++++++++++++++++ nodejs/amazon_questions.js | 24 ++++++++++++++++++++++++ nodejs/amazon_reviews.js | 25 +++++++++++++++++++++++++ nodejs/amazon_search.js | 4 ++-- 5 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 nodejs/amazon_pricing.js create mode 100644 nodejs/amazon_product.js create mode 100644 nodejs/amazon_questions.js create mode 100644 nodejs/amazon_reviews.js diff --git a/nodejs/amazon_pricing.js b/nodejs/amazon_pricing.js new file mode 100644 index 0000000..f35c80e --- /dev/null +++ b/nodejs/amazon_pricing.js @@ -0,0 +1,25 @@ +async function fetchAmazonData() { + try { + const response = await fetch("https://scraper-api.smartproxy.com/v2/scrape", { + method: "POST", + body: JSON.stringify({ + "target": "amazon_product", + "query": "B09H74FXNW", + "parse": true, + "autoselect_variant": false + }), + headers: { + "Content-Type": "application/json", + "Authorization": "Basic [your basic authentication token]" + } + }); + + const data = await response.json(); + console.log(JSON.stringify(data)); + + } catch (error) { + console.log(error); + } +} + +fetchAmazonData(); \ No newline at end of file diff --git a/nodejs/amazon_product.js b/nodejs/amazon_product.js new file mode 100644 index 0000000..dd77664 --- /dev/null +++ b/nodejs/amazon_product.js @@ -0,0 +1,25 @@ +async function fetchAmazonData() { + try { + const response = await fetch("https://scraper-api.smartproxy.com/v2/scrape", { + method: "POST", + body: JSON.stringify({ + "target": "amazon_product", + "query": "B09H74FXNW", + "parse": true, + "autoselect_variant": false + }), + headers: { + "Content-Type": "application/json", + "Authorization": "Basic VTAwMDAxNjgwOTM6UFcxMDFkNDc0MjM5MTY2NGVhZDJkMTJiYjBjNTAwZjI3MzI=" + } + }); + + const data = await response.json(); + console.log(JSON.stringify(data)); + + } catch (error) { + console.log(error); + } +} + +fetchAmazonData(); \ No newline at end of file diff --git a/nodejs/amazon_questions.js b/nodejs/amazon_questions.js new file mode 100644 index 0000000..1730708 --- /dev/null +++ b/nodejs/amazon_questions.js @@ -0,0 +1,24 @@ +async function fetchAmazonData() { + try { + const response = await fetch("https://scraper-api.smartproxy.com/v2/scrape", { + method: "POST", + body: JSON.stringify({ + "target": "amazon_questions", + "query": "B09H74FXNW", + "parse": true + }), + headers: { + "Content-Type": "application/json", + "Authorization": "Basic [your basic authentication token]" + } + }); + + const data = await response.json(); + console.log(JSON.stringify(data)); + + } catch (error) { + console.log(error); + } +} + +fetchAmazonData(); \ No newline at end of file diff --git a/nodejs/amazon_reviews.js b/nodejs/amazon_reviews.js new file mode 100644 index 0000000..1855738 --- /dev/null +++ b/nodejs/amazon_reviews.js @@ -0,0 +1,25 @@ +async function fetchAmazonData() { + try { + const response = await fetch("https://scraper-api.smartproxy.com/v2/scrape", { + method: "POST", + body: JSON.stringify({ + "target": "amazon_reviews", + "query": "B09H74FXNW", + "page_from": "1", + "parse": true + }), + headers: { + "Content-Type": "application/json", + "Authorization": "Basic [your basic authentication token]" + } + }); + + const data = await response.json(); + console.log(JSON.stringify(data)); + + } catch (error) { + console.log(error); + } +} + +fetchAmazonData(); \ No newline at end of file diff --git a/nodejs/amazon_search.js b/nodejs/amazon_search.js index d369a73..388a9cf 100644 --- a/nodejs/amazon_search.js +++ b/nodejs/amazon_search.js @@ -10,7 +10,7 @@ async function fetchAmazonData() { }), headers: { "Content-Type": "application/json", - "Authorization": "Basic [your basic authentication token]" + "Authorization": "Basic VTAwMDAxNjgwOTM6UFcxMDFkNDc0MjM5MTY2NGVhZDJkMTJiYjBjNTAwZjI3MzI=" } }); @@ -22,4 +22,4 @@ async function fetchAmazonData() { } } -fetchAmazonData(); +fetchAmazonData(); \ No newline at end of file