Python Dashboard for Amazon Inventory Insights with SellerMagnetAPI

Building a Python Dashboard for Amazon Inventory Insights with SellerMagnetAPI

By Alex Rodriguez | July 17, 2025

Building a Python Dashboard for Amazon Inventory Insights with SellerMagnetAPI

In today's competitive e-commerce landscape, Amazon businesses and market analysts require robust tools for real-time inventory management, competitive analysis, and comprehensive market research. Building a Python dashboard integrated with SellerMagnetAPI can provide these critical insights, enabling data-driven decisions and strategic advantages. SellerMagnetAPI offers an enterprise-grade solution for accessing and analyzing Amazon data, giving you a significant edge in optimizing your Amazon business.

Why Build a Python Dashboard?

Python, with its powerful data analysis libraries (like Pandas, NumPy, and Plotly/Dash), offers an ideal environment for creating custom dashboards. By leveraging SellerMagnetAPI, you can build a dashboard that:

  • Provides real-time inventory tracking.
  • Monitors competitor pricing and stock levels.
  • Visualizes sales trends and patterns.
  • Supports data-driven decision-making.

Getting Started with SellerMagnetAPI

Before diving into the code, ensure you have an active SellerMagnetAPI subscription. You can Try Free. Once you have your API key, install the necessary Python libraries:


pip install pandas requests plotly dash

Practical Use Cases and Examples

1. Amazon Product Statistics Dashboard

The Amazon Product Statistics endpoint provides detailed information about specific products, including sales rank and review counts. This is invaluable for tracking your product's performance and understanding market trends.

Endpoint: /amazon-product-statistics

Method: GET

Parameters:

  • asin (required): Product ASIN (e.g., "B08N5WRWNW")
  • marketplaceId (required): Marketplace ID (e.g., "A1PA6795UKMFR9")
  • api_key (required): Your API key
  • graphs (optional): Generate visually graphs for history data

Python Code Example:


import requests
import pandas as pd
import plotly.graph_objects as go
import dash
from dash import dcc
from dash import html

# Replace with your actual API key and product details
API_KEY = "YOUR_API_KEY"
ASIN = "B08N5WRWNW"
MARKETPLACE_ID = "A1PA6795UKMFR9"

# API endpoint
url = f"https://sellermagnet-api.com/amazon-product-statistics?asin={ASIN}&marketplaceId={MARKETPLACE_ID}&api_key={API_KEY}&graphs=true"

try:
    response = requests.get(url)
    response.raise_for_status()  # Raise HTTPError for bad responses (4xx or 5xx)
    data = response.json()

    if data['success']:
        product_data = data['data']
        print(product_data)
    else:
        print(f"Error: {data.get('errors', 'Unknown error')}")

except requests.exceptions.RequestException as e:
    print(f"Request failed: {e}")
except ValueError as e:
    print(f"JSON decoding failed: {e}")

# Create a pandas DataFrame from the sales rank history
sales_rank_data = product_data['salesRankHistory']
sales_rank_df = pd.DataFrame(sales_rank_data, columns=['timestamp', 'salesRank'])
sales_rank_df['timestamp'] = pd.to_datetime(sales_rank_df['timestamp'])
sales_rank_df['salesRank'] = pd.to_numeric(sales_rank_df['salesRank'], errors='coerce')

# Create a pandas DataFrame from the price history
price_history_data = product_data['stats']['buyBoxPriceHistory']
price_history_df = pd.DataFrame(price_history_data, columns=['timestamp', 'buyBoxPrice'])
price_history_df['timestamp'] = pd.to_datetime(price_history_df['timestamp'])
price_history_df['buyBoxPrice'] = pd.to_numeric(price_history_df['buyBoxPrice'], errors='coerce')

# Create sales rank chart
sales_rank_fig = go.Figure(data=[
    go.Scatter(x=sales_rank_df['timestamp'], y=sales_rank_df['salesRank'], mode='lines', name='Sales Rank')
])
sales_rank_fig.update_layout(title='Sales Rank History', xaxis_title='Date', yaxis_title='Sales Rank')

# Create price chart
price_fig = go.Figure(data=[
    go.Scatter(x=price_history_df['timestamp'], y=price_history_df['buyBoxPrice'], mode='lines', name='Buy Box Price')
])
price_fig.update_layout(title='Buy Box Price History', xaxis_title='Date', yaxis_title='Price (cents)')

# Initialize the Dash app
app = dash.Dash(__name__)

# Define the layout of the dashboard
app.layout = html.Div(children=[
    html.H1(children='Amazon Product Dashboard'),

    html.Div(children='''
        Dashboard to visualize Amazon product statistics using SellerMagnetAPI.
    '''),

    dcc.Graph(
        id='sales-rank-chart',
        figure=sales_rank_fig
    ),

    dcc.Graph(
        id='price-chart',
        figure=price_fig
    )
])

# Run the app
if __name__ == '__main__':
    app.run_server(debug=True)

Response Example:


{
  "success": true,
  "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
        ]
      ]
    }
  }
}

This Python code fetches product statistics from SellerMagnetAPI and visualizes the data using Plotly and Dash. You can extend this basic code to create more advanced charts and integrate additional data points.

2. Amazon Product Offers Dashboard

Use the Amazon Product Offers endpoint to monitor competitor pricing, seller information, and inventory levels. This data can inform your pricing strategies and inventory decisions.

Endpoint: /amazon-product-offers

Method: GET

Parameters:

  • asin (required): Product ASIN (e.g., 'B08N5WRWNW')
  • marketplaceId (required): Marketplace ID (e.g., 'A1PA6795UKMFR9')
  • geo_location (optional): Detailed Geo Location ZIP CODE
  • api_key (required): Your API key

Python Code Example:


import requests
import pandas as pd
import dash
from dash import dcc
from dash import html
from dash.dependencies import Input, Output
import plotly.express as px

# Replace with your actual API key and product details
API_KEY = "YOUR_API_KEY"
ASIN = "B08N5WRWNW"
MARKETPLACE_ID = "A1PA6795UKMFR9"

# API endpoint
url = f"https://sellermagnet-api.com/amazon-product-offers?asin={ASIN}&marketplaceId={MARKETPLACE_ID}&api_key={API_KEY}"

try:
    response = requests.get(url)
    response.raise_for_status()
    data = response.json()

    if data['success']:
        product_offers = data['data']['offers']
        print(product_offers)
    else:
        print(f"Error: {data.get('errors', 'Unknown error')}")

except requests.exceptions.RequestException as e:
    print(f"Request failed: {e}")
except ValueError as e:
    print(f"JSON decoding failed: {e}")

# Convert offers data to DataFrame
offers_df = pd.DataFrame(product_offers)

# Initialize Dash app
app = dash.Dash(__name__)

# Define layout
app.layout = html.Div([
    html.H1("Amazon Product Offers Dashboard"),
    dcc.Graph(id='offers-bar-chart'),
    dcc.Dropdown(
        id='condition-dropdown',
        options=[{'label': i, 'value': i} for i in offers_df['condition'].unique()],
        value=offers_df['condition'].unique()[0],
        multi=False
    )
])

# Define callback to update chart
@app.callback(
    Output('offers-bar-chart', 'figure'),
    [Input('condition-dropdown', 'value')]
)
def update_chart(selected_condition):
    filtered_df = offers_df[offers_df['condition'] == selected_condition]
    fig = px.bar(filtered_df, x='sellerName', y='totalPrice', title=f'Offers for {selected_condition} Condition')
    return fig

# Run app
if __name__ == '__main__':
    app.run_server(debug=True)

Response Example:


{
  "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
      },
      {
        "condition": "Used - Good",
        "deliveryDate": "2025-06-26",
        "fulfillmentType": "FBM",
        "inventory": 1,
        "positivePercentage": 87,
        "priceWithoutShipping": 409.99,
        "sellerId": "A1YU28SVL05CUG",
        "sellerName": "premier liquidation",
        "shippingPrice": 9.84,
        "totalPrice": 419.83,
        "totalReviews": 1177
      }
    ],
    "productLink": "https://www.amazon.com/dp/B0CL61F39H",
    "productMainImage": "https://m.media-amazon.com/images/I/31kTNmpm6vL.jpg",
    "productTitle": "PlayStation
c5 console (slim)"
  },
  "success": true
}

This code provides a basic framework for retrieving and visualizing product offer data. You can expand on this to include features like filtering by seller, sorting by price, and displaying historical pricing data.

Additional Endpoints and Use Cases

Benefits of Using SellerMagnetAPI

  • Enterprise-Grade Data: Access reliable and accurate Amazon data.
  • Real-Time Insights: Monitor market changes and inventory levels in real-time.
  • Scalable Solution: Handle large volumes of data efficiently.
  • Customizable Dashboards: Tailor your dashboards to meet your specific business needs.

Conclusion

Building a Python dashboard with SellerMagnetAPI empowers Amazon businesses and market analysts with the tools they need to succeed in a competitive environment. By leveraging the power of Python and the comprehensive data provided by SellerMagnetAPI, you can gain actionable insights, optimize your strategies, and drive growth.

To get started, visit SellerMagnetAPI and explore our Documentation, Code Examples, and Pricing options. Don't forget to check our API Status page for updates. If you have any questions, please Contact us. Also, check out our Glossary and Blog for more information.

Back to Blog