Unlock Amazon Market Insights with a Python Dashboard and SellerMagnetAPI
For Amazon businesses and market analysts, staying ahead of market trends is crucial. With SellerMagnetAPI (https://sellermagnet-api.com), you can build a powerful Python dashboard to visualize and analyze critical Amazon data. This post guides you through the process, showcasing how to leverage SellerMagnetAPI for competitive analysis, inventory management, and market research.
This blog post thumbnail will be auto-generated using SellerMagnet’s internal image generation API.
Why Build an Amazon Market Trends Dashboard?
A custom dashboard offers several advantages:
- Real-time Insights: Monitor product performance, pricing, and reviews as they change.
- Competitive Analysis: Track competitors' products, offers, and seller reviews.
- Data-Driven Decisions: Make informed decisions on inventory, pricing, and marketing strategies.
- Customization: Tailor the dashboard to your specific needs and KPIs.
Prerequisites
Before you begin, ensure you have:
- A SellerMagnetAPI account and API key.
- Python 3.6+ installed.
- Required Python libraries:
pandas,plotly,requests, anddash. Install them using pip:
pip install pandas plotly requests dash
Step-by-Step Guide to Building Your Dashboard
1. Setting Up Your Python Environment
Create a new Python file (e.g., amazon_dashboard.py) and import the necessary libraries:
import pandas as pd
import plotly.express as px
import requests
import dash
import dash_core_components as dcc
import dash_html_components as html
from datetime import datetime
# Replace with your actual API key and Marketplace ID
API_KEY = "YOUR_API_KEY"
MARKETPLACE_ID = "ATVPDKIKX0DER" # US Marketplace
2. Fetching Amazon Product Data with SellerMagnetAPI
Use the Amazon Product Statistics endpoint to retrieve detailed product data. Here's an example:
def get_product_data(asin):
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 HTTPError for bad responses (4xx or 5xx)
return response.json()
# Example ASIN
ASIN = "B08N5WRWNW"
product_data = get_product_data(ASIN)
if product_data["success"]:
print("Data fetched successfully!")
print(product_data)
else:
print("Error fetching data:", product_data)
Example Response:
{
"success": true,
"data": {
"asin": "B08N5WRWNW",
"amazonPrice": 59900,
"bestSellerRank": 1,
"buyBoxPrice": 59900,
"buyBoxFulfillment": "AMZ",
"buyBoxSellerIdHistory": [
[
"2024-10-26T12:00:00",
"Amazon"
],
[
"2024-10-27T12:00:00",
"A1AAAAAAA"
]
],
"salesRankHistory": [
[
"2024-10-26T12:00:00",
1
],
[
"2024-10-27T12:00:00",
2
]
],
"trackingSince": "2023-01-01",
"graphs": {
"priceTrend": [
{
"timestamp": "2024-10-26T12:00:00",
"price": 59900
},
{
"timestamp": "2024-10-27T12:00:00",
"price": 60900
}
],
"rankTrend": [
{
"timestamp": "2024-10-26T12:00:00",
"rank": 1
},
{
"timestamp": "2024-10-27T12:00:00",
"rank": 2
}
]
},
"metadata": {
"category": "Electronics",
"lastUpdated": "2024-10-27T12:00:00"
}
}
}
3. Data Extraction and Transformation
Extract relevant data from the API response and transform it into a Pandas DataFrame for easier manipulation:
def create_dataframe(product_data):
if not product_data["success"]:
return pd.DataFrame()
data = product_data["data"]
# Convert history data to DataFrames
price_df = pd.DataFrame(data["graphs"]["priceTrend"], columns=["timestamp", "price"])
rank_df = pd.DataFrame(data["graphs"]["rankTrend"], columns=["timestamp", "rank"])
# Convert timestamps to datetime objects
price_df["timestamp"] = pd.to_datetime(price_df["timestamp"])
rank_df["timestamp"] = pd.to_datetime(rank_df["timestamp"])
return price_df, rank_df
price_df, rank_df = create_dataframe(product_data)
if not price_df.empty and not rank_df.empty:
print("DataFrames created successfully!")
print("Price Data:\n", price_df.head())
print("\nRank Data:\n", rank_df.head())
else:
print("Failed to create DataFrames.")
4. Building the Dashboard Layout with Dash
Define the layout of your dashboard using Dash components:
app = dash.Dash(__name__)
app.layout = html.Div([
html.H1(children=f"Amazon Market Trends Dashboard - ASIN: {ASIN}"),
html.Div(children='''
Visualizing Amazon product data using SellerMagnetAPI.
'''),
dcc.Graph(id='price-trend-graph'),
dcc.Graph(id='rank-trend-graph'),
])
5. Creating Interactive Plots with Plotly
Use Plotly to create interactive charts and graphs from your data:
@app.callback(
dash.Output('price-trend-graph', 'figure'),
[dash.Input('price-trend-graph', 'id')]
)
def update_price_graph(id):
if price_df.empty:
return {
'data': [],
'layout': {
'title': 'Price Trend Data Not Available'
}
}
fig = px.line(price_df, x="timestamp", y="price", title="Price Trend")
return fig
@app.callback(
dash.Output('rank-trend-graph', 'figure'),
[dash.Input('rank-trend-graph', 'id')]
)
def update_rank_graph(id):
if rank_df.empty:
return {
'data': [],
'layout': {
'title': 'Rank Trend Data Not Available'
}
}
fig = px.line(rank_df, x="timestamp", y="rank", title="Rank Trend")
fig.update_yaxes(autorange="reversed") # Lower rank is better
return fig
6. Running the Dashboard
Run the Dash app to start your dashboard:
if __name__ == '__main__':
app.run_server(debug=True)
Advanced Use Cases
1. Integrating Seller Review Data
Incorporate seller review data using the Amazon Seller Review endpoint for a comprehensive view of seller performance:
def get_seller_review_data(seller_id):
url = f"https://sellermagnet-api.com/amazon-seller-review?sellerId={seller_id}&marketplaceId={MARKETPLACE_ID}&api_key={API_KEY}"
response = requests.get(url)
response.raise_for_status()
return response.json()
Example Response:
{
"success": true,
"data": {
"marketplace": {
"ATVPDKIKX0DER": {
"last5Reviews": [
{
"dateRated": "By gary kraus on June 5, 2025.",
"reviewText": "great",
"starRating": "5 out of 5 stars"
},
{
"dateRated": "By Amazon Customer on June 5, 2025.",
"reviewText": "Ok",
"starRating": "5 out of 5 stars"
},
{
"dateRated": "By Graciela Casta\u00f1eda on May 21, 2025.",
"reviewText": "Excelente",
"starRating": "5 out of 5 stars"
}
],
"sellerFeedback": {
"30": {
"rating": "3.3",
"reviewsCount": "7"
},
"90": {
"rating": "3.6",
"reviewsCount": "30"
},
"365": {
"rating": "3.9",
"reviewsCount": "114"
},
"lifetime": {
"rating": "4.5",
"reviewsCount": "1,535"
}
}
}
},
"sellerId": "A1CWSGXIR635I6"
}
}
2. Monitoring Product Offers and Pricing
Use the Amazon Product Offers endpoint to track pricing and availability from different sellers:
def get_product_offers(asin):
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()
return response.json()
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\u00ae5 console (slim)"
},
"success": true
}
3. Utilizing Additional SellerMagnetAPI Endpoints
Explore other SellerMagnetAPI endpoints to enhance your dashboard:
- Amazon Product Lookup: Get detailed product information.
- Search Amazon: Search for products and analyze search result trends.
- Amazon Bestsellers: Track top-selling products in specific categories.
- Amazon ASIN/ISBN/EAN Converter: Convert product identifiers.
- Amazon Product Estimate Sales: Estimate sales volume for products.
Conclusion
Building a Python dashboard with SellerMagnetAPI empowers you to harness Amazon market trends effectively. By leveraging real-time data and customizable visualizations, you can gain a competitive edge, optimize inventory, and make data-driven decisions.
Get started today with a free trial and unlock the power of Amazon data with SellerMagnetAPI. Check out our Documentation and Code Examples for more information. If you have any questions, please Contact us.