Python Dashboard for Amazon Inventory Trends

Building a Python Dashboard for Amazon Inventory Trends with SellerMagnetAPI

By Sarah Davis | September 16, 2025

Introduction

In today's competitive e-commerce landscape, understanding Amazon inventory trends is crucial for businesses aiming to optimize their strategies. With the SellerMagnetAPI, you can unlock powerful data insights and build custom dashboards to monitor inventory, track competitor activities, and make data-driven decisions.

This blog post demonstrates how to build a Python-based dashboard to visualize Amazon inventory trends using the SellerMagnetAPI. This enterprise-focused approach provides actionable insights for competitive analysis, efficient inventory management, and comprehensive market research.

Note: The thumbnail for this blog post will be auto-generated using SellerMagnet’s internal image generation API.

Why Build an Amazon Inventory Dashboard?

A custom dashboard provides a tailored view of the metrics that matter most to your business. Here’s why building one with SellerMagnetAPI is advantageous:

  • Real-time Data: Access up-to-date information on product pricing, sales rank, and seller activities.
  • Competitive Insights: Monitor competitor inventory levels and pricing strategies.
  • Data-Driven Decisions: Make informed decisions about restocking, pricing adjustments, and promotional campaigns.
  • Customization: Tailor the dashboard to display specific metrics and visualizations relevant to your business needs.

Setting Up Your Python Environment

Before diving into the code, ensure you have Python installed along with the necessary libraries. We recommend using a virtual environment to manage dependencies.

python -m venv venv
source venv/bin/activate  # On Linux/macOS
.\venv\Scripts\activate  # On Windows
pip install requests pandas matplotlib

Connecting to SellerMagnetAPI

To begin, you'll need to sign up for a SellerMagnetAPI account and obtain your API key. This key is essential for authenticating your requests.

Fetching Product Statistics

The Amazon Product Statistics endpoint provides detailed information about a specific product, including its sales rank and review counts. Here’s how to use it:

import requests
import pandas as pd
import matplotlib.pyplot as plt

API_KEY = 'YOUR_API_KEY'
ASIN = 'B0CLTBHXWQ'  # Example ASIN
MARKETPLACE_ID = 'APJ6JRA9NG5V4'  # Example Marketplace ID

def get_product_statistics(asin, marketplace_id, api_key):
    url = f'https://sellermagnet-api.com/amazon-product-statistics?asin={asin}&marketplaceId={marketplace_id}&api_key={api_key}&graphs=true'
    response = requests.get(url)
    response.raise_for_status()  # Raise an exception for HTTP errors
    return response.json()

product_data = get_product_statistics(ASIN, MARKETPLACE_ID, API_KEY)

if product_data['success']:
    print("API request successful!")
    print(product_data)
else:
    print("API request failed.")

Example Response:

{
  "data": {
    "asin": "B0CLTBHXWQ",
    "productTitle": "Playstation 5 Console Edizione Digital Slim",
    "buyBoxPrice": 41800,
    "buyBoxFulfillment": "FBM",
    "buyBoxSellerIdHistory": [
      [
        "2025-06-14 17:08:00",
        "A2I59UVTUWUFH0"
      ]
    ],
    "categoryTree": [
      {
        "catId": 412603031,
        "name": "Videogiochi"
      },
      {
        "catId": 20904349031,
        "name": "PlayStation 5"
      },
      {
        "catId": 20904364031,
        "name": "Console"
      }
    ],
    "graphs": {
      "amazonAsSellerPriceHistory": "https://sellermagnet-api-webspace.s3.eu-central-1.amazonaws.com/amazon/api/charts/B0CLTBHXWQ/1749913774/B0CLTBHXWQ_amazon_price_1749913773.png",
      "lowestFBAPriceHistory": "https://sellermagnet-api-webspace.s3.eu-central-1.amazonaws.com/amazon/api/charts/B0CLTBHXWQ/1749913776/B0CLTBHXWQ_fba_price_1749913773.png",
      "lowestFBMPriceHistory": "https://sellermagnet-api-webspace.s3.eu-central-1.amazonaws.com/amazon/api/charts/B0CLTBHXWQ/1749913775/B0CLTBHXWQ_fbm_price_1749913773.png",
      "monthlySoldHistory": "https://sellermagnet-api-webspace.s3.eu-central-1.amazonaws.com/amazon/api/charts/B0CLTBHXWQ/1749913778/B0CLTBHXWQ_monthly_sold_1749913773.png",
      "productRatingHistory": "https://sellermagnet-api-webspace.s3.eu-central-1.amazonaws.com/amazon/api/charts/B0CLTBHXWQ/1749913777/B0CLTBHXWQ_rating_1749913773.png"
    },
    "listedSince": "2023-12-30 01:00:00",
    "lowestFBAPrice": 44999,
    "lowestFBMPrice": 41700,
    "marketplaceId": "APJ6JRA9NG5V4",
    "marketplaceNewPriceHistory": [
      [
        "2025-06-14",
        41700
      ]
    ],
    "offers": {
      "A11IL2PNWYJU7H": {
        "isFBA": true,
        "lastUpdated": "2025-06-14 17:08:00",
        "priceHistory": [
          [
            "2025-06-14 06:22:00",
            44999,
            0
          ]
        ],
        "stockHistory": [
          [
            "2025-05-29 11:32:00",
            1
          ]
        ]
      },
      "A12FLY25DT7QO0": {
        "isFBA": false,
        "lastUpdated": "2025-06-14 17:08:00",
        "priceHistory": [
          [
            "2025-06-09 15:32:00",
            41800,
            0
          ]
        ],
        "stockHistory": [
          [
            "2025-06-14 13:34:00",
            49
          ]
        ]
      },
      "A18KSDUE00UP6J": {
        "isFBA": false,
        "lastUpdated": "2025-06-14 17:08:00",
        "priceHistory": [
          [
            "2025-05-29 11:32:00",
            42890,
            0
          ]
        ],
        "stockHistory": [
          [
            "2025-05-30 18:30:00",
            3
          ]
        ]
      }
    },
    "productReviewAverage": 4.7,
    "productTotalReviews": 3129,
    "rootCategory": {
      "id": 412603031,
      "name": "Videogiochi"
    },
    "stats": {
      "amazonAsSellerPriceHistory": [
        [
          "2025-06-14",
          44999
        ]
      ],
      "buyBoxPriceHistory": [
        [
          "2025-06-13",
          41700
        ]
      ],
      "monthlySoldHistory": [
        [
          "2025-06",
          1000
        ]
      ],
      "productRatingCountHistory": [
        [
          "2025-06-14 15:28:00",
          3129
        ]
      ],
      "productRatingHistory": [
        [
          "2025-02-02 01:30:00",
          4.7
        ]
      ],
      "salesRankHistory": [
        [
          "2025-06-14 01:58:00",
          15
        ]
      ]
    }
  },
  "success": true
}

Fetching Amazon Product Offers

The Amazon Product Offers endpoint enables retrieval of offer listings for a specific product. This includes pricing, seller details, condition, and inventory information.

import requests

API_KEY = 'YOUR_API_KEY'
ASIN = 'B0CL61F39H'  # Example ASIN
MARKETPLACE_ID = 'ATVPDKIKX0DER'  # Example Marketplace ID

def get_product_offers(asin, marketplace_id, api_key):
    url = f'https://sellermagnet-api.com/amazon-product-offers?asin={asin}&marketplaceId={marketplace_id}&api_key={api_key}'
    response = requests.get(url)
    response.raise_for_status()  # Raise an exception for HTTP errors
    return response.json()

product_offers_data = get_product_offers(ASIN, MARKETPLACE_ID, API_KEY)

if product_offers_data['success']:
    print("API request successful!")
    print(product_offers_data)
else:
    print("API request failed.")

Example Response:

{
  "data": {
    "asin": "B0CL61F39H",
    "buyBox": {
      "condition": "New",
      "deliveryDate": "2025-06-28",
      "fulfillmentType": "FBA",
      "inventory": 30,
      "positivePercentage": 0,
      "priceWithoutShipping": 499,
      "sellerId": "Amazon",
      "sellerName": "Amazon",
      "shippingPrice": 0,
      "totalPrice": 499,
      "totalReviews": 0
    },
    "currency": {
      "code": "USD",
      "name": "United States Dollar",
      "symbol": "$"
    },
    "marketplaceId": "ATVPDKIKX0DER",
    "offers": [
      {
        "condition": "New",
        "deliveryDate": "2025-06-28",
        "fulfillmentType": "FBA",
        "inventory": 30,
        "positivePercentage": 0,
        "priceWithoutShipping": 499,
        "sellerId": "Amazon",
        "sellerName": "Amazon",
        "shippingPrice": 0,
        "totalPrice": 499,
        "totalReviews": 0
      },
      {
        "condition": "Used - Very Good",
        "deliveryDate": "2025-07-07",
        "fulfillmentType": "FBM",
        "inventory": 10,
        "positivePercentage": 78,
        "priceWithoutShipping": 409.99,
        "sellerId": "A17J18A7XABQI9",
        "sellerName": "PRICE 2 SAVE",
        "shippingPrice": 0,
        "totalPrice": 409.99,
        "totalReviews": 6892
      },
    ],
    "productLink": "https://www.amazon.com/dp/B0CL61F39H",
    "productMainImage": "https://m.media-amazon.com/images/I/31kTNmpm6vL.jpg",
    "productTitle": "PlayStation

5 console (slim)"
  },
  "success": true
}

Building the Dashboard

To create a basic dashboard, we’ll use the data fetched from the SellerMagnetAPI. The examples below showcase how to create simple plots for visualizing data.

Visualizing Sales Rank History

Extract sales rank history from the API response and plot it using Matplotlib:

def plot_sales_rank_history(product_data):
    if not product_data['success']:
        print("No sales rank history available.")
        return

    sales_rank_history = product_data['data']['stats']['salesRankHistory']
    if not sales_rank_history:
      print("No sales rank history available.")
      return

    df = pd.DataFrame(sales_rank_history, columns=['timestamp', 'salesRank'])
    df['timestamp'] = pd.to_datetime(df['timestamp'])
    df.set_index('timestamp', inplace=True)

    plt.figure(figsize=(12, 6))
    plt.plot(df.index, df['salesRank'], label='Sales Rank')
    plt.xlabel('Time')
    plt.ylabel('Sales Rank')
    plt.title('Sales Rank History')
    plt.legend()
    plt.gca().invert_yaxis()  # Invert y-axis to show better ranks at the top
    plt.grid(True)
    plt.show()

plot_sales_rank_history(product_data)

Visualizing Buy Box Price History

Similarly, visualize the Buy Box price history to monitor pricing trends:

def plot_buy_box_price_history(product_data):
    if not product_data['success']:
        print("No buy box price history available.")
        return

    buy_box_price_history = product_data['data']['stats']['buyBoxPriceHistory']

    if not buy_box_price_history:
      print("No buy box price history available.")
      return

    df = pd.DataFrame(buy_box_price_history, columns=['timestamp', 'buyBoxPrice'])
    df['timestamp'] = pd.to_datetime(df['timestamp'])
    df.set_index('timestamp', inplace=True)

    plt.figure(figsize=(12, 6))
    plt.plot(df.index, df['buyBoxPrice'], label='Buy Box Price')
    plt.xlabel('Time')
    plt.ylabel('Price (in cents)')
    plt.title('Buy Box Price History')
    plt.legend()
    plt.grid(True)
    plt.show()

plot_buy_box_price_history(product_data)

Enhancing the Dashboard

To create a more comprehensive dashboard, consider integrating these enhancements:

  • Data Aggregation: Combine data from multiple products to identify broader trends.
  • Automated Updates: Use a scheduler (like DataPipeline) to update the data regularly.
  • Interactive Elements: Implement interactive filters and selectors using libraries like Dash or Streamlit.
  • Geolocation Data: Incorporate Geolocation to analyze regional trends.

Additional SellerMagnetAPI Endpoints

SellerMagnetAPI offers a range of endpoints for deeper insights:

Conclusion

Building a Python dashboard with SellerMagnetAPI empowers businesses to gain actionable insights into Amazon inventory trends. By leveraging real-time data and custom visualizations, you can optimize inventory management, stay ahead of competitors, and drive revenue growth.

Start building your custom Amazon inventory dashboard today with SellerMagnetAPI! Check our Pricing and don't forget to Try Free.

Back to Blog