Giter Club home page Giter Club logo

amazon-product-api's Introduction

Amazon Product Api (Unofficial)

NPM npm

Very useful tool that is able to extract almost same amount of data as the official Amazon Product API

If you like this tool then please Star it


Buy Me A Coffee


Features

  • Extract product data from the search result(by category, by country)
  • Extract lots of single product data by using ASIN id
  • Extract product reviews data by using ASIN id
  • Extract list of categories
  • Is supporting all available Amazon Marketplaces
  • Sort result by sponsored products only
  • Sorts result by discounted products only
  • Result can be saved to the JSON/CSV files
  • You can scrape up to 500 products and 1000 reviews

Product List alt text Review List alt text

Note:

  • Empty parameter = empty value

Possible errors

  • If there will be let me know

Installation

Install from NPM

$ npm i -g amazon-buddy

Install from YARN

$ yarn global add amazon-buddy

USAGE

Terminal

$ amazon-buddy --help

Usage: amazon-buddy <command> [options]

Commands:
  amazon-buddy products      collect products by using keyword
  amazon-buddy reviews [id]  collect reviews from product by using ASIN id
  amazon-buddy asin [id]     single product details
  amazon-buddy categories    get list of categories
  amazon-buddy countries     get list of countries

Options:
  --help, -h      help                                                 [boolean]
  --version       Show version number                                  [boolean]
  --async, -a     Number of async tasks                  [string] [default: "5"]
  --keyword, -k   Amazon search keyword ex. 'Xbox one'    [string] [default: ""]
  --number, -n    Number of products to scrape. Maximum 100 products or 300
                  reviews                                 [number] [default: 20]
  --filetype      Type of the output file where the data will be saved. 'all' -
                  save data to the 'json' and 'csv' files
                            [choices: "csv", "json", "all", ""] [default: "csv"]
  --sort          If searching for the products then the list will be sorted by
                  the higher score(number of reviews*rating). If searching for
                  the reviews then they will be sorted by the rating.
                                                      [boolean] [default: false]
  --discount, -d  Scrape only products with the discount
                                                      [boolean] [default: false]
  --sponsored     Scrape only sponsored products      [boolean] [default: false]
  --min-rating    Minimum allowed rating                   [number] [default: 1]
  --max-rating    Maximum allowed rating                   [number] [default: 5]
  --country       In ISO 3166 (Alpha-2 code) format. To get available list of
                  countries type and use (index) from the shown table as value:
                  amazon-buddy countries                [string] [default: "US"]
  --category      To get available list of categories type and use (index) from
                  the shown table as value: amazon-buddy categories
                                                       [string] [default: "aps"]
  --random-ua     Randomize user agent version. This helps to prevent request
                  blocking from the amazon side       [boolean] [default: false]
  --user-agent    Set custom user-agent                   [string] [default: ""]
  --timeout, -t   Timeout between requests. Timeout is set in mls: 1000 mls = 1


Examples:
  amazon-buddy products -k 'Xbox one'
  amazon-buddy products -k 'Xbox one' --country 'GB'
  amazon-buddy reviews B01GW3H3U8
  amazon-buddy asin B01GW3H3U8
  amazon-buddy categories
  amazon-buddy countries

Example 1

Scrape 40 products from the amazon search result by using keyword "vacuum cleaner" and save result to the CSV file

$ amazon-buddy products -k 'vacuum cleaner' -n 40 --filetype csv

Output: 1552945544582_products.csv

Example 2

Scrape 40 products from the amazon search result by using keyword "vacuum cleaner" and display raw result in the terminal

$ amazon-buddy products -k 'vacuum cleaner' -n 40 --filetype ''

Example 3

Scrape 40 products from the amazon search result by using keyword "vacuum cleaner" from the Amazon.NL(Netherlands) and display raw result in the terminal

$ amazon-buddy products -k 'vacuum cleaner' -n 40 --filetype '' --country NL

Example 4

Scrape 40 products from the amazon search result from the category "Apps & Games" by using keyword "games" from the Amazon.ES(SPAIN) and display raw result in the terminal

$ amazon-buddy products -k 'games' -n 40 --filetype '' --country ES --category mobile-apps

Example 5

Scrape 100 reviews from a product by using ASIN. NOTE: ASIN is a unique amazon product ID, it can be found in product URL or if you have scraped product list with our tool you will find it in the CSV/JSON files

$ amazon-buddy reviews B01GW3H3U8 -n 100

Output: reviews(B01GW3H3U8)_1589470878252

Example 6

Scrape 300 products from the "Xbox one" keyword with rating minimum rating 3 and maximum rating 4 and save everything to the CSV file

$ amazon-buddy products -k 'xbox one' -n 300 --min-rating 3 --max-rating 4

Output: 1552945544582_products.csv

Example 7

Show list of all available countries

$ amazon-buddy countries

Output: alt text

Example 7

Show list of all available categories from the Amazon.CO.UK

$ amazon-buddy categories --country GB

Output: alt text

Module

Methods

.products() - product search
.reviews() - reviews search
.asin() - single product details
.categories() - available categories

Example

const amazonScraper = require('amazon-buddy');

(async () => {
    try {
        // Collect 50 products from a keyword 'xbox one'
        // Default country is US
        const products = await amazonScraper.products({ keyword: 'Xbox One', number: 50 });

        // Collect 50 products from a keyword 'xbox one' from Amazon.NL
        const products = await amazonScraper.products({ keyword: 'Xbox One', number: 50, country: 'NL' });

        // Collect 50 products from a keyword 'xbox one' from Amazon.CO.UK
        const products = await amazonScraper.products({ keyword: 'Xbox One', number: 50, country: 'GB' });

        // Collect products that are located on page number 2
        const reviews = await amazonScraper.products({ keyword: 'Xbox One', bulk: false, page: 2 });

        // Collect 50 products from a keyword 'xbox one' with rating between 3-5 stars
        const products_rank = await amazonScraper.products({ keyword: 'Xbox One', number: 50, rating: [3, 5] });

        // Collect 50 reviews from a product ID B01GW3H3U8
        const reviews = await amazonScraper.reviews({ asin: 'B01GW3H3U8', number: 50 });

        // Collect 50 reviews from a product ID B01GW3H3U8  with rating between 1-2 stars
        const reviews_rank = await amazonScraper.reviews({ asin: 'B01GW3H3U8', number: 50, rating: [1, 2] });

        // Get single product details by using ASIN id
        const product_by_asin = await amazonScraper.asin({ asin: 'B01GW3H3U8' });

        // Get categories from amazon.COM.AU
        const categories_AU = await amazonScraper.categories({ country: 'AU' });

        // Get categories from amazon.CN
        const categories_CN = await amazonScraper.categories({ country: 'CN' });
    } catch (error) {
        console.log(error);
    }
})();

.products() output

[{
    position: { page: 1, position: 1, global_position: 1 },
    asin: 'B07CSLG8ST',
    price: {
        discounted: false,
        current_price: 574,
        currency: 'USD',
        before_price: 0,
        savings_amount: 0,
        savings_percent: 0
    },
    reviews: { total_reviews: 317, rating: 4.6 },
    url: 'https://www.amazon.com/dp/B07CSLG8ST',
    score: '1458.20',
    sponsored: false,
    amazonChoice: false,
    bestSeller: false,
    amazonPrime: false,
    title: 'Newest Flagship Microsoft Xbox One S 1TB HDD Bundle with Two (2X) Wireless Controllers, 1-Month Game Pass Trial, 14-Day Xbox Live Gold Trial - White',
    thumbnail: 'https://m.media-amazon.com/images/I/51-JAEI1jzL._AC_UY218_.jpg'
},...]

.reviews() output

[{
    id: 'R3OZ9T0YATJ5UM',
    review_data: 'Reviewed in the United States on May 31, 2018',
    name: 'Danyelle Arbour',
    rating: 5,
    title: 'I would 100% suggest this to everyone.',
    review:
        'I love this. It just arrived today, I immediately plugged it ' +
        'into my computer and it has the best picture. My old webcam I ' +
        'got like 8 years ago and it was so pixellated then it suddenly ' +
        'was just white with pink streaks. I hopped on amazon because I ' +
        'really desperately needed a new cam but at a very tight budget ' +
        'and this one fit the bill. I would 100% suggest this to ' +
        'everyone. Very easy to adjust the angle and it sets up with ' +
        'zero effort.',
},...]

.asin() output

{
    title: 'New Apple MacBook Pro (16-inch, 16GB RAM, 512GB Storage, 2.6GHz Intel Core i7) - Space Gray',
    description: '',
    feature_bullets: [
        'Ninth-generation 6-Core Intel Core i7 Processor',
        'Stunning 16-inch Retina Display with True Tone technology',
        'Touch Bar and Touch ID',
        'AMD Radeon Pro 5300M Graphics with GDDR6 memory',
        'Ultrafast SSD',
        'Intel UHD Graphics 630',
        'Six-speaker system with force-cancelling woofers',
        'Four Thunderbolt 3 (USB-C) ports',
        'Up to 11 hours of battery life',
        '802.11AC Wi-Fi',
    ],
    variants: [
        {
            asin: 'B081FWLDZ2',
            images: [
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/31Ky7oRBGtL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/31Ky7oRBGtL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SL1500_.jpg',
                    variant: 'MAIN',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX522_.jpg': ['522', '522'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/418onp2C2%2BL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/418onp2C2%2BL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SL1500_.jpg',
                    variant: 'PT01',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX466_.jpg': ['466', '466'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/51U4uOwYbUL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/51U4uOwYbUL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SL1500_.jpg',
                    variant: 'PT02',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX385_.jpg': ['385', '385'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/51MFgSmK%2B1L._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/51MFgSmK%2B1L._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SL1500_.jpg',
                    variant: 'PT03',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX679_.jpg': ['679', '679'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/31tkOrl17nL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/31tkOrl17nL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SL1500_.jpg',
                    variant: 'PT04',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX385_.jpg': ['385', '385'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/21nvGq8dsRL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/21nvGq8dsRL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SL1500_.jpg',
                    variant: 'PT05',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX679_.jpg': ['679', '679'],
                    },
                },
            ],
            title: 'Intel Core i7 512GB Silver',
            link: 'https://www.amazon.com/dp/B081FWLDZ2/?th=1&psc=1',
            is_current_product: false,
            price: '',
        },
        {
            asin: 'B081FZV45H',
            images: [
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/41S63IQRFXL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/41S63IQRFXL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SL1500_.jpg',
                    variant: 'MAIN',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX466_.jpg': ['466', '466'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/41UD%2B0RIxmL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/41UD%2B0RIxmL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SL1500_.jpg',
                    variant: 'PT01',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX425_.jpg': ['425', '425'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/51pODxHeboL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/51pODxHeboL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SL1500_.jpg',
                    variant: 'PT02',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX425_.jpg': ['425', '425'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/519Lka7j2EL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/519Lka7j2EL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SL1500_.jpg',
                    variant: 'PT03',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX425_.jpg': ['425', '425'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/31om7IXMIbL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/31om7IXMIbL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SL1500_.jpg',
                    variant: 'PT04',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX385_.jpg': ['385', '385'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/21HDW0eoP7L._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/21HDW0eoP7L._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SL1500_.jpg',
                    variant: 'PT05',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX522_.jpg': ['522', '522'],
                    },
                },
            ],
            title: 'Intel Core i7 512GB Space Gray',
            link: 'https://www.amazon.com/dp/B081FZV45H/?th=1&psc=1',
            is_current_product: true,
            price: '',
        },
        {
            asin: 'B081FTNGNC',
            images: [
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/31Ky7oRBGtL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/31Ky7oRBGtL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SL1500_.jpg',
                    variant: 'MAIN',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/71UItVa0VmL._AC_SX522_.jpg': ['522', '522'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/418onp2C2%2BL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/418onp2C2%2BL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SL1500_.jpg',
                    variant: 'PT01',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/81p5n9MO4QL._AC_SX466_.jpg': ['466', '466'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/51U4uOwYbUL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/51U4uOwYbUL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SL1500_.jpg',
                    variant: 'PT02',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/91rcadsWWwL._AC_SX385_.jpg': ['385', '385'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/51MFgSmK%2B1L._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/51MFgSmK%2B1L._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SL1500_.jpg',
                    variant: 'PT03',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/91dZ8gjhO9L._AC_SX679_.jpg': ['679', '679'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/31tkOrl17nL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/31tkOrl17nL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SL1500_.jpg',
                    variant: 'PT04',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/81-X9dGhCkL._AC_SX385_.jpg': ['385', '385'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/21nvGq8dsRL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/21nvGq8dsRL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SL1500_.jpg',
                    variant: 'PT05',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/71HU1BlSy7L._AC_SX679_.jpg': ['679', '679'],
                    },
                },
            ],
            title: 'Intel Core i9 1TB Silver',
            link: 'https://www.amazon.com/dp/B081FTNGNC/?th=1&psc=1',
            is_current_product: false,
            price: '',
        },
        {
            asin: 'B081FV1Y57',
            images: [
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/41S63IQRFXL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/41S63IQRFXL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SL1500_.jpg',
                    variant: 'MAIN',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/71pC69I3lzL._AC_SX466_.jpg': ['466', '466'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/41UD%2B0RIxmL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/41UD%2B0RIxmL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SL1500_.jpg',
                    variant: 'PT01',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/81aot0jAfFL._AC_SX425_.jpg': ['425', '425'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/51pODxHeboL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/51pODxHeboL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SL1500_.jpg',
                    variant: 'PT02',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GRfDGDJIL._AC_SX425_.jpg': ['425', '425'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/519Lka7j2EL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/519Lka7j2EL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SL1500_.jpg',
                    variant: 'PT03',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/91GsCwayBPL._AC_SX425_.jpg': ['425', '425'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/31om7IXMIbL._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/31om7IXMIbL._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SL1500_.jpg',
                    variant: 'PT04',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX522_.jpg': ['522', '522'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/81mJ-Mdc-OL._AC_SX385_.jpg': ['385', '385'],
                    },
                },
                {
                    large: 'https://images-na.ssl-images-amazon.com/images/I/21HDW0eoP7L._AC_.jpg',
                    thumb: 'https://images-na.ssl-images-amazon.com/images/I/21HDW0eoP7L._AC_SR38,50_.jpg',
                    hiRes: 'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SL1500_.jpg',
                    variant: 'PT05',
                    main: {
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX569_.jpg': ['569', '569'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX385_.jpg': ['385', '385'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX466_.jpg': ['466', '466'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX425_.jpg': ['425', '425'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX679_.jpg': ['679', '679'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX342_.jpg': ['342', '342'],
                        'https://images-na.ssl-images-amazon.com/images/I/718Pz9bYxWL._AC_SX522_.jpg': ['522', '522'],
                    },
                },
            ],
            title: 'Intel Core i9 1TB Space Gray',
            link: 'https://www.amazon.com/dp/B081FV1Y57/?th=1&psc=1',
            is_current_product: false,
            price: '',
        },
    ],
    asin: 'B081FZV45H',
    url: 'https://www.amazon.com/dp/B081FZV45H',
    reviews: { total_reviews: 1224, rating: '4.6', answered_questions: 297 },
    price: { symbol: '$', currency: 'USD', current_price: 2149, discounted: true, before_price: 2399, savings_amount: 250, savings_percent: 10.42 },
    bestsellers_rank: [],
    main_image: 'https://images-na.ssl-images-amazon.com/images/I/41S63IQRFXL._AC_SY879_.jpg',
    total_images: 6,
    images: [
        'https://images-na.ssl-images-amazon.com/images/I/41S63IQRFXL._AC_SY879_.jpg',
        'https://images-na.ssl-images-amazon.com/images/I/41UD%2B0RIxmL._AC_SY879_.jpg',
        'https://images-na.ssl-images-amazon.com/images/I/51pODxHeboL._AC_SY879_.jpg',
        'https://images-na.ssl-images-amazon.com/images/I/519Lka7j2EL._AC_SY879_.jpg',
        'https://images-na.ssl-images-amazon.com/images/I/31om7IXMIbL._AC_SY879_.jpg',
        'https://images-na.ssl-images-amazon.com/images/I/21HDW0eoP7L._AC_SY879_.jpg',
    ],
    total_videos: 0,
    videos: [],
    delivery_message: 'FREE delivery: Sunday, Sep 6Details',
    product_information: {
        dimensions: '9.68 x 14.09 x 0.64 inches',
        weight: '8.23 pounds',
        available_from: 'November 13, 2019',
        available_from_utc: '2019-11-12T23:00:00.000Z',
        available_for_months: 10,
        available_for_days: 291,
        manufacturer: 'Apple Computer',
        model_number: 'MVVJ2LL/A',
        department: '',
        sold_by: 'Amazon.com',
        fulfilled_by: 'Amazon.com',
        qty_per_order: 2,
        store_id: '',
        brand: 'Visit the Apple Store',
    },
    badges: { amazon_сhoice: true, amazon_prime: false },
};

.categories() output

{
    aps: { name: 'All Departments', category: 'aps' },
    'arts-crafts-intl-ship': { name: 'Arts & Crafts', category: 'arts-crafts-intl-ship' },
    'automotive-intl-ship': { name: 'Automotive', category: 'automotive-intl-ship' },
    'baby-products-intl-ship': { name: 'Baby', category: 'baby-products-intl-ship' },
    'beauty-intl-ship': { name: 'Beauty & Personal Care', category: 'beauty-intl-ship' },
    'stripbooks-intl-ship': { name: 'Books', category: 'stripbooks-intl-ship' },
    'computers-intl-ship': { name: 'Computers', category: 'computers-intl-ship' },
    'digital-music': { name: 'Digital Music', category: 'digital-music' },
    'electronics-intl-ship': { name: 'Electronics', category: 'electronics-intl-ship' },
    'digital-text': { name: 'Kindle Store', category: 'digital-text' },
    'instant-video': { name: 'Prime Video', category: 'instant-video' },
    'fashion-womens-intl-ship': { name: "Women's Fashion", category: 'fashion-womens-intl-ship' },
    'fashion-mens-intl-ship': { name: "Men's Fashion", category: 'fashion-mens-intl-ship' },
    'fashion-girls-intl-ship': { name: "Girls' Fashion", category: 'fashion-girls-intl-ship' },
    'fashion-boys-intl-ship': { name: "Boys' Fashion", category: 'fashion-boys-intl-ship' },
    'deals-intl-ship': { name: 'Deals', category: 'deals-intl-ship' },
    'hpc-intl-ship': { name: 'Health & Household', category: 'hpc-intl-ship' },
    'kitchen-intl-ship': { name: 'Home & Kitchen', category: 'kitchen-intl-ship' },
    'industrial-intl-ship': { name: 'Industrial & Scientific', category: 'industrial-intl-ship' },
    'luggage-intl-ship': { name: 'Luggage', category: 'luggage-intl-ship' },
    'movies-tv-intl-ship': { name: 'Movies & TV', category: 'movies-tv-intl-ship' },
    'music-intl-ship': { name: 'Music, CDs & Vinyl', category: 'music-intl-ship' },
    'pets-intl-ship': { name: 'Pet Supplies', category: 'pets-intl-ship' },
    'software-intl-ship': { name: 'Software', category: 'software-intl-ship' },
    'sporting-intl-ship': { name: 'Sports & Outdoors', category: 'sporting-intl-ship' },
    'tools-intl-ship': { name: 'Tools & Home Improvement', category: 'tools-intl-ship' },
    'toys-and-games-intl-ship': { name: 'Toys & Games', category: 'toys-and-games-intl-ship' },
    'videogames-intl-ship': { name: 'Video Games', category: 'videogames-intl-ship' },
}

Options

const options = {
    //Search keyword: {string default: ""}
    keyword: '',

    //Number of products to scrape: {int default: 10}
    number: 10,

    // If {bulk} is set to {false} then you can only scrape products by page. Note that {number} will be ignored
    // Very usefull if you need to scrape products from a specific page
    bulk: true,

    // Search result {page} number
    // You can set this value to 5 and scraper will collect all products starting from the {page} number 5
    page: 0,

    // Save result to a file: {boolean default: ''}
    // You can set ['json', 'csv', 'all', '']
    // 'all' - save result to JSON and CSV files
    filetype: '',

    // Set proxy: {string default: []}
    // Array of proxies. If more then 1 then each http request will use randmon proxy from the array
    proxy: ['username:password@ip:port', 'username:password@ip:port'],

    //Sort by rating. [minRating, maxRating]: {array default: [1,5]}
    rating: [1, 5],

    //Sorting. If searching for a product then list will be sorted by a higher score(number of reviews*rating). If searching for a reviews then they will be sorted by rating.: {boolean default: false}
    sort: false,

    //Scrape only products with the discount: {boolean default: false}
    discount: false,

    //Scrape only sponsored products: {boolean default: false}
    sponsored: false,

    //Amazon is supported in 16 countries
    //List of all countries is posted below
    //Value should be in ISO 3166 (Alpha-2 code) format
    //{string default: "US"}
    country: 'GB',

    // Number of async task {number default: 5}
    // The more the faster but do not go wild as usually 5 is enough
    asyncTasks: 5,

    //Product search can be performed in the specific category
    //To get list of categories you can use method .categories()
    category: 'digital-text',

    //Some product metadata is binded to the ZIP code
    //When you are setting the ZIP code new session is being generated by the Amazon
    //By setting cookie values you will receive more accurate data(pricing and etc)
    //Cookie example that can be extracted from the browser :session-id=222-22222-22222; session-id-time=222221l; ubid-main=444-4444-4444444
    cookie: '',

    //Randomize user agent version. This helps to prevent request blocking from the amazon side
    randomUa: false,

    //Timeout between requests. Timeout is set in mls: 1000 mls = 1 second
    timeout: 0,
};

List of supported countries

{
    US: {
        country: 'United States of America',
        currency: 'USD',
        host: 'www.amazon.com',
    },
    AU: {
        country: 'Australia',
        currency: 'AUD',
        host: 'www.amazon.com.au',
    },
    BR: {
        country: 'Brazil',
        currency: 'BRL',
        host: 'www.amazon.com.br',
    },
    CA: {
        country: 'Canada',
        currency: 'CAD',
        host: 'www.amazon.ca',
    },
    CN: {
        country: 'China',
        currency: 'CNY',
        host: 'www.amazon.cn',
    },
    FR: {
        country: 'France',
        currency: 'EUR',
        host: 'www.amazon.fr',
    },
    DE: {
        country: 'Germany',
        currency: 'EUR',
        host: 'www.amazon.de',
    },
    IN: {
        country: 'India',
        currency: 'INR',
        host: 'www.amazon.in',
    },
    IT: {
        country: 'Italy',
        currency: 'EUR',
        host: 'www.amazon.it',
    },
    MX: {
        country: 'Mexico',
        currency: 'MXN',
        host: 'www.amazon.com.mx',
    },
    NL: {
        country: 'Netherlands',
        currency: 'EUR',
        host: 'www.amazon.nl',
    },
    SG: {
        country: 'Singapore',
        currency: 'SGD',
        host: 'www.amazon.sg',
    },
    ES: {
        country: 'Spain',
        currency: 'EUR',
        host: 'www.amazon.es',
    },
    TR: {
        country: 'Turkey',
        currency: 'TRY',
        host: 'www.amazon.com.tr',
    },
    AE: {
        country: 'United Arab Emirates',
        currency: 'AED',
        host: 'www.amazon.ae',
    },
    GB: {
        country: 'United Kingdom',
        currency: 'GBP',
        host: 'www.amazon.co.uk',
    },
    JP: {
        country: 'Japan',
        currency: 'JPY',
        host: 'www.amazon.jp',
    },
}

License

MIT

Free Software

amazon-product-api's People

Contributors

drawrowfly avatar gpenverne avatar ishworii avatar joelcode avatar nilportugues avatar ramoncrisante avatar restyler avatar rsenapps avatar shaunlwm avatar shujunliu avatar xakep-sava avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazon-product-api's Issues

Error: 503

Anyone experiencing a 503 error on latest version >= 2.2.29?

...'To discuss automated access to Amazon data please contact [email protected].'

Retrieving price 0 for asin product

Hello dear;
After fetching this item details, I received price of $0, although, it has $13.98 in it.
Here is my code:

const asinInfo = await amazonScraper.asin({
  asin: 'B001JTADUI',
  country: 'US',
  cookie: 'session-id=222-22222-22222; session-id-time=222221l; ubid-main=444-4444-4444444',
});

I also tried with cookie: '' and got the same results.
Thanks in advance.

price wrong, decimal point missing using --country DE

When searching for products with --country DE all price property values are wrong.

Example:

"asin": "B0953X8PX5",
"price": {
"discounted": true,
"current_price": 16298,
"currency": "EUR",
"before_price": 16998,
"savings_amount": 700,
"savings_percent": 4.12
},

The correct price should be:
162.98 (current_price)
169.98 (before_price)

Proxies, timeout, amount of results returned, rp

Hi there! First off, very nice tool you have built.
I have noticed some things while trying to integrate your repo which may be of use to you.
I didn't check any code to see what was causing it but merely noticed some behavior.

I am using the module, not the argument parser to execute queries.

1- Proxies and timeout
For some reason the timeout does nothing and the program seems to stall well past the set timeout.
I am using free proxies scavenged from the internet so it is important that this works.
Even when you're using private proxies you would still expect this configuration to work.

Perhaps this can be considered https://medium.com/javascript-in-plain-english/use-promise-race-to-timeout-promises-6710cb0a3164

2- .products() amount of results returned
I am using the following options:

argv['keyword'] = keyword;
argv['category'] = 'aps';
argv['country'] = 'US';
argv['number'] = conf.scrape_products_per_keyword; // set to 500
argv['bulk'] = true;
argv['proxy'] = proxies_formatted; // a list of proxies
argv['rating'] = [conf.product_min_rating, conf.product_max_rating]; // [3,5]
argv['sort'] = true;
argv['randomUa'] = true;
argv['timeout'] = conf.request_timeout_ms;  // 1000

As you can see this has bulk=true, however it consistently returns only results from just one page (<50).
I resolved this by turning bulk off and manually iterating over the pages, perhaps this is due to the bad quality of the proxies, but shouldn't happen none the less.

3- request-promise
Request promise has been deprecated.

Is it still working?

Not sure it's working currently? Been getting a lot of blanks when running various commands on it.

image

Also getting this and then it's just a spinning circle:

image

heroku error

2021-06-23T06:24:30.906750+00:00 app[web.1]: npm ERR! [email protected] start: start.js
2021-06-23T06:24:30.906941+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-06-23T06:24:30.907187+00:00 app[web.1]: npm ERR!
2021-06-23T06:24:30.907363+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2021-06-23T06:24:30.907670+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-06-23T06:24:30.915563+00:00 app[web.1]:
2021-06-23T06:24:30.915785+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-06-23T06:24:30.915913+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-06-23T06_24_30_908Z-debug.log
2021-06-23T06:24:30.982773+00:00 heroku[web.1]: Process exited with status 1
2021-06-23T06:24:31.081599+00:00 heroku[web.1]: State changed from starting to crashed

Multiple selector issues

Hello, I noticed that recently the scraper is not working properly, for example, for products request, it way return zero json nodes for products.

After investigation it turned out that priceSearch ( const priceSearch = $(`div[data-asin=${key}] span[data-a-size="l"]`)[0] || $(`div[data-asin=${key}] span[data-a-size="m"]`)[0]) is not working anymore for xbox product search on amazon US.

Adding $(`div[data-asin=${key}] span[data-a-size="base_plus"]`)[0] to productSearch seems to mitigate the issue.

But I also noticed the same situation with product reviews, as well. Ratings breakdown is returned fine, but no text reviews are returned at all.

Do you see the same issue on your side?
Is it Amazon changing its markup all the time?

Image display

How about adding image thumbnail or something?
Great plugin tho

Not able to load module 'amazon-buddy' in my js code

I am not able to load the 'amazon-buddy' module in my code and it is always giving 'Could not find module 'amazon-buddy''.
Even though i ran the npm command mentioned on the site to load the package.
Could you please help ?

Error log

please don't close it, without comment

2021-06-23T06:24:30.906750+00:00 app[web.1]: npm ERR! [email protected] start: start.js
2021-06-23T06:24:30.906941+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-06-23T06:24:30.907187+00:00 app[web.1]: npm ERR!
2021-06-23T06:24:30.907363+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2021-06-23T06:24:30.907670+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-06-23T06:24:30.915563+00:00 app[web.1]:
2021-06-23T06:24:30.915785+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-06-23T06:24:30.915913+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-06-23T06_24_30_908Z-debug.log
2021-06-23T06:24:30.982773+00:00 heroku[web.1]: Process exited with status 1
2021-06-23T06:24:31.081599+00:00 heroku[web.1]: State changed from starting to crashed

--help Hasn't been Updated!

Hi,
I installed your latest release but your --help hasn't been updated! It still shows commands with the cli.js option. At a first glance, it's very confusing.
Pardon me for any mistakes. I'm new to the GitHub ecosystem.

ORA spin loader causes issues on module import + lack of CORS headers

First, thanks for this package, literally the only decent amazon scraper on NPM. Now onto the issues:!

  1. The ORA spinner looks really nice on the terminal, but when importing the module, the same spinner breaks everything.
    1.1 The ORA package makes use of the readline package:
    const readline = require('readline');
    but this package is not located in ORA package.json.
    1.2 Even after installing the readline package, ORA still causes issues in the package. Deleting any mentions of ORA from Amazon Scraper solves the issue.

  2. I'm also encountering some CORS issues.

problem with special caracter in title

Hi drawrowfly
thanks for your work
Seems to have a problem when title include special caracter (for example French letter : é, è, à )
in that case script is wainting for response and get stuck.
some exemple asin:
B07GVY1WXF
B07TJG7H5M

thanks

extraction of many reviews > 1500 fails

If I run:

amazon-buddy reviews B071W8R4PS --country DE -n 2000

I get the following error:


ReferenceError: reject is not defined
    at AmazonScraper.startScraper (/home/felix/anaconda3/lib/node_modules/amazon-buddy/lib/Amazon.js:145:116)
    at Object.exports.reviews (/home/felix/anaconda3/lib/node_modules/amazon-buddy/lib/index.js:43:55)
    at startScraper (/home/felix/anaconda3/lib/node_modules/amazon-buddy/bin/cli.js:8:58)
    at Object.require.usage.example.example.example.example.example.example.command.command [as handler] (/home/felix/anaconda3/lib/node_modules/amazon-buddy/bin/cli.js:47:9)
    at Object.runCommand (/home/felix/anaconda3/lib/node_modules/amazon-buddy/node_modules/yargs/lib/command.js:240:40)
    at Object.parseArgs [as _parseArgs] (/home/felix/anaconda3/lib/node_modules/amazon-buddy/node_modules/yargs/yargs.js:1105:41)
    at Object.get [as argv] (/home/felix/anaconda3/lib/node_modules/amazon-buddy/node_modules/yargs/yargs.js:1033:21)
    at Object.<anonymous> (/home/felix/anaconda3/lib/node_modules/amazon-buddy/bin/cli.js:187:21)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

Any ideas what's going wrong?

List of sub-categories

Is there a way to get the list of sub categories?

E.g. for the "books category":

Books
  Arts & Photography
  Biographies & Memoirs
  Business & Money
  Crafts, Hobbies & Home
  ...
  ...
  History
    Africa
    Americas
    Arctic & Antarctica
    Asia
    Australia & Oceania
    Europe
    Middle East
    Russia
    United States
    ...
    ...
  ...
  ...

Thanks!
🙏

[Feature request] Obtain additional product details such as 'about this item', 'Product description' and 'From the manufacturer'

If you take this product as an example https://www.amazon.com/NVIDIA-Shield-Android-Streaming-Performance/dp/B07YP9FBMM

amazon-buddy asin B07YP9FBMM --filetype json only returns a small amount of data. All of the descriptive text from the 'Product Description' and 'From the manufacturer' as well as the bulletpoint data underneath the product details at the top, as well as the 'Technical Details', none of this is returned. It would be extremely useful if all of that could also be grabbed and storred in JSON

Feature Request - Support for scraping the products by search URL

Hello there,

This is a feature request (if possible) for adding support for scraping products directly by proving the search URL link to accommodate additional filters provided by Amazon.

Something like

amazon-buddy seachurl -k 'https://www.amazon.de/s?k=Maybelline&i=beauty&rh=n%3A84230031%2Cp_6%3AA3JWKAKR8XB7XF%2Cp_72%3A184779031&dc&language=en&qid=1620276591&rnid=184735031&ref=sr_nr_p_72_2'

Really appreciate your work.

About the product sizes

Thank you for this awesome api !

Is there a way to collect the products sizes ?

Cordially

When using .asin the price return 0

Hi,

I start trying the code and when I use .asin the price return '0'

This is my code

const amazonScraper = require('amazon-buddy');

(async () => {
try {

    const product_by_asin = await amazonScraper.asin({ asin: 'B01GW3H3U8' });
    console.log(product_by_asin)

} catch (error) {
    console.log(error);
}

})();

and this what it returns

{
title: 'Xbox Wireless Controller - White',
description: 'Edition:White | Configuration:SingleExperience the enhanced comfort and feel of the New Xbox Wireless Controller, featuring a sleek, streamlined design and textured grip. Enjoy custom button mapping and up to twice the wireless range. Plug in any compatible headset with the 3.5mm stereo headset jack. And with Bluetooth technology, play your favorite games on Windows 10 PCs, tablets, and phones. Button mapping available via Xbox Accessories app. Range compared to previous controllers with the Xbox One S. Bluetooth capabilities require Windows 10 devices running the Windows Anniversary Update. Go to xbox.com/xboxone/controller-OS for more information.',
feature_bullets: [
'Compatible with Xbox One X, Xbox One S, Xbox One and Windows 10',
'Includes Bluetooth technology for gaming on Windows 10 PCs and tablets',
'Stay on target with textured grip',
'Get upto twice the wireless range compared to previous Xbox One controllers (tested using the Xbox One S console)',
'Experience the enhanced comfort and feel of the new Xbox wireless controller'
],
variants: [],
asin: 'B01GW3H3U8',
url: 'https://www.amazon.com/dp/B01GW3H3U8',
reviews: { total_reviews: 18898, rating: '4.6', answered_questions: 0 },
item_available: true,
price: {
symbol: '$',
currency: 'USD',

current_price: 0,

discounted: false,
before_price: 0,
savings_amount: 0,
savings_percent: 0

},
bestsellers_rank: [
{
rank: 338,
category: 'Video Games ',
link: 'https://www.amazon.com/gp/bestsellers/videogames/ref=pd_zg_ts_videogames'
},
{
rank: 12,
category: 'Xbox One Gamepads & Standard Controllers',
link: 'https://www.amazon.com/gp/bestsellers/videogames/6469282011/ref=pd_zg_hrsr_videogames'
}
],
main_image: 'https://images-na.ssl-images-amazon.com/images/I/41iQlt6ZBLL._AC_SY879_.jpg',
total_images: 6,
images: [
'https://images-na.ssl-images-amazon.com/images/I/41iQlt6ZBLL.AC_SY879.jpg',
'https://images-na.ssl-images-amazon.com/images/I/41ps1EdriyL.AC_SY879.jpg',
'https://images-na.ssl-images-amazon.com/images/I/41QcdZrEoWL.AC_SY879.jpg',
'https://images-na.ssl-images-amazon.com/images/I/41rzMBZlRnL.AC_SY879.jpg',
'https://images-na.ssl-images-amazon.com/images/I/418BpiuFGXL.AC_SY879.jpg',
'https://images-na.ssl-images-amazon.com/images/I/6170h5brIxL.AC_SY879.jpg'
],
total_videos: 0,
videos: [],
delivery_message: '',
product_information: {
dimensions: '6.89 x 2.87 x 6.97 inches',
weight: '1.2 pounds',
available_from: 'June 10, 2016',
available_from_utc: '2016-06-09T21:00:00.000Z',
available_for_months: 52,
available_for_days: 1579,
manufacturer: 'Microsoft',
model_number: 'TF5-00002',
department: '',
qty_per_order: 'na',
store_id: '',
brand: 'Brand: Microsoft'
},
badges: { 'amazon_сhoice': false, amazon_prime: false },
sponsored_products: [],
also_bought: []
}

Can you please help on that!

CLI output name and actual output name do not match

amazon-buddy products -k 'fixie bike' -n 100 --random-ua true --sort true --min-rating 4.5 --filetype json
Outputs -> Result was saved to: products(fixie bike)_1593862189487

Actual file name: products(fixie bike)_1593862189473.json

There seems to be an inconsistency at the timestamps used for the file name.

Periodic empty results

Hi, is there limits from Amazon or do they IP block after a certain amount of attempts? I seem to be getting empty results periodically that become more frequent over time. Here's an example of what I may receive back in the results:

{
  result: [
    {
      title: '',
      description: '',
      feature_bullets: [],
      variants: [],
      categories: [],
      asin: 'B08HJS2JLJ',
      url: 'https://www.amazon.com/dp/B08HJS2JLJ',
      reviews: [Object],
      item_available: true,
      price: [Object],
      bestsellers_rank: [],
      main_image: '',
      total_images: 0,
      images: [],
      total_videos: 0,
      videos: [],
      delivery_message: '',
      product_information: [Object],
      badges: [Object],
      sponsored_products: [],
      also_bought: [],
      other_sellers: []
    }
  ]
}

I do currently have a for...of loop running to scrape data using an array of products by asin. Don't know if this would cause issues or not.

All requests receive captcha response

Hi, first wanted to say that I love this project. I am relearning javascript and have been playing around with your project. I want to help maintain it however I can.

This project has worked perfectly for me in the past, but today I am receiving captcha responses whenever I try running the scraper. These responses include the phrase "Sorry, we just need to make sure you're not a robot. For best results, please make sure your browser is accepting cookies."

To reproduce on version 2.2.27 you can run: node bin/cli.js products -k 'test' --filetype '' --random-ua
which will return 0 products.

I modified the request headers to include DNT: 1 (based on requests that did work in my browser). And I am no longer getting the captcha response. I will submit a pull request to add this header. If the captcha responses are unique to me, feel free to close and ignore this issue.

Products not getting fetched

While i am trying to fetch any products using keyword it is showing Amazon Scraper StartedError: No more products error. Could you please help ?

image

Support fetching information for a specific vendor

Is there a chance to support fetching price-information for a given vendor?

I tried various search-options, but could not get the tool to return the price from a given vendor, e.g. at https://www.amazon.de/dp/B001AXFZ60 currently Amazon asks 65,68.

If you go the "other vendors" page at https://www.amazon.de/gp/offer-listing/B001AXFZ60/ref=dp_olp_pn there are e.g. "Baby-Direkt" with a price of 71,90 (plus shipping costs).

Is there a way to get this information? I am willing to spend some time on implementing such a feature, but would need a few hints as to how I would go about it.

Need to try and catch an error with calculation for product_information.available_from

I checked this link: https://www.amazon.es/dp/B08739TY2T
And without my suggestion here for Amazon.js:

        // Calculate months and days on amazon
        try {
            if (product_information.available_from) {
                const from = moment(new Date(product_information.available_from));
                const now = moment(new Date());
                const duration = moment.duration(now.diff(from));
                product_information.available_from_utc = new Date(product_information.available_from).toISOString();
                product_information.available_for_months = Math.ceil(duration.asMonths());
                product_information.available_for_days = Math.ceil(duration.asDays());
            }
        } catch {}

It returns null for asin({ asin: "B08739TY2T", country: "ES" })

The reason is:

RangeError: Invalid time value
    at Date.toISOString (<anonymous>)
    at AmazonScraper.extractProductInfromation (amazon-buddy\lib\Amazon.js:694:103)
    at AmazonScraper.grapAsinDetails (amazon-buddy\lib\Amazon.js:1060:74)
    at amazon-buddy\lib\Amazon.js:238:30

The try and catch fix this issue.

Own HTML and Proxy

A parameter is required for using own proxy.

Also I have a special way in which i can get html of the page easily. So there should be a parameter in the product function in which If html parameter is given then asin and country parameter should not be required.

[Feature request] Indicate currency in the price section

This is a minor one but it would be nice if based on the host, the currency could also be indicated in the returned json inside the price array. So .com -> USD, .co.uk -> GBP, etc

Of course we can do this on our end but it would be a nice extra if it was handled at the source

Many thanks!!

amazon-buddy asin [asin]" is broken

Steps to Reproduce the Problem

amazon-buddy asin B07V5JTMV9

Specifications

  • Version: amazon-buddy 2.2.12
  • Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
  • Darwin Kernel Version 18.7.0

Actual Behavior

[
{
"title":"",
"description":"",
"feature_bullets":[],
"variants":[],
"categories":[],
"asin":"B07V5JTMV9",
"url":"https://www.amazon.com/dp/B07V5JTMV9",
"reviews":{
"total_reviews":0,
"rating":0,
"answered_questions":0
},
"item_available":true,
"price":{
"symbol":"$",
"currency":"USD",
"current_price":0,
"discounted":false,
"before_price":0,
"savings_amount":0,
"savings_percent":0
},
"bestsellers_rank":[],
"main_image":"",
"total_images":0,
"images":[],
"total_videos":0,
"videos":[],
"delivery_message":"",
"product_information":{
"dimensions":"",
"weight":"",
"available_from":"",
"available_from_utc":"",
"available_for_months":0,
"available_for_days":0,
"manufacturer":"",
"model_number":"",
"department":"",
"qty_per_order":"na",
"brand":""
},
"badges":{
"amazon_сhoice":false,
"amazon_prime":false
},
"sponsored_products":[],
"also_bought":[],
"other_sellers":[]
}
]

Expected Behavior

Data for product returned.

Image Url's Malformed

Some book image urls are being scraped and failing to extract correctly

For instance:

https://www.amazon.com/dp/022640613X

The main image url is:

https://images-na.ssl-images-amazon.com/images/I/51q62HOcxZL._SX347_BO1,204,203,200_.jpg

However, the output from the scrape is as follows:

https://images-na.ssl-images-amazon.com/images/I/images-na.jpg

Now I believe the issue is to do with this block (lines 1441 - 1457 of Amazon.js)

/**
         * If for example book item does have only one image
         * then {imageGalleryData} won't exist and we will use different way of extracting required data
         * Product types: books
         */
        if (!images.length) {
            const imageData = $('#imgBlkFront')[0] || $('#ebooksImgBlkFront')[0];
            if (imageData) {
                const data = imageData.attribs['data-a-dynamic-image'];
                const json = JSON.parse(data);      // << --------------------------- PROBLEM HERE
                const keys = Object.keys(json);
                const imageIdregex = /\/([\w-+]{9,13})\./.exec(keys[0]);
                if (imageIdregex) {
                    images.push(`https://images-na.ssl-images-amazon.com/images/I/${imageIdregex[1]}.jpg`);
                }
            }
        }

Specifically, in reference to the above example, the following is the 'data-a-dynamic-image' attribute:

"{"https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SX331_BO1,204,203,200_.jpg":[333,499],"https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SY344_BO1,204,203,200_.jpg":[231,346]}"

I believe it is not being parsed correctly since the string is both surrounded in rabbit-ears (ie "), and the keys inside are also using rabbit ears:

Here is the output if I try to parse using NodeJS in a terminal:

> JSON.parse("{"https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SX331_BO1,204,203,200_.jpg":[333,499],"https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SY344_BO1,204,203,200_.jpg":[231,346]}")
JSON.parse("{"https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SX331_BO1,204,203,200_.jpg":[333,499],"https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SY344_BO1,204,203,200_.jpg":[231,346]}")
           ^^^

Uncaught SyntaxError: missing ) after argument list
> 

I am not sure what the best approach would be, perhaps a pre-processing step which converts the first and last double quote (if present) to single quotes, given that the JSON standard mandates double quotes:

This parses as expected, the only difference is converting the first and last double quote to single quote.

JSON.parse('{"https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SX331_BO1,204,203,200_.jpg":[333,499],"https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SY344_BO1,204,203,200_.jpg":[231,346]}')
{ 'https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SX331_BO1,204,203,200_.jpg': [ 333, 499 ], 'https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SY344_BO1,...
  'https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SX331_BO1,204,203,200_.jpg': [ 333, 499 ],
  'https://images-na.ssl-images-amazon.com/images/I/51jxtcapGSL._SY344_BO1,204,203,200_.jpg': [ 231, 346 ]
}

I have scraped about 650 books, and this has occurred about 20 times, so, about 3% of the time, if in fact my rather small sample is reflective of the entire amazon store.

[Feature request] Print output as json when using CLI (instead of creating file)

Hi there, first of all thanks a lot for making this, it's very well made and extremely useful. I'm going to be creating a few feature requests if you don't mind.

The first is that I would prefer if I could pass an argument on the CLI so that the return value is printed out instead of having a file created. This is because this CLI call is being called programatically from a PHP script and it makes it much easier to store the output inside a database then having to have a file created, figure out the filename, then read the file's content and store that in a database, and then delete the file

I imagine adding a new flag such as --output cli / file (default file) would be very simple

Thank you!

[Feature Request] Better handle products that have multiple variants

If you take this product as an example https://www.amazon.co.uk/AmazonBasics-KB-10KG-cast-iron-kettlebell-10kg/dp/B076QJY2FN

You see that this is defaulting to the 10kg kettlebell since that's the product assigned to that asin, but looking at the json output from amazon-buddy it's impossible to tell that this is about the 10kg kettlebell.

It would be great if the 'related products' could also be scraped so there would be links to the other kettlebells linked on that page (different weights in this case, but this would be the same for products with size and color variants)

And also if somehow the currently selected item could be parsed.. in this case the 10kg is selected and this is marked in the form of Style Name: 10kg on that product page

Proxy

Please can you recommend a good pay proxy?
Thanks

Price is always 0

I added cookies. But the result has not changed, price information is not coming. Is there a different parameter I need to add?

class ProductService {
    async getProduct(asin) {
        await amazonScraper.asin({
            asin: asin,
            country: 'US',
            cookie: "session-id=147-3348510-9162916; session-id-time=2082787201l; ubid-main=130-4538308-0250231;"
        }).then((res) => {
            res.result.map(item => {
                Product.updateOrCreate(item)
            })
        });
    };
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.