npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

amazon-sc-business-reports

v1.0.7

Published

Automated Amazon Seller Central Business Reports Downloader

Downloads

5

Readme

amazon-sc-business-reports

Automated Amazon Seller Central Business Reports Downloader

Amazon's Seller Central Business Reports provide valuable insights for retailers that are not available through any Report Scheduling or API. This package uses Puppeteer to control a headless Chrome browser which navigates Seller Central, downloading all the reports (for each merchant and marketplace) and returning the results in JSON.

Requirements:

  • Twilio - In order to provide automated One Time Password (OTP) Two-Step Authorization you'll need to add a Twilio Phone Number to your Amazon Seller Account and provide the API credentials in the settings.
  • 2Captcha - In order to provide automated Captcha Image resolution you'll need to provide the API key in the settings

Installation

$ npm i amazon-sc-business-reports

Basic Usage

const bizReports = require('amazon-sc-business-reports')
const settings = {
    loginEmail: '[email protected]',
    loginPass: 'XXXXXXXXXXXXXXX',
    otp: {
        TWILIO_ACCOUNT_SID: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
        TWILIO_AUTH_TOKEN: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
    },
    captcha: {
        TWOCAPTCHA_API_KEY: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
    }
}
const dates = [
    ['2021-01-26','2021-01-27'] // from,to
]
const options = {}
bizReports(settings,dates,options).then(stream => {
    stream.on('data', (r) => {
        console.log(r)
        // stream pausing example
        stream.pause();
        console.log('There will be no additional data for 5 seconds.');
        setTimeout(() => {
            stream.resume();
        }, 5000);

    })
    stream.on('end', ()=>{
        console.log('done')
    })
})

Settings

Parameters for the settings object:

  • loginEmail - Seller Central login email address or phone number.
  • loginPass - Seller Central login password.
  • otp - Twilio credentials object:
    • TWILIO_ACCOUNT_SID
    • TWILIO_AUTH_TOKEN
  • captcha - 2Captcha credentials object:
    • TWOCAPTCHA_API_KEY

Dates

Reports will be downloaded for all the dates in the parameters.

Dates is an Array of Arrays containing 2-values (From Date, To Date):

// reports per day
[
    ['2021-01-26','2021-01-26'], // from,to
    ['2021-01-27','2021-01-27'], // from,to
]

// report for period
[
    ['2021-01-26','2021-01-27'], // from,to
]

Options

By Default all Reports are downloaded for each Merchant and Marketplace in the Seller Central account. You may Enable or Disable Reports, Merchants and Marketplaces with the options object.

{
    reports: {
        SalesTraffic: true,
        DetailSalesTraffic: false, // exclude this report (for example)
        SellerPerformance: true,
        DetailSalesTrafficBySKU: true,
        DetailSalesTrafficByParent: true,
        DetailSalesTrafficByChild: true,
        BrandPerformance: true
    },
    exclude: {
        merchantIds: [],
        marketplaceIds: [
            'A2EUQ1WTGCTBG2' // exclude Amazon Canada reports (for example)
        ]
    }
}

Reports

Here are some Report Response Examples.

Currencies are returned in the local marketplace currency often prefixed with a 3-digit country code (Example: Can$619.90, MXN$4,829.37).

SalesTraffic:

{
    merchant: 'XXXXXXXXXXXXXX',
    marketplace: 'ATVPDKIKX0DER',
    report: 'SalesTraffic',
    reportId: 'SalesTrafficTimeSeries',
    period: { from: '2021-01-26', to: '2021-01-26' },
    rows: [
        {
            date: '01/26/2021',
            orderedProductSales: '$6,232.32',
            orderedProductSalesB2B: '$264.96',
            unitsOrdered: 68,
            unitsOrderedB2B: 4,
            totalOrderItems: 60,
            totalOrderItemsB2B: 4,
            averageSalesPerOrderItem: '$103.87',
            averageSalesPerOrderItemB2B: '$66.24',
            averageUnitsPerOrderItem: 1.13,
            averageUnitsPerOrderItemB2B: 1,
            averageSellingPrice: '$91.65',
            averageSellingPriceB2B: '$66.24',
            sessions: '1,017',
            orderItemSessionPercentage: '5.90%',
            orderItemSessionPercentageB2B: '0.39%',
            averageOfferCount: 453
        },
        ...
    ]
}

DetailSalesTraffic:

{
    merchant: 'XXXXXXXXXXXXXX',
    marketplace: 'ATVPDKIKX0DER',
    report: 'DetailSalesTraffic',
    reportId: 'DetailSalesTrafficByTime',
    period: { from: '2021-01-26', to: '2021-01-26' },
    rows: [
        {
            date: '01/26/2021',
            orderedProductSales: '$6,232.32',
            orderedProductSalesB2B: '$264.96',
            unitsOrdered: 68,
            unitsOrderedB2B: 4,
            totalOrderItems: 60,
            totalOrderItemsB2B: 4,
            pageViews: '1,410',
            sessions: '1,017',
            buyBoxPercentage: '93%',
            unitSessionPercentage: '6.69%',
            unitSessionPercentageB2B: '0.39%',
            averageOfferCount: 453,
            averageParentItems: 100
        },
        ...
    ]
}

SellerPerformance:

{
    merchant: 'XXXXXXXXXXXXXX',
    marketplace: 'ATVPDKIKX0DER',
    report: 'SellerPerformance',
    reportId: 'SellerPerformanceForMerchants',
    period: { from: '2021-01-26', to: '2021-01-26' },
    rows: [
        {
            date: '01/26/2021',
            orderedProductSales: '$619.90',
            orderedProductSalesB2B: '$0.00',
            unitsOrdered: 12,
            unitsOrderedB2B: 0,
            totalOrderItems: 12,
            totalOrderItemsB2B: 0,
            unitsRefunded: 5,
            refundRate: '41.67%',
            feedbackReceived: 1,
            negativeFeedbackReceived: 0,
            receivedNegativeFeedbackRate: '0.00%',
            aToZClaimsGranted: 0,
            claimsAmount: '$0.00'
        },
        ...
    ]
}

DetailSalesTrafficBySKU:

{
    merchant: 'XXXXXXXXXXXXXX',
    marketplace: 'ATVPDKIKX0DER',
    report: 'DetailSalesTrafficBySKU',
    reportId: 'DetailSalesTrafficBySKU',
    period: { from: '2021-01-26', to: '2021-01-26' },
    rows: [
        {
            parentAsin: 'XXXXXXXXXX',
            childAsin: 'XXXXXXXXXX',
            title: 'Some Product Name (White, S/M)',
            sku: 'ABC-123',
            sessions: 17,
            sessionPercentage: '0.66%',
            pageViews: 21,
            pageViewsPercentage: '0.56%',
            buyBoxPercentage: '62%',
            unitsOrdered: 3,
            unitsOrderedB2B: 1,
            unitSessionPercentage: '17.65%',
            unitSessionPercentageB2B: '5.88%',
            orderedProductSales: '$129.03',
            orderedProductSalesB2B: '$42.79',
            totalOrderItems: 3,
            totalOrderItemsB2B: 1
        },
        ...
    ]
}

DetailSalesTrafficByParent:

{
    merchant: 'XXXXXXXXXXXXXX',
    marketplace: 'ATVPDKIKX0DER',
    report: 'DetailSalesTrafficByParent',
    reportId: 'DetailSalesTrafficByParentItem',
    period: { from: '2021-01-26', to: '2021-01-26' },
    rows: [
        {
            parentAsin: 'XXXXXXXXXX',
            title: '',
            sessions: 69,
            sessionPercentage: '6.78%',
            pageViews: 104,
            pageViewsPercentage: '7.38%',
            buyBoxPercentage: '99%',
            unitsOrdered: 6,
            unitsOrderedB2B: 2,
            unitSessionPercentage: '8.70%',
            unitSessionPercentageB2B: '2.90%',
            orderedProductSales: '$357.77',
            orderedProductSalesB2B: '$127.78',
            totalOrderItems: 6,
            totalOrderItemsB2B: 2
        },
        ...
    ]
}

DetailSalesTrafficByChild:

{
    merchant: 'XXXXXXXXXXXXXX',
    marketplace: 'ATVPDKIKX0DER',
    report: 'DetailSalesTrafficByChild',
    reportId: 'DetailSalesTrafficByChildItem',
    period: { from: '2021-01-26', to: '2021-01-26' },
    rows: [
        {
            parentAsin: 'XXXXXXXXXX',
            childAsin: 'XXXXXXXXXX',
            title: 'Some Product Name (White, S/M)',
            sessions: 7,
            sessionPercentage: '0.69%',
            pageViews: 14,
            pageViewsPercentage: '0.99%',
            buyBoxPercentage: '100%',
            unitsOrdered: 2,
            unitsOrderedB2B: 2,
            unitSessionPercentage: '28.57%',
            unitSessionPercentageB2B: '28.57%',
            orderedProductSales: '$127.78',
            orderedProductSalesB2B: '$127.78',
            totalOrderItems: 2,
            totalOrderItemsB2B: 2
        },
        ...
    ]
}

BrandPerformance:

{
    merchant: 'XXXXXXXXXXXXXX',
    marketplace: 'ATVPDKIKX0DER',
    report: 'BrandPerformance',
    reportId: 'BrandPerformannce',
    period: { from: '2021-01-26', to: '2021-01-26' },
    rows: [
        {
            asin: 'XXXXXXXXXX',
            globalCatalogIdentifier: 'null',
            title: 'Some Product Name (White, S/M)',
            brandName: 'Some Brand',
            averageCustomerReview: 0,
            customerReviewsReceived: 0,
            salesRank: '18,627',
            buyBoxPercentage: '100%'
        },
        ...
    ]
}