Shop::Amazon: Amazon product parser
Shop::Amazon product parser overview
Using the Amazon product parser, you can get all the data from the product card, collect a database of links to products, track the dynamics of prices and delivery, collect the rating and number of reviews for the product, collect product images, and get a list of stores.
A-Parser functionality allows you to save parsing settings for further use (presets), set a parsing schedule, and much more. You can use automatic query multiplication, substitution of subqueries from files, enumeration of alphanumeric combinations and lists to get the maximum possible number of results.
Collected data
- Product name
- Link to product
- Product image
- Price and discounted price
- Rating, number of comments
- Number of sellers
- Seller
- Additional information (Bestseller, Sponsored)
Use cases
- Collecting links to products
- Evaluating product popularity
- Tracking price dynamics
Query examples
As queries, you need to specify the names of the products, just as if you were entering them directly into the Amazon search form, for example:
iphone 11pro max
Беспроводная Bluetooth-мышь, домашняя игровая мышь
Карта памяти Micro Sd Sandisk, карта Micro Sd Class10 TF
AMD Ryzen R3 2200U
Query substitutions
You can use built-in macros to multiply queries, for example, we want to get a very large database of products by brands,
philips
sony
xiaomi
samsung
In the query format, we will specify the enumeration of characters from a to zzzz, this method allows you to rotate the search results as much as possible and get many new unique results:
$query {az:a:zzzz}
This macro will create 475254
additional queries for each original search query, which in total will give 4 x 475254 = 1901016
search queries, an impressive number, but this is not a problem for A-Parser.
Result output options
Output to csv
You can use the Template-Toolkit template engine to output the result to csv, for example, we will write to a csv file such columns: Link to product, Product name, Price, Old price, Rating, Number of comments
Result format:
[% FOREACH item IN products;
tools.CSVline(item.link, item.title, item.price, item.oldprice, item.rating, item.commentscount );
END; %]
Example of the result:
https://www.amazon.com/Oculus-Quest-Advanced-All-One-2/dp/B08F7PTF54/ref=sr_1_5?dchild=1&keywords=playstation+5&qid=1611928056&sr=8-5,"Oculus Quest 2 — Advanced All-In-One Virtual Reality Headset — 256 GB",399.00,,"19,203
https://www.amazon.com/DualSense-Wireless-Controller-PlayStation-5/dp/B08FC6C75Y/ref=sr_1_6?dchild=1&keywords=playstation+5&qid=1611928056&sr=8-6,"DualSense Wireless Controller",69.93,,"11,451
https://www.amazon.com/Resident-Evil-Village-Deluxe-PlayStation-5/dp/B08TR5R8S4/ref=sr_1_7?dchild=1&keywords=playstation+5&qid=1611928056&sr=8-7,"Resident Evil Village Deluxe Edition - PlayStation 5 Deluxe Edition",69.99,,
https://www.amazon.com/Demons-Souls-PlayStation-5/dp/B08FC5TTBF/ref=sr_1_8?dchild=1&keywords=playstation+5&qid=1611928056&sr=8-8,"Demon’s Souls – PlayStation 5",69.89,,"1,963
https://www.amazon.com/gp/slredirect/picassoRedirect.html/ref=pa_sp_mtf_aps_sr_pg1_1?ie=UTF8&adId=A0678777UQU133BE10NC&url=%2FController-Charging-Playstation-Indicator-Game-Boy%2Fdp%2FB08QNJNXNF%2Fref%3Dsr_1_9_sspa%3Fdchild%3D1%26keywords%3Dplaystation%2B5%26qid%3D1611928056%26sr%3D8-9-spons%26psc%3D1&qualifier=1611928056&id=1074325077257761&widgetName=sp_mtf,"PS5 Controller Charger, Charging Dock for Playstation 5 / PS5/ Controller, OIVO PS5 Controller Charging Dock Station with 2 USB-C Adapter with LED Indicator",17.99,,2
https://www.amazon.com/gp/slredirect/picassoRedirect.html/ref=pa_sp_mtf_aps_sr_pg1_1?ie=UTF8&adId=A056102415216X4GXFBHL&url=%2FController-DualSense-Orgaization-Accessories-playstation-5%2Fdp%2FB08R8DVJ8K%2Fref%3Dsr_1_10_sspa%3Fdchild%3D1%26keywords%3Dplaystation%2B5%26qid%3D1611928056%26sr%3D8-10-spons%26psc%3D1&qualifier=1611928056&id=1074325077257761&widgetName=sp_mtf,"PS5 Controller Charger Station,Double Charging Dock for DualSense Wireless Controller with Type-C USB Cable Play Station 5 Consle Orgaization Accessories Station",17.39,,
https://www.amazon.com/Persona-5-Strikers-PlayStation-4/dp/B08Q6YYLN5/ref=sr_1_11?dchild=1&keywords=playstation+5&qid=1611928056&sr=8-11,"Persona 5 Strikers - PlayStation 4",59.99,,
https://www.amazon.com/Marvels-Spider-Man-Morales-Ultimate-Launch-PlayStation/dp/B08FC66ZV4/ref=sr_1_12?dchild=1&keywords=playstation+5&qid=1611928056&sr=8-12,"Marvel's Spider-Man: Miles Morales Ultimate Launch Edition – PlayStation 5",69.97,,"3,468
https://www.amazon.com/PlayStation-5-DualSense-Wireless-Controller/dp/B08H99BPJN/ref=sr_1_13?dchild=1&keywords=playstation+5&qid=1611928056&sr=8-13,"PlayStation 5 DualSense Wireless Controller",79.95,,"9,685
https://www.amazon.com/Sackboy-Big-Adventure-PlayStation-5/dp/B08FC64CNF/ref=sr_1_14?dchild=1&keywords=playstation+5&qid=1611928056&sr=8-14,"Sackboy: A Big Adventure – PlayStation 5",,,911
Output of name, price, and currency
Result format:
$products.format('$title, $price, $oldprice, $currency\n');
Example of the result:
Vertical Stand with Dual Cooling Fans for Sony PS5 Digital Edition & PS5 UHD with 2 DualSense PS5 Controller Chargers and 3 USB Ports for Sony Playstation 5 DE & UHD Edition, 39.99, $46.99, $
Marvel's Spider-Man: Miles Morales Ultimate Launch Edition – PlayStation 5, 69.99, , $
Ps5 skin protective wrap customizable cover vinyl sticker decals for sony playstation 5 disk version console and two dual sense 5 sticker skins cyber net yellow black blue, 21.99, , $
Werewolf: The Apocalypse - Earthblood (PS5) - PlayStation 5, 49.99, , $
Sackboy: A Big Adventure – PlayStation 5, 59.99, , $
Charger Stand for PS5 DualSense Controller, MENEEA Controller Type-C Fast Dual Charging Station Dock with LED Indicator for Sony Playstation 5 with Dual Detachable USB C Ports, 14.99, $17.99, $
HEYSTOP PS5 Controller Charger, PS5 Wireless Charger DualSense Fast Charging Station Compatible with Sony Playstation 5 Controller, 15.99, , $
Marvel’s Spider-Man: Miles Morales Launch Edition – PlayStation 5, 49.44, , $
CYTXSWARDWELL PS5 Controller Charger, Dual USB PS5 Controller Charging Station, for Playstation 5 Console DualSense PS5 Controllers. (Pearl White), 18.99, , $
Seltureone Compatible for Playstation 5 Media Remote Cover, Silicone Protective Case Sleeve for PS5 Remote Control, Shock Absorption Washable, White, 9.95, , $
PS5 Controller Cover Case, Anti-Slip Silicone Skin Protective Cover Case for Playstation 5 DualSense Wireless Controller with 8 Thumb Grip Caps(Comics Dynamic), 11.99, , $
Output with variable names
Result format:
$products.format('Название: $title, Цена: $price, Валюта: $currency\n');
Example of the result:
Название: Resident Evil Village Deluxe Edition - PlayStation 5 Deluxe Edition, Цена: 69.99, Валюта: $
Название: DualSense Wireless Controller, Цена: 69.98, Валюта: $
Название: Persona 5 Strikers - PlayStation 4, Цена: 59.99, Валюта: $
Название: Assassin’s Creed Valhalla PlayStation 5 Standard Edition, Цена: 34.99, Валюта: $
Название: Demon’s Souls – PlayStation 5, Цена: 69.99, Валюта: $
Название: NexiGo Dobe PS5 Controller Charger, Upgraded Playstation 5 Charging Station Dock with LED Indicator, Safety Chip Protection, Dual USB Type C Fast Charging, for Sony DualSense Controller, White, Цена: 19.99, Валюта: $
Название: PS5 Controller Charger, Charging Dock for Playstation 5 / PS5/ Controller, OIVO PS5 Controller Charging Dock Station with 2 USB-C Adapter with LED Indicator, Цена: 17.99, Валюта: $
Название: PlayStation 5 DualSense Wireless Controller, Цена: 79.95, Валюта: $
Output with a new variable
Let's output the result with the total_price variable, which is equal to the sum of the product + delivery cost, the delivery cost is conditional (50$)
Result format:
[% FOREACH item IN p1.products;
total_price = item.price + 50;
tools.CSVline(item.title, item.price, total_price );
END; %]
Example of the result:
Charger Stand for PS5 DualSense Controller, MENEEA Controller Type-C Fast Dual Charging Station Dock with LED Indicator for Sony Playstation 5 with Dual Detachable USB C Ports",14.99,64.99
"Marvel's Spider-Man: Miles Morales Ultimate Launch Edition – PlayStation 5",69.99,119.99
"PlayStation 5 DualSense Wireless Controller",79.95,129.95
"HEYSTOP PS5 Controller Charger, PS5 Wireless Charger DualSense Fast Charging Station Compatible with Sony Playstation 5 Controller",15.99,65.99
"PS5 Controller Charger, Charging Dock for Playstation 5 / PS5/ Controller, OIVO PS5 Controller Charging Dock Station with 2 USB-C Adapter with LED Indicator",17.99,67.99
"PS5 Controller Cover Case, Anti-Slip Silicone Skin Protective Cover Case for Playstation 5 DualSense Wireless Controller with 8 Thumb Grip Caps(Comics Dynamic)",11.99,61.99
"PomisGam Vertical Stand for Playstation 5 with Cooling Fan Charing Station for PS5 Digital Edition/PS5 Ultra HD,Multi-Function Charger Station with 2 Controller Charging Docks",35.99,85.99
"Vertical Stand with Dual Cooling Fans for Sony PS5 Digital Edition & PS5 UHD with 2 DualSense PS5 Controller Chargers and 3 USB Ports for Sony Playstation 5 DE & UHD Edition",39.99,89.99
"Persona 5 Strikers - PlayStation 4",59.99,109.99
"FYOUNG Controller Charging Station for PS5, Charging Dock Compatible for Playstation 5 DualSense Wireless Controller with LED Light Indicators and USB C Cable",16.99,66.99
"PlayStation 5 Console",,50
"Resident Evil Village - PlayStation 5 Standard Edition",59.99,109.99
Saving in SQL format
Result format:
[% FOREACH item IN p1.products; "INSERT INTO products VALUES('" _ item.title _ "', '"; item.link _ "', '"; item.price _ "', '"; item.currency _ "')\n"; END %]
Example of the result:
INSERT INTO products VALUES('Resident Evil Village Deluxe Edition - PlayStation 5 Deluxe Edition', 'https://www.amazon.com/Resident-Evil-Village-Deluxe-PlayStation-5/dp/B08TR5R8S4/ref=sr_1_1?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-1', '69.99', '$')
INSERT INTO products VALUES('DualSense Wireless Controller', 'https://www.amazon.com/DualSense-Wireless-Controller-PlayStation-5/dp/B08FC6C75Y/ref=sr_1_2?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-2', '69.98', '$')
INSERT INTO products VALUES('Assassin’s Creed Valhalla PlayStation 5 Standard Edition', 'https://www.amazon.com/Assassins-Creed-Valhalla-PlayStation-5-Standard/dp/B08FS5HKTR/ref=sr_1_3?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-3', '34.99', '$')
INSERT INTO products VALUES('Demon’s Souls – PlayStation 5', 'https://www.amazon.com/Demons-Souls-PlayStation-5/dp/B08FC5TTBF/ref=sr_1_4?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-4', '68.95', '$')
INSERT INTO products VALUES('Charger Stand for PS5 DualSense Controller, MENEEA Controller Type-C Fast Dual Charging Station Dock with LED Indicator for Sony Playstation 5 with Dual Detachable USB C Ports', 'https://www.amazon.com/DualSense-Controller-MENEEA-Playstation-Detachable/dp/B08L7N3MF1/ref=sr_1_5?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-5', '14.99', '$')
INSERT INTO products VALUES('Marvel's Spider-Man: Miles Morales Ultimate Launch Edition – PlayStation 5', 'https://www.amazon.com/Marvels-Spider-Man-Morales-Ultimate-Launch-PlayStation/dp/B08FC66ZV4/ref=sr_1_6?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-6', '69.99', '$')
INSERT INTO products VALUES('PlayStation 5 DualSense Wireless Controller', 'https://www.amazon.com/PlayStation-5-DualSense-Wireless-Controller/dp/B08H99BPJN/ref=sr_1_7?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-7', '79.95', '$')
INSERT INTO products VALUES('Vertical Stand with Dual Cooling Fans for Sony PS5 Digital Edition & PS5 UHD with 2 DualSense PS5 Controller Chargers and 3 USB Ports for Sony Playstation 5 DE & UHD Edition', 'https://www.amazon.com/Vertical-DualSense-Controller-Chargers-Playstation-5/dp/B08NL49YJ3/ref=sr_1_8?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-8', '39.99', '$')
INSERT INTO products VALUES('PomisGam Vertical Stand for Playstation 5 with Cooling Fan Charing Station for PS5 Digital Edition/PS5 Ultra HD,Multi-Function Charger Station with 2 Controller Charging Docks', 'https://www.amazon.com/PomisGam-Vertical-Playstation-Multi-Function-Controller/dp/B08PNZXGMY/ref=sr_1_11?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-11', '35.99', '$')
INSERT INTO products VALUES('Persona 5 Strikers - PlayStation 4', 'https://www.amazon.com/Persona-5-Strikers-PlayStation-4/dp/B08Q6YYLN5/ref=sr_1_12?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-12', '59.99', '$')
INSERT INTO products VALUES('HEYSTOP PS5 Controller Charger, PS5 Wireless Charger DualSense Fast Charging Station Compatible with Sony Playstation 5 Controller', 'https://www.amazon.com/HEYSTOP-Controller-DualSense-Compatible-Playstation/dp/B08R3K1977/ref=sr_1_13?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-13', '15.99', '$')
INSERT INTO products VALUES('PlayStation 5 Console', 'https://www.amazon.com/PlayStation-5-Console/dp/B08FC5L3RG/ref=sr_1_14?dchild=1&keywords=playstation+5&qid=1611934195&sr=8-14', '', '')
Dumping results to JSON
Result format:
[% data = {}; data.items = []; FOREACH i IN p1.products; item = {}; item.link = i.link; item.name = i.title; item.price = i.price; data.items.push(item); END; result = {}; result = data; result.json; %]
{
"items": [
{
"link": "https://www.amazon.com/Controller-Protector-Playstation-Anti-Slip-Christmas/dp/B08CVRCFK3/ref=sr_1_18?dchild=1&keywords=playstation+5&qid=1611933831&sr=8-18",
"name": "2 Pack PS5 Controller Skin Covers Xmas Gifts for Men Women Hubby Wife Friends Grip Protector with 16 pcs Thumb Grip Caps for Sony Playstation 5 Anti-Slip Silicone",
"price": "10.90"
},
{
"link": "https://www.amazon.com/Controller-Protector-Playstation-Anti-Slip-Christmas/dp/B08CVRCFK3/ref=sr_1_18?dchild=1&keywords=playstation+5&qid=1611933831&sr=8-18",
"name": "2 Pack PS5 Controller Skin Covers Xmas Gifts for Men Women Hubby Wife Friends Grip Protector with 16 pcs Thumb Grip Caps for Sony Playstation 5 Anti-Slip Silicone",
"price": "10.90"
},
{
"link": "https://www.amazon.com/Controller-Protector-Playstation-Anti-Slip-Christmas/dp/B08CVRCFK3/ref=sr_1_18?dchild=1&keywords=playstation+5&qid=1611933831&sr=8-18",
"name": "2 Pack PS5 Controller Skin Covers Xmas Gifts for Men Women Hubby Wife Friends Grip Protector with 16 pcs Thumb Grip Caps for Sony Playstation 5 Anti-Slip Silicone",
"price": "10.90"
},
{
"link": "https://www.amazon.com/Controller-Protector-Playstation-Anti-Slip-Christmas/dp/B08CVRCFK3/ref=sr_1_18?dchild=1&keywords=playstation+5&qid=1611933831&sr=8-18",
"name": "2 Pack PS5 Controller Skin Covers Xmas Gifts for Men Women Hubby Wife Friends Grip Protector with 16 pcs Thumb Grip Caps for Sony Playstation 5 Anti-Slip Silicone",
"price": "10.90"
},
{
"link": "https://www.amazon.com/Controller-Protector-Playstation-Anti-Slip-Christmas/dp/B08CVRCFK3/ref=sr_1_18?dchild=1&keywords=playstation+5&qid=1611933831&sr=8-18",
"name": "2 Pack PS5 Controller Skin Covers Xmas Gifts for Men Women Hubby Wife Friends Grip Protector with 16 pcs Thumb Grip Caps for Sony Playstation 5 Anti-Slip Silicone",
"price": "10.90"
}
]
}
Output of the result with the parsing date
Let's output the result with the total_price variable, which is equal to the sum of the product + maximum delivery cost
Result format:
[% USE date;
d = date.format(mytime, format = "%Y %d %H:%M");
FOREACH item IN p1.products;
total_price = item.price + 50;
tools.CSVline(d, item.title, item.price, item.link, total_price );
END; %]
Example of the result:
"2021 29 18:31","PlayStation 5 Console",,https://www.amazon.com/PlayStation-5-Console/dp/B08FC5L3RG/ref=sr_1_1?dchild=1&keywords=playstation+5&qid=1611934312&sr=8-1,50
"2021 29 18:31","PlayStation 4 Console - 1TB Slim Edition",384.99,https://www.amazon.com/PlayStation-4-Console-1TB-Slim/dp/B074LRF639/ref=sr_1_2?dchild=1&keywords=playstation+5&qid=1611934312&sr=8-2,434.99
"2021 29 18:31","PlayStation VR Marvel's Iron Man VR Bundle",349.99,https://www.amazon.com/PlayStation-Marvels-Iron-Man-Bundle-4/dp/B08NRGF2DL/ref=sr_1_3?dchild=1&keywords=playstation+5&qid=1611934312&sr=8-3,399.99
"2021 29 18:31","Turtle Beach Stealth 600 White Gen 2 Wireless Gaming Headset for PlayStation 5 and PlayStation 4",99.95,https://www.amazon.com/Stealth-Wireless-Gaming-Headset-PlayStation-Console/dp/B08D44WZTS/ref=sr_1_4?dchild=1&keywords=playstation+5&qid=1611934312&sr=8-4,149.95
"2021 29 18:31","$100 PlayStation Store Gift Card [Digital Code]",100.00,https://www.amazon.com/PlayStation-Store-Gift-Card-Digital/dp/B00K59HKIQ/ref=sr_1_5?dchild=1&keywords=playstation+5&qid=1611934312&sr=8-5,150
"2021 29 18:31","Oculus Quest 2 — Advanced All-In-One Virtual Reality Headset — 256 GB",399.00,https://www.amazon.com/Oculus-Quest-Advanced-All-One-2/dp/B08F7PTF54/ref=sr_1_6?dchild=1&keywords=playstation+5&qid=1611934312&sr=8-6,449
"2021 29 18:31","DualSense Wireless Controller",69.98,https://www.amazon.com/DualSense-Wireless-Controller-PlayStation-5/dp/B08FC6C75Y/ref=sr_1_7?dchild=1&keywords=playstation+5&qid=1611934312&sr=8-7,119.98
"2021 29 18:31","Resident Evil Village Deluxe Edition - PlayStation 5 Deluxe Edition",69.99,https://www.amazon.com/Resident-Evil-Village-Deluxe-PlayStation-5/dp/B08TR5R8S4/ref=sr_1_8?dchild=1&keywords=playstation+5&qid=1611934312&sr=8-8,119.99
"2021 29 18:31","Demon’s Souls – PlayStation 5",68.95,https://www.amazon.com/Demons-Souls-PlayStation-5/dp/B08FC5TTBF/ref=sr_1_10?dchild=1&keywords=playstation+5&qid=1611934312&sr=8-10,118.95
"2021 29 18:31","Marvel's Spider-Man: Miles Morales Ultimate Launch Edition – PlayStation 5",69.99,https://www.amazon.com/Marvels-Spider-Man-Morales-Ultimate-Launch-PlayStation/dp/B08FC66ZV4/ref=sr_1_11?dchild=1&keywords=playstation+5&qid=1611934312&sr=8-11,119.99
"2021 29 18:31","Persona 5 Strikers - PlayStation 4",59.99,https://www.amazon.com/Persona-5-Strikers-PlayStation-4/dp/B08Q6YYLN5/ref=sr_1_12?dchild=1&keywords=playstation+5&qid=1611934312&sr=8-12,109.99
Possible settings
Parameter | Default value | Description |
---|---|---|
Pages count | 5 | Number of pages for parsing |
Amazon domain | United States | Amazon domains in different domain zones |
AntiGate preset | default | AntiGate preset for enabling captcha solving |