SellerMagnet API Python tool for Amazon Competitor Listing Analysis

Building a Python Tool for Amazon Competitor Listing Analysis with SellerMagnetAPI

By Alex Rodriguez | July 19, 2025

Building a Python Tool for Amazon Competitor Listing Analysis with SellerMagnetAPI

In the competitive landscape of Amazon, staying ahead requires more than just listing products. It demands strategic insights into competitor activities, pricing trends, and market dynamics. This blog post will guide you through building a Python tool leveraging the SellerMagnet API for comprehensive Amazon competitor listing analysis. This tool will empower you to make data-driven decisions, optimize inventory, and refine your market research strategies.

Why Use SellerMagnetAPI for Amazon Competitor Analysis?

SellerMagnetAPI provides real-time, accurate, and structured data directly from Amazon. Unlike web scraping, which can be unreliable and legally risky, SellerMagnetAPI offers a stable, scalable, and legally compliant solution for accessing critical Amazon data. By using SellerMagnetAPI, businesses gain a significant advantage in monitoring competitors, understanding market trends, and making informed decisions. Amazon Web Scraping can be replaced by the SellerMagnetAPI.

Setting Up Your Python Environment

Before diving into the code, ensure you have Python installed (preferably version 3.6 or higher). You'll also need to install the `requests` library for making HTTP requests:

pip install requests

Practical Use Cases and Code Examples

Let's explore several practical use cases for analyzing competitor listings using SellerMagnetAPI.

1. Fetching Product Statistics

The Amazon Product Statistics endpoint allows you to retrieve detailed information about a specific product, including its sales rank, review counts, and pricing history. This is crucial for understanding how well a competitor's product is performing.

Example: Retrieving product statistics for a specific ASIN:

import requests

api_key = 'YOUR_API_KEY'
asin = 'B08N5WRWNW'
marketplace_id = 'ATVPDKIKX0DER'  # US Marketplace

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",
    "graphs": {
      "priceTrend": [
        {
          "timestamp": "2025-06-14T17:08:00",
          "price": 41800
        }
      ],
      "rankTrend": [
        {
          "timestamp": "2025-06-14T17:08:00",
          "rank": 15
        }
      ]
    },
    "metadata": {
      "category": "Playstation 5"
    }
  }
}

This provides insights into the product's current price, sales rank, who holds the Buy Box, and historical data to track trends over time. Consider using the `graphs=true` option to generate visually compelling graphs for historical data.

2. Identifying Competitors with Amazon Search API

The Amazon Search endpoint allows you to search for products on Amazon using keywords. This is useful for identifying competitor products based on relevant search terms.

Example: Searching for "Playstation 5" on Amazon:

import requests

api_key = 'YOUR_API_KEY'
query = 'Playstation 5'
marketplace_id = 'ATVPDKIKX0DER'  # US Marketplace

url = f'https://sellermagnet-api.com/amazon-search?q={query}&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": {
    "searchResults": [
      {
        "asin": "B0CL5KNB9M",
        "discount_info": "",
        "link": "https://www.amazon.com/dp/B0CL5KNB9M",
        "listingPrice": {
          "price": {
            "currency_code": "USD",
            "currency_name": "United States Dollar",
            "currency_symbol": "$",
            "total": "449.00"
          }
        },
        "mainImage": "https://m.media-amazon.com/images/I/51fM0CKG+HL._AC_UY218_.jpg",
        "on_sale": false,
        "position": 1,
        "productTitle": "PlayStation\u00ae5 Digital Edition (slim)",
        "reviewAmount": 7209,
        "reviewRating": 4.7,
        "sponsored": false
      },
      {
        "asin": "B0DGY63Z2H",
        "discount_info": "",
        "link": "https://www.amazon.com/dp/B0DGY63Z2H",
        "listingPrice": {
          "price": {
            "currency_code": "USD",
            "currency_name": "United States Dollar",
            "currency_symbol": "$",
            "total": "699.00"
          }
        },
        "mainImage": "https://m.media-amazon.com/images/I/61vR3ovb2UL._AC_UY218_.jpg",
        "on_sale": false,
        "position": 2,
        "productTitle": "PlayStation 5 Pro Console",
        "reviewAmount": 1373,
        "reviewRating": 4.4,
        "sponsored": false
      }
    ]
  }
}

This allows you to programmatically identify competitor products and their key attributes, such as pricing, reviews, and sales rank.

3. Analyzing Seller Reviews

The Amazon Seller Review endpoint provides access to seller feedback, including recent reviews and overall ratings. This is essential for assessing the reputation and reliability of your competitors.

Example: Fetching seller reviews for a specific seller ID:

import requests

api_key = 'YOUR_API_KEY'
seller_id = 'A1CWSGXIR635I6'
marketplace_id = 'ATVPDKIKX0DER'  # US Marketplace

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"
          },
          {
            "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"
  }
}

This helps you evaluate competitor reliability and customer satisfaction levels.

4. Getting Product Offers

The Amazon Product Offers endpoint retrieves a list of offers for a specific product, including pricing, seller information, and availability. This allows you to monitor competitor pricing strategies and inventory levels.

Example: Retrieving product offers for a specific ASIN:

import requests

api_key = 'YOUR_API_KEY'
asin = 'B0CL61F39H'
marketplace_id = 'ATVPDKIKX0DER'  # US Marketplace

url = f'https://sellermagnet-api.com/amazon-product-offers?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": "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)"
  }
}

5. Estimating Product Sales

The Amazon Product Estimate Sales endpoint provides estimated monthly sales for a given ASIN, offering valuable insights into product popularity and potential revenue.

Example: Retrieving estimated sales for a specific ASIN:

import requests

api_key = 'YOUR_API_KEY'
asin = 'B08N5WRWNW'
marketplace_id = 'ATVPDKIKX0DER'  # US Marketplace

url = f'https://sellermagnet-api.com/amazon-product-search-estimated-sells?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": "B08N5WRWNW",
    "estimated_monthly_sales": 121,
    "sales_rank": 1,
    "category": "electronics",
    "marketplace_domain": "amazon.com"
  }
}

Building Your Competitor Analysis Tool

Here’s a basic outline for building your Python tool:

  1. Set up Authentication: Use your SellerMagnetAPI key to authenticate your requests.
  2. Define Competitors: Create a list of ASINs or keywords for the products or competitors you want to track. Consider using the Amazon Categories to refine searches.
  3. Implement Data Collection: Use the SellerMagnetAPI endpoints discussed above to gather data on pricing, sales rank, reviews, and seller information.
  4. Data Processing and Storage: Structure and store the collected data in a format suitable for analysis (e.g., CSV, database).
  5. Analysis and Reporting: Develop functions to analyze the data, identify trends, and generate reports on competitor activities.

Enhancements and Advanced Features

  • Automated Scheduling: Use DataPipeline to automate data collection on a regular basis.
  • Data Visualization: Integrate libraries like Matplotlib or Seaborn to create visual representations of trends and comparisons.
  • Alerting System: Set up alerts to notify you of significant changes in competitor pricing, reviews, or sales rank.
  • Geolocation: Use `geo_location` parameter on Amazon Product Offers and Amazon Search endpoints to refine searches.

Legal and Ethical Considerations

Always ensure that your data collection and analysis practices comply with Amazon's terms of service and privacy regulations. Avoid scraping practices that may violate copyright laws or disrupt Amazon's systems. SellerMagnetAPI provides a legally compliant alternative to web scraping.

Conclusion

By leveraging SellerMagnetAPI, businesses can build powerful Python tools for analyzing competitor listings on Amazon. This enables data-driven decision-making, optimized inventory management, and enhanced market research capabilities. Start building your competitive edge today by visiting SellerMagnetAPI and signing up for a free trial to Try Free.

For further assistance, refer to the Documentation and Code Examples provided by SellerMagnetAPI. Check the API Status page for updates and maintenance schedules. And if you need further assistance, please Contact us.

Back to Blog