Python tool for Amazon competitor sales analysis

Building a Python Tool for Amazon Competitor Sales Analysis with SellerMagnetAPI

By Sarah Davis | August 31, 2025

Introduction

In today's competitive e-commerce landscape, understanding your competitors' sales performance on Amazon is crucial for strategic decision-making. This blog post guides you through building a Python tool using the SellerMagnet API (https://sellermagnet-api.com) to analyze competitor sales, track product performance, and gain actionable insights. This guide is tailored for Amazon businesses, market analysts, and developers looking to leverage data for competitive advantage. SellerMagnet provides enterprise-grade Amazon data, ensuring accuracy and reliability for your analysis.

Why Use a Python Tool for Amazon Sales Analysis?

A custom Python tool offers numerous advantages:

  • Automation: Automate data retrieval and analysis, saving time and resources.
  • Customization: Tailor the analysis to your specific needs and KPIs.
  • Scalability: Handle large datasets and multiple products efficiently.
  • Integration: Seamlessly integrate with other business systems and data warehouses.

Getting Started with SellerMagnetAPI

SellerMagnetAPI (https://sellermagnet-api.com) provides a comprehensive suite of endpoints for accessing Amazon product data. To get started, you'll need an API key, which you can obtain by signing up for a free trial on our Try Free page.

Prerequisites

  • Python 3.6+
  • requests library (install with pip install requests)

Practical Use Cases and Examples

Let's explore some practical use cases using SellerMagnetAPI endpoints.

1. Retrieving Product Statistics

The Amazon Product Statistics endpoint provides detailed information about a specific product, including its sales rank and review counts. This is essential for monitoring product performance over time.

Endpoint Details:

  • Endpoint: /amazon-product-statistics
  • Method: GET

Example Request:

curl --request GET \
  --url 'https://sellermagnet-api.com/amazon-product-statistics?asin=B08N5WRWNW&marketplaceId=A1PA6795UKMFR9&api_key=YOUR_API_KEY'

Python Code:

import requests

api_key = 'YOUR_API_KEY'
asin = 'B08N5WRWNW'
marketplace_id = 'A1PA6795UKMFR9'

url = f'https://sellermagnet-api.com/amazon-product-statistics?asin={asin}&marketplaceId={marketplace_id}&api_key={api_key}'

response = requests.get(url)

if response.status_code == 200:
 data = response.json()
 print(data)
else:
 print(f'Error: {response.status_code}')

Response Example:

{
 "success": true,
 "data": {
 "asin": "B0CLTBHXWQ",
 "amazonPrice": 41800,
 "bestSellerRank": 15,
 "buyBoxPrice": 41800,
 "buyBoxFulfillment": "FBM",
 "buyBoxSellerIdHistory": [
 ["2025-06-14 17:08:00", "A2I59UVTUWUFH0"]
 ],
 "salesRankHistory": [
 ["2025-06-14 01:58:00", 15]
 ],
 "trackingSince": "2023-12-30"
 }
}

Use Case:

Track the bestSellerRank and salesRankHistory over time to identify trends and patterns in product popularity. This helps in inventory management and marketing campaign optimization.

2. Converting ASINs to EANs

The Amazon ASIN Converter endpoint allows you to convert between ASIN and EAN identifiers, which can be useful for cross-referencing product information across different platforms.

Endpoint Details:

  • Endpoint: /amazon-asin-converter
  • Method: GET

Example Request:

curl --request GET \
  --url 'https://sellermagnet-api.com/amazon-asin-converter?asin=B08N5WRWNW&marketplaceId=A1PA6795UKMFR9&conversion_direction=asin-to-ean&api_key=YOUR_API_KEY'

Python Code:

import requests

api_key = 'YOUR_API_KEY'
asin = 'B08N5WRWNW'
marketplace_id = 'A1PA6795UKMFR9'
conversion_direction = 'asin-to-ean'

url = f'https://sellermagnet-api.com/amazon-asin-converter?asin={asin}&marketplaceId={marketplace_id}&conversion_direction={conversion_direction}&api_key={api_key}'

response = requests.get(url)

if response.status_code == 200:
 data = response.json()
 print(data)
else:
 print(f'Error: {response.status_code}')

Response Example:

{
 "success": true,
 "data": {
 "asin": "B0CLTBHXWQ",
 "eanList": ["0711719577294"],
 "listedSince": "2023-12-30 01:00:00",
 "productTitle": "Playstation 5 Console Edizione Digital Slim"
 }
}

Use Case:

Use this endpoint to find the EANs associated with a competitor's ASIN, allowing you to track their products on other e-commerce platforms.

3. Analyzing Seller Reviews

The Amazon Seller Review endpoint retrieves review details for a specific seller. This is critical for assessing the reputation and reliability of competitors.

Endpoint Details:

  • Endpoint: /amazon-seller-review
  • Method: GET

Example Request:

curl --request GET \
  --url 'https://sellermagnet-api.com/amazon-seller-review?sellerId=A1CWSGXIR635I6&marketplaceId=ATVPDKIKX0DER&api_key=YOUR_API_KEY'

Python Code:

import requests

api_key = 'YOUR_API_KEY'
seller_id = 'A1CWSGXIR635I6'
marketplace_id = 'ATVPDKIKX0DER'

url = f'https://sellermagnet-api.com/amazon-seller-review?sellerId={seller_id}&marketplaceId={marketplace_id}&api_key={api_key}'

response = requests.get(url)

if response.status_code == 200:
 data = response.json()
 print(data)
else:
 print(f'Error: {response.status_code}')

Response Example:

{
 "success": true,
 "data": {
 "marketplace": {
 "ATVPDKIKX0DER": {
 "last5Reviews": [
 {
 "dateRated": "By gary kraus on June 5, 2025.",
 "reviewText": "great",
 "starRating": "5 out of 5 stars"
 }
 ],
 "sellerFeedback": {
 "30": {
 "rating": "3.3",
 "reviewsCount": "7"
 },
 "90": {
 "rating": "3.6",
 "reviewsCount": "30"
 }
 }
 }
 },
 "sellerId": "A1CWSGXIR635I6"
 }
}

Use Case:

Monitor competitor seller feedback to identify potential issues and opportunities to improve your own seller performance. Analyze review trends to understand customer satisfaction levels.

4. Looking Up Product Details

The Amazon Product Lookup endpoint retrieves detailed product information for a given ASIN, including title, description, and key features.

Endpoint Details:

  • Endpoint: /amazon-product-lookup
  • Method: GET

Example Request:

curl --request GET \
  --url 'https://sellermagnet-api.com/amazon-product-lookup?asin=B0CL61F39H&marketplaceId=ATVPDKIKX0DER&api_key=YOUR_API_KEY'

Python Code:

import requests

api_key = 'YOUR_API_KEY'
asin = 'B0CL61F39H'
marketplace_id = 'ATVPDKIKX0DER'

url = f'https://sellermagnet-api.com/amazon-product-lookup?asin={asin}&marketplaceId={marketplace_id}&api_key={api_key}'

response = requests.get(url)

if response.status_code == 200:
 data = response.json()
 print(data)
else:
 print(f'Error: {response.status_code}')

Response Example:

{
 "success": true,
 "data": {
 "productInfo": {
 "asin": "B0CL61F39H",
 "title": "PlayStation",
            
Back to Blog