Introduction
For Amazon businesses and market analysts, understanding offer fulfillment dynamics is crucial for competitive analysis, inventory management, and market research. This blog post demonstrates how to build a Python script leveraging the SellerMagnet API to analyze Amazon offer fulfillment data effectively.
SellerMagnet API provides enterprise-grade Amazon data, enabling businesses to gain a competitive edge. This guide will focus on extracting and analyzing data related to offer fulfillment, specifically using the Amazon Product Offers endpoint and the Amazon Product Statistics endpoint.
Setting Up Your Environment
Before diving into the code, ensure you have Python installed. You'll also need to install the `requests` library to make HTTP requests to the SellerMagnet API.
pip install requests
Additionally, you will need an API key from SellerMagnet API. You can Try Free.
Practical Use Cases
- Competitive Pricing Analysis: Monitor competitor pricing strategies and fulfillment methods.
- Inventory Optimization: Analyze fulfillment types to optimize your inventory distribution.
- Market Trend Identification: Identify trends in fulfillment methods (FBA vs. FBM) across different products.
Fetching Amazon Product Offers Data
The Amazon Product Offers endpoint allows you to retrieve a list of offers for a specific product, including pricing, seller information, and fulfillment details.
Example Request
Here’s an example of how to fetch product offers data using the SellerMagnet API:
import requests
api_key = 'YOUR_API_KEY'
asin = 'B0CL61F39H'
marketplace_id = 'ATVPDKIKX0DER'
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.text}')
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
},
{...}
],
"productLink": "https://www.amazon.com/dp/B0CL61F39H",
"productMainImage": "https://m.media-amazon.com/images/I/31kTNmpm6vL.jpg",
"productTitle": "PlayStation
5 console (slim)"
},
"success": true
}
Analyzing Fulfillment Data
Once you have the data, you can analyze it to gain insights into offer fulfillment. Here’s a Python function to extract and analyze fulfillment types:
def analyze_fulfillment_types(data):
fba_count = 0
fbm_count = 0
for offer in data['data']['offers']:
if offer['fulfillmentType'] == 'FBA':
fba_count += 1
elif offer['fulfillmentType'] == 'FBM':
fbm_count += 1
total_offers = len(data['data']['offers'])
fba_percentage = (fba_count / total_offers) * 100 if total_offers > 0 else 0
fbm_percentage = (fbm_count / total_offers) * 100 if total_offers > 0 else 0
print(f'Total Offers: {total_offers}')
print(f'FBA Offers: {fba_count} ({fba_percentage:.2f}%)')
print(f'FBM Offers: {fbm_count} ({fbm_percentage:.2f}%)')
# Assuming 'data' is the JSON response from the API
analyze_fulfillment_types(data)
This function calculates the percentage of offers fulfilled by Amazon (FBA) versus those fulfilled by the merchant (FBM).
Advanced Analysis with Product Statistics
To further enhance your analysis, integrate the Amazon Product Statistics endpoint. This allows you to correlate fulfillment data with sales rank, review counts, and other crucial metrics.
Fetching Product Statistics Data
import requests
api_key = 'YOUR_API_KEY'
asin = 'B0CL61F39H'
marketplace_id = 'ATVPDKIKX0DER'
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:
stats_data = response.json()
print(stats_data)
else:
print(f'Error: {response.status_code} - {response.text}')
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
]
]
}
}
}
Combining Offer and Statistics Data
Now, let’s combine the offer fulfillment data with product statistics to gain deeper insights. For instance, you can analyze how the fulfillment type correlates with the sales rank.
def correlate_fulfillment_with_sales_rank(offers_data, stats_data):
fba_count = 0
fbm_count = 0
total_offers = len(offers_data['data']['offers'])
for offer in offers_data['data']['offers']:
if offer['fulfillmentType'] == 'FBA':
fba_count += 1
elif offer['fulfillmentType'] == 'FBM':
fbm_count += 1
fba_percentage = (fba_count / total_offers) * 100 if total_offers > 0 else 0
fbm_percentage = (fbm_count / total_offers) * 100 if total_offers > 0 else 0
sales_rank = stats_data['data']['stats']['salesRankHistory'][-1][1] if stats_data['success'] and stats_data['data']['stats']['salesRankHistory'] else 'N/A'
print(f'Sales Rank: {sales_rank}')
print(f'FBA Offers: {fba_count} ({fba_percentage:.2f}%)')
print(f'FBM Offers: {fbm_count} ({fbm_percentage:.2f}%)')
# Assuming 'offers_data' and 'stats_data' are the JSON responses from the respective APIs
correlate_fulfillment_with_sales_rank(offers_data, stats_data)
This script snippet correlates the percentage of FBA and FBM offers with the product's current sales rank. Such correlations can provide insights into how fulfillment strategies impact product performance.
Visualizing the Data
SellerMagnet API also provides graph URLs which can be used for visualization.
{
"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"
}
}
Enhancements and Further Analysis
- Historical Data: Use the salesRankHistory from the Amazon Product Statistics endpoint to track fulfillment changes over time.
- Seller Reviews: Integrate Amazon Seller Review data to assess the impact of seller ratings on fulfillment methods.
- Automated Scheduling: Schedule your script using DataPipeline for continuous, automated analysis.
Conclusion
By leveraging the SellerMagnet API, you can build powerful Python scripts for in-depth Amazon offer fulfillment analysis. This allows for informed decision-making, better competitive strategies, and optimized inventory management. Start building your script today and unlock the potential of enterprise-grade Amazon data.
Explore additional features and endpoints in our Documentation and view Code Examples. For any queries, please Contact our support team.