SellerMagnetAPI Code Examples

Robust, production-ready code examples for integrating SellerMagnetAPI’s Amazon Scraper API, with JSON schemas, response examples, and snippets in multiple languages.

Endpoint Code Examples

Explore production-ready code examples for SellerMagnetAPI endpoints, including JSON schemas, response examples, and snippets in Python, Node.js, cURL, Ruby, Java, and Go.

Use Case

Fetch detailed analytics for an Amazon product, such as sales trends and ranking, to inform pricing or inventory decisions. Ideal for market research tools.

Endpoint: /amazon-product-statistics

Method: GET

Parameters
Name Type Required Description
asin text Yes Product ASIN (e.g., "B08N5WRWNW")
marketplaceId text Yes Marketplace ID (e.g., "A1PA6795UKMFR9")
api_key text Yes Your API key
graphs text No Generate visually graphs for history data
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "description": "The response schema for Amazon item tracking data, including core item details, historical data, and optional extensions for graphs or metadata.",
  "properties": {
    "data": {
      "additionalProperties": true,
      "description": "Core data object with item tracking details and optional extensions.",
      "properties": {
        "amazonPrice": {
          "description": "The current price of the item on Amazon (in cents), or null if not available.",
          "type": [
            "number",
            "null"
          ]
        },
        "asin": {
          "description": "The Amazon Standard Identification Number (ASIN) for the item, a 10-character alphanumeric identifier.",
          "pattern": "^[A-Z0-9]{10}$",
          "type": "string"
        },
        "bestSellerRank": {
          "description": "The current best seller rank of the item in its category.",
          "minimum": 1,
          "type": "integer"
        },
        "buyBoxFulfillment": {
          "description": "The fulfillment method for the Buy Box. Possible values: \u0027FBM\u0027 (Fulfilled by Merchant), \u0027FBA\u0027 (Fulfilled by Amazon), \u0027AMZ\u0027 (sold directly by Amazon).",
          "enum": [
            "FBM",
            "FBA",
            "AMZ"
          ],
          "type": "string"
        },
        "buyBoxPrice": {
          "description": "The current price of the item in the Buy Box (in cents).",
          "minimum": 0,
          "type": "integer"
        },
        "buyBoxSellerIdHistory": {
          "description": "A chronological list of Buy Box seller changes, including timestamps and seller IDs.",
          "items": {
            "description": "A tuple of [timestamp, sellerId] representing a Buy Box seller change.",
            "items": [
              {
                "description": "The timestamp when the Buy Box seller was recorded, in ISO 8601 format.",
                "format": "date-time",
                "type": "string"
              },
              {
                "description": "The seller ID for the Buy Box at the given timestamp, or \u0027-1\u0027 if no seller held the Buy Box.",
                "type": "string"
              }
            ],
            "maxItems": 2,
            "minItems": 2,
            "type": "array"
          },
          "type": "array"
        },
        "graphs": {
          "additionalProperties": true,
          "description": "Placeholder for graph-related data, allowing flexibility for additional visualization types.",
          "properties": {
            "priceTrend": {
              "description": "Data points for visualizing price trends over time.",
              "items": {
                "properties": {
                  "price": {
                    "description": "The price at the given timestamp (in cents).",
                    "minimum": 0,
                    "type": "integer"
                  },
                  "timestamp": {
                    "description": "The timestamp for the price data point.",
                    "format": "date-time",
                    "type": "string"
                  }
                },
                "required": [
                  "timestamp",
                  "price"
                ],
                "type": "object"
              },
              "type": "array"
            },
            "rankTrend": {
              "description": "Data points for visualizing sales rank trends over time.",
              "items": {
                "properties": {
                  "rank": {
                    "description": "The sales rank at the given timestamp.",
                    "minimum": 1,
                    "type": "integer"
                  },
                  "timestamp": {
                    "description": "The timestamp for the rank data point.",
                    "format": "date-time",
                    "type": "string"
                  }
                },
                "required": [
                  "timestamp",
                  "rank"
                ],
                "type": "object"
              },
              "type": "array"
            }
          },
          "type": [
            "object",
            "null"
          ]
        },
        "metadata": {
          "additionalProperties": true,
          "description": "Flexible metadata field for additional item or tracking information.",
          "properties": {
            "category": {
              "description": "The Amazon category of the item (e.g., \u0027Electronics\u0027).",
              "type": "string"
            },
            "lastUpdated": {
              "description": "The timestamp when the data was last updated.",
              "format": "date-time",
              "type": "string"
            }
          },
          "type": [
            "object",
            "null"
          ]
        },
        "salesRankHistory": {
          "description": "A chronological list of the item\u0027s sales rank changes, including timestamps and rank values.",
          "items": {
            "description": "A tuple of [timestamp, salesRank] representing a sales rank record.",
            "items": [
              {
                "description": "The timestamp when the sales rank was recorded, in ISO 8601 format.",
                "format": "date-time",
                "type": "string"
              },
              {
                "description": "The sales rank of the item at the given timestamp.",
                "minimum": 1,
                "type": "integer"
              }
            ],
            "maxItems": 2,
            "minItems": 2,
            "type": "array"
          },
          "type": "array"
        },
        "trackingSince": {
          "description": "The date when tracking of the item began, in YYYY-MM-DD format.",
          "format": "date",
          "type": "string"
        }
      },
      "required": [
        "asin",
        "amazonPrice",
        "bestSellerRank",
        "buyBoxPrice",
        "buyBoxFulfillment",
        "buyBoxSellerIdHistory",
        "salesRankHistory",
        "trackingSince"
      ],
      "type": "object"
    },
    "errors": {
      "description": "Optional list of error messages if the request was not fully successful. Not present in the provided document but included for robustness.",
      "items": {
        "properties": {
          "code": {
            "description": "A unique error code.",
            "type": "string"
          },
          "message": {
            "description": "A human-readable error message.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "success": {
      "description": "Indicates whether the request to retrieve the item tracking data was successful.",
      "type": "boolean"
    }
  },
  "required": [
    "success",
    "data"
  ],
  "title": "Amazon Item Tracking Response Schema",
  "type": "object"
}
Response Example
{
  "data": {
    "asin": "B0CLTBHXWQ",
    "buyBoxFulfillment": "FBM",
    "buyBoxPrice": 41800,
    "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,
    "productTitle": "Playstation 5 Console Edizione Digital Slim",
    "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
        ]
      ]
    }
  },
  "success": true
}
Code Examples
Python
Ruby
Javascript
Java
Go
Curl

import requests
import time
import logging

# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)

def fetch_amazon_product_statistics(api_key, asin, marketplaceId, graphs, max_retries=3, timeout=10):
    """
    Fetch data from Amazon Product Statistics endpoint with retry logic and error handling.
    
    Args:
        api_key (str): API key for authentication
        
        asin (text): Product ASIN (e.g., "B08N5WRWNW")
        
        marketplaceId (text): Marketplace ID (e.g., "A1PA6795UKMFR9")
        
        graphs (text): Generate visually graphs for history data
        
        max_retries (int): Maximum number of retry attempts
        timeout (int): Request timeout in seconds
    
    Returns:
        dict: API response data
    
    Raises:
        Exception: If all retries fail
    """
    url = "https://sellermagnet-api.com/amazon-product-statistics"
    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"
    }
    params = {
        
        "asin": asin,
        
        "marketplaceId": marketplaceId,
        
        "graphs": graphs,
        
    }
    
    for attempt in range(max_retries):
        try:
            logger.info(f"Attempt {attempt + 1} to fetch Amazon Product Statistics")
            response = requests.get(url, headers=headers, params=params, timeout=timeout)
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            logger.error(f"Attempt {attempt + 1} failed: {e}")
            if attempt + 1 == max_retries:
                raise Exception(f"Failed to fetch Amazon Product Statistics after {max_retries} attempts: {e}")
            time.sleep(2 ** attempt)  # Exponential backoff
    
    return {}

# Example usage
if __name__ == "__main__":
    try:
        result = fetch_amazon_product_statistics(
            api_key="YOUR_API_KEY",
            
            asin="Product ASIN "B08N5WRWNW"",
            
            marketplaceId="Marketplace ID "A1PA6795UKMFR9"",
            
            graphs="graphs",
            
        )
        logger.info(f"Response: {result}")
    except Exception as e:
        logger.error(f"Error: {e}")

require 'httparty'
require 'logger'

# Configure logging
logger = Logger.new(STDOUT)
logger.level = Logger::INFO

module SellerMagnetAPI
  class << self
    def fetch_amazon_product_statistics(api_key, asin, marketplaceId, graphs, max_retries: 3, timeout: 10)
      # Fetch data from Amazon Product Statistics endpoint with retry logic and error handling.
      #
      # @param api_key [String] API key for authentication
      # 
      # @param asin [Text] Product ASIN (e.g., "B08N5WRWNW")
      # 
      # @param marketplaceId [Text] Marketplace ID (e.g., "A1PA6795UKMFR9")
      # 
      # @param graphs [Text] Generate visually graphs for history data
      # 
      # @param max_retries [Integer] Maximum number of retry attempts
      # @param timeout [Integer] Request timeout in seconds
      # @return [Hash] API response data
      # @raise [StandardError] If all retries fail
      url = "https://sellermagnet-api.com/amazon-product-statistics"
      headers = {
        "Authorization" => "Bearer #{api_key}",
        "Content-Type" => "application/json"
      }
      params = {
        
        "asin" => asin,
        
        "marketplaceId" => marketplaceId,
        
        "graphs" => graphs,
        
      }

      max_retries.times do |attempt|
        begin
          logger.info("Attempt #{attempt + 1} to fetch Amazon Product Statistics")
          response = HTTParty.get(url, headers: headers, query: params, timeout: timeout)
          return response.parsed_response if response.success?
        rescue StandardError => e
          logger.error("Attempt #{attempt + 1} failed: #{e.message}")
          raise("Failed to fetch Amazon Product Statistics after #{max_retries} attempts: #{e.message}") if attempt + 1 == max_retries
          sleep(2 ** attempt) # Exponential backoff
        end
      end
    end
  end
end

# Example usage
begin
  result = SellerMagnetAPI.fetch_amazon_product_statistics(
    "YOUR_API_KEY",
    
    "Product ASIN "B08N5WRWNW"",
    
    "Marketplace ID "A1PA6795UKMFR9"",
    
    "graphs",
    
  )
  logger.info("Response: #{result}")
rescue StandardError => e
  logger.error("Error: #{e.message}")
end

const axios = require('axios');
const winston = require('winston');

// Configure logging
const logger = winston.createLogger({
    level: 'info',
    format: winston.format.combine(
        winston.format.timestamp(),
        winston.format.json()
    ),
    transports: [new winston.transports.Console()]
});

async function fetchAmazonProductStatistics(apiKey, asin, marketplaceId, graphs, retries = 3, timeout = 10000) {
    /**
     * Fetch data from Amazon Product Statistics endpoint with retry logic and error handling.
     * 
     * @param {string} apiKey - API key for authentication
     
     * @param {string} asin - Product ASIN (e.g., "B08N5WRWNW")
     
     * @param {string} marketplaceId - Marketplace ID (e.g., "A1PA6795UKMFR9")
     
     * @param {string} graphs - Generate visually graphs for history data
     
     * @param {number} retries - Maximum number of retry attempts
     * @param {number} timeout - Request timeout in milliseconds
     * @returns {Promise} API response data
     * @throws {Error} If all retries fail
     */
    const url = `https://sellermagnet-api.com/amazon-product-statistics`;
    const headers = {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json'
    };
    const params = {
        
        asin: asin,
        
        marketplaceId: marketplaceId,
        
        graphs: graphs,
        
    };

    for (let attempt = 0; attempt < retries; attempt++) {
        try {
            logger.info(`Attempt ${attempt + 1} to fetch Amazon Product Statistics`);
            const response = await axios.get(url, { headers, params, timeout });
            return response.data;
        } catch (error) {
            logger.error(`Attempt ${attempt + 1} failed: ${error.message}`);
            if (attempt + 1 === retries) {
                throw new Error(`Failed to fetch Amazon Product Statistics after ${retries} attempts: ${error.message}`);
            }
            await new Promise(resolve => setTimeout(resolve, 2 ** attempt * 1000)); // Exponential backoff
        }
    }
}

// Example usage
(async () => {
    try {
        const result = await fetchAmazonProductStatistics(
            'YOUR_API_KEY',
            
            "Product ASIN "B08N5WRWNW"",
            
            "Marketplace ID "A1PA6795UKMFR9"",
            
            "graphs",
            
        );
        logger.info('Response:', result);
    } catch (error) {
        logger.error(`Error: ${error.message}`);
    }
})();

                                                
                                            
                                        
                                    
                                        

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.HashMap;
import java.util.logging.Logger;
import java.util.stream.Collectors;

public class SellerMagnetAPIClient {
    private static final Logger LOGGER = Logger.getLogger(SellerMagnetAPIClient.class.getName());
    private final HttpClient client;

    public SellerMagnetAPIClient() {
        this.client = HttpClient.newBuilder().build();
    }

    /**
     * Fetch data from Amazon Product Statistics endpoint with retry logic and error handling.
     *
     * @param apiKey API key for authentication
     * 
     * @param asin Product ASIN (e.g., "B08N5WRWNW")
     * 
     * @param marketplaceId Marketplace ID (e.g., "A1PA6795UKMFR9")
     * 
     * @param graphs Generate visually graphs for history data
     * 
     * @param maxRetries Maximum number of retry attempts
     * @param timeoutSeconds Request timeout in seconds
     * @return API response data as a String
     * @throws Exception If all retries fail
     */
    public String fetchAmazonProductStatistics(String apiKey, String asin, String marketplaceId, String graphs, int maxRetries, int timeoutSeconds) throws Exception {
        String url = "https://sellermagnet-api.com/amazon-product-statistics";
        Map params = new HashMap<>();
        
        params.put("asin", asin);
        
        params.put("marketplaceId", marketplaceId);
        
        params.put("graphs", graphs);
        
        
        String query = params.entrySet().stream()
            .map(e -> URLEncoder.encode(e.getKey(), StandardCharsets.UTF_8) + "=" + URLEncoder.encode(e.getValue(), StandardCharsets.UTF_8))
            .collect(Collectors.joining("&"));
        
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(url + "?" + query))
            .header("Authorization", "Bearer " + apiKey)
            .header("Content-Type", "application/json")
            .timeout(java.time.Duration.ofSeconds(timeoutSeconds))
            .GET()
            .build();
        
        for (int attempt = 0; attempt < maxRetries; attempt++) {
            try {
                LOGGER.info("Attempt " + (attempt + 1) + " to fetch Amazon Product Statistics");
                HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
                if (response.statusCode() >= 200 && response.statusCode() < 300) {
                    return response.body();
                }
            } catch (Exception e) {
                LOGGER.severe("Attempt " + (attempt + 1) + " failed: " + e.getMessage());
                if (attempt + 1 == maxRetries) {
                    throw new Exception("Failed to fetch Amazon Product Statistics after " + maxRetries + " attempts: " + e.getMessage());
                }
                Thread.sleep((long) Math.pow(2, attempt) * 1000); // Exponential backoff
            }
        }
        throw new Exception("Failed to fetch Amazon Product Statistics after " + maxRetries + " attempts");
    }

    // Example usage
    public static void main(String[] args) {
        SellerMagnetAPIClient apiClient = new SellerMagnetAPIClient();
        try {
            String response = apiClient.fetchAmazonProductStatistics(
                "YOUR_API_KEY",
                
                "Product ASIN "B08N5WRWNW"",
                
                "Marketplace ID "A1PA6795UKMFR9"",
                
                "graphs",
                
                3,
                10
            );
            LOGGER.info("Response: " + response);
        } catch (Exception e) {
            LOGGER.severe("Error: " + e.getMessage());
        }
    }
}

package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "net/url"
    "time"
    "log"
)

// FetchAmazonProductStatistics fetches data from Amazon Product Statistics endpoint with retry logic and error handling.
//
// Parameters:
//   - apiKey: API key for authentication
//   
//   - asin: Product ASIN (e.g., "B08N5WRWNW")
//   
//   - marketplaceId: Marketplace ID (e.g., "A1PA6795UKMFR9")
//   
//   - graphs: Generate visually graphs for history data
//   
//   - maxRetries: Maximum number of retry attempts
//   - timeout: Request timeout duration
//
// Returns:
//   - []byte: API response data
//   - error: Any error encountered
func FetchAmazonProductStatistics(apiKey string, asin string, marketplaceId string, graphs string, maxRetries int, timeout time.Duration) ([]byte, error) {
    client := &http.Client{Timeout: timeout}
    params := url.Values{}
    
    params.Add("asin", asin)
    
    params.Add("marketplaceId", marketplaceId)
    
    params.Add("graphs", graphs)
    
    
    url := "https://sellermagnet-api.com/amazon-product-statistics?" + params.Encode()
    
    for attempt := 0; attempt < maxRetries; attempt++ {
        log.Printf("Attempt %d to fetch Amazon Product Statistics", attempt+1)
        req, err := http.NewRequest("GET", url, nil)
        if err != nil {
            return nil, fmt.Errorf("failed to create request: %v", err)
        }
        req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
        req.Header.Set("Content-Type", "application/json")
        
        resp, err := client.Do(req)
        if err != nil {
            log.Printf("Attempt %d failed: %v", attempt+1, err)
            if attempt+1 == maxRetries {
                return nil, fmt.Errorf("failed after %d attempts: %v", maxRetries, err)
            }
            time.Sleep(time.Duration(1<= 200 && resp.StatusCode < 300 {
            body, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                return nil, fmt.Errorf("failed to read response: %v", err)
            }
            return body, nil
        }
    }
    return nil, fmt.Errorf("failed after %d attempts", maxRetries)
}

// Example usage
func main() {
    response, err := FetchAmazonProductStatistics(
        "YOUR_API_KEY",
        
        "Product ASIN "B08N5WRWNW"",
        
        "Marketplace ID "A1PA6795UKMFR9"",
        
        "graphs",
        
        3,
        10*time.Second,
    )
    if err != nil {
        log.Fatalf("Error: %v", err)
    }
    log.Printf("Response: %s", response)
}

#!/bin/bash

# Configure logging
LOG_FILE="/var/log/sellermagnet_api.log"
log() {
    echo "[$(date -Iseconds)] $1" >> "$LOG_FILE"
}

# API request function with retry logic
fetch_amazon_product_statistics() {
    local API_KEY="$1"
    shift
    local URL="https://sellermagnet-api.com/amazon-product-statistics"
    local PARAMS="asin=$1&shift;marketplaceId=$1&shift;graphs=$1&"
    local MAX_RETRIES=3
    local TIMEOUT=10

    log "Starting fetch for Amazon Product Statistics"
    
    for ((i=1; i<=MAX_RETRIES; i++)); do
        RESPONSE=$(curl -s -X GET "${URL}?${PARAMS}" \
            -H "Authorization: Bearer ${API_KEY}" \
            -H "Content-Type: application/json" \
            --max-time ${TIMEOUT})
        if [ $? -eq 0 ]; then
            log "Fetch successful on attempt $i"
            echo "${RESPONSE}"
            return 0
        else
            log "Attempt $i failed"
            sleep $((2 ** i))
        fi
    done
    log "Error: Max retries reached"
    echo "Error: Max retries reached"
    return 1
}

# Example usage
fetch_amazon_product_statistics "YOUR_API_KEY" \
    
    "Product%20ASIN%20%22B08N5WRWNW%22" \
    
    "Marketplace%20ID%20%22A1PA6795UKMFR9%22" \
    
    "graphs" \
    
Use Case

Convert ASIN to EAN or vice versa to manage cross-marketplace product listings or integrate with external databases.

Endpoint: /amazon-asin-converter

Method: GET

Parameters
Name Type Required Description
asin text Yes ASIN or EAN to convert (e.g., "B08N5WRWNW" or "9781234567890")
marketplaceId text Yes Marketplace ID (e.g., "A1PA6795UKMFR9")
conversion_direction text Yes Conversion direction: "asin-to-ean" or "ean-to-asin"
api_key text Yes Your API key
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "properties": {
    "data": {
      "additionalProperties": false,
      "properties": {
        "asin": {
          "description": "Amazon Standard Identification Number (ASIN), a 10-character alphanumeric identifier.",
          "pattern": "^[A-Z0-9]{10}$",
          "type": "string"
        },
        "eanList": {
          "description": "List of EAN codes associated with the product.",
          "items": {
            "description": "European Article Number (EAN), a 12- or 13-digit identifier.",
            "pattern": "^[0-9]{12,14}$",
            "type": "string"
          },
          "minItems": 1,
          "type": "array"
        },
        "listedSince": {
          "description": "Timestamp indicating when the product was first listed, in ISO 8601 format.",
          "format": "date-time",
          "type": "string"
        },
        "productTitle": {
          "description": "Title or name of the product.",
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "asin",
        "eanList",
        "listedSince",
        "productTitle"
      ],
      "type": "object"
    },
    "success": {
      "description": "Indicates whether the API request was successful.",
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "success"
  ],
  "type": "object"
}
Response Example
{
  "data": {
    "asin": "B0CLTBHXWQ",
    "eanList": [
      "0711719577294"
    ],
    "listedSince": "2023-12-30 01:00:00",
    "productTitle": "Playstation 5 Console Edizione Digital Slim"
  },
  "success": true
}
Code Examples
Python
Ruby
Javascript
Java
Go
Curl

import requests
import time
import logging

# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)

def fetch_amazon_asin_converter(api_key, asin, marketplaceId, conversion_direction, max_retries=3, timeout=10):
    """
    Fetch data from Amazon ASIN Converter endpoint with retry logic and error handling.
    
    Args:
        api_key (str): API key for authentication
        
        asin (text): ASIN or EAN to convert (e.g., "B08N5WRWNW" or "9781234567890")
        
        marketplaceId (text): Marketplace ID (e.g., "A1PA6795UKMFR9")
        
        conversion_direction (text): Conversion direction: "asin-to-ean" or "ean-to-asin"
        
        max_retries (int): Maximum number of retry attempts
        timeout (int): Request timeout in seconds
    
    Returns:
        dict: API response data
    
    Raises:
        Exception: If all retries fail
    """
    url = "https://sellermagnet-api.com/amazon-asin-converter"
    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"
    }
    params = {
        
        "asin": asin,
        
        "marketplaceId": marketplaceId,
        
        "conversion_direction": conversion_direction,
        
    }
    
    for attempt in range(max_retries):
        try:
            logger.info(f"Attempt {attempt + 1} to fetch Amazon ASIN Converter")
            response = requests.get(url, headers=headers, params=params, timeout=timeout)
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            logger.error(f"Attempt {attempt + 1} failed: {e}")
            if attempt + 1 == max_retries:
                raise Exception(f"Failed to fetch Amazon ASIN Converter after {max_retries} attempts: {e}")
            time.sleep(2 ** attempt)  # Exponential backoff
    
    return {}

# Example usage
if __name__ == "__main__":
    try:
        result = fetch_amazon_asin_converter(
            api_key="YOUR_API_KEY",
            
            asin="ASIN or EAN to convert "B08N5WRWNW" or "9781234567890"",
            
            marketplaceId="Marketplace ID "A1PA6795UKMFR9"",
            
            conversion_direction="asin-to-ean",
            
        )
        logger.info(f"Response: {result}")
    except Exception as e:
        logger.error(f"Error: {e}")

require 'httparty'
require 'logger'

# Configure logging
logger = Logger.new(STDOUT)
logger.level = Logger::INFO

module SellerMagnetAPI
  class << self
    def fetch_amazon_asin_converter(api_key, asin, marketplaceId, conversion_direction, max_retries: 3, timeout: 10)
      # Fetch data from Amazon ASIN Converter endpoint with retry logic and error handling.
      #
      # @param api_key [String] API key for authentication
      # 
      # @param asin [Text] ASIN or EAN to convert (e.g., "B08N5WRWNW" or "9781234567890")
      # 
      # @param marketplaceId [Text] Marketplace ID (e.g., "A1PA6795UKMFR9")
      # 
      # @param conversion_direction [Text] Conversion direction: "asin-to-ean" or "ean-to-asin"
      # 
      # @param max_retries [Integer] Maximum number of retry attempts
      # @param timeout [Integer] Request timeout in seconds
      # @return [Hash] API response data
      # @raise [StandardError] If all retries fail
      url = "https://sellermagnet-api.com/amazon-asin-converter"
      headers = {
        "Authorization" => "Bearer #{api_key}",
        "Content-Type" => "application/json"
      }
      params = {
        
        "asin" => asin,
        
        "marketplaceId" => marketplaceId,
        
        "conversion_direction" => conversion_direction,
        
      }

      max_retries.times do |attempt|
        begin
          logger.info("Attempt #{attempt + 1} to fetch Amazon ASIN Converter")
          response = HTTParty.get(url, headers: headers, query: params, timeout: timeout)
          return response.parsed_response if response.success?
        rescue StandardError => e
          logger.error("Attempt #{attempt + 1} failed: #{e.message}")
          raise("Failed to fetch Amazon ASIN Converter after #{max_retries} attempts: #{e.message}") if attempt + 1 == max_retries
          sleep(2 ** attempt) # Exponential backoff
        end
      end
    end
  end
end

# Example usage
begin
  result = SellerMagnetAPI.fetch_amazon_asin_converter(
    "YOUR_API_KEY",
    
    "ASIN or EAN to convert "B08N5WRWNW" or "9781234567890"",
    
    "Marketplace ID "A1PA6795UKMFR9"",
    
    "asin-to-ean",
    
  )
  logger.info("Response: #{result}")
rescue StandardError => e
  logger.error("Error: #{e.message}")
end

const axios = require('axios');
const winston = require('winston');

// Configure logging
const logger = winston.createLogger({
    level: 'info',
    format: winston.format.combine(
        winston.format.timestamp(),
        winston.format.json()
    ),
    transports: [new winston.transports.Console()]
});

async function fetchAmazonASINConverter(apiKey, asin, marketplaceId, conversion_direction, retries = 3, timeout = 10000) {
    /**
     * Fetch data from Amazon ASIN Converter endpoint with retry logic and error handling.
     * 
     * @param {string} apiKey - API key for authentication
     
     * @param {string} asin - ASIN or EAN to convert (e.g., "B08N5WRWNW" or "9781234567890")
     
     * @param {string} marketplaceId - Marketplace ID (e.g., "A1PA6795UKMFR9")
     
     * @param {string} conversion_direction - Conversion direction: "asin-to-ean" or "ean-to-asin"
     
     * @param {number} retries - Maximum number of retry attempts
     * @param {number} timeout - Request timeout in milliseconds
     * @returns {Promise} API response data
     * @throws {Error} If all retries fail
     */
    const url = `https://sellermagnet-api.com/amazon-asin-converter`;
    const headers = {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json'
    };
    const params = {
        
        asin: asin,
        
        marketplaceId: marketplaceId,
        
        conversion_direction: conversion_direction,
        
    };

    for (let attempt = 0; attempt < retries; attempt++) {
        try {
            logger.info(`Attempt ${attempt + 1} to fetch Amazon ASIN Converter`);
            const response = await axios.get(url, { headers, params, timeout });
            return response.data;
        } catch (error) {
            logger.error(`Attempt ${attempt + 1} failed: ${error.message}`);
            if (attempt + 1 === retries) {
                throw new Error(`Failed to fetch Amazon ASIN Converter after ${retries} attempts: ${error.message}`);
            }
            await new Promise(resolve => setTimeout(resolve, 2 ** attempt * 1000)); // Exponential backoff
        }
    }
}

// Example usage
(async () => {
    try {
        const result = await fetchAmazonASINConverter(
            'YOUR_API_KEY',
            
            "ASIN or EAN to convert "B08N5WRWNW" or "9781234567890"",
            
            "Marketplace ID "A1PA6795UKMFR9"",
            
            "asin-to-ean",
            
        );
        logger.info('Response:', result);
    } catch (error) {
        logger.error(`Error: ${error.message}`);
    }
})();

                                                
                                            
                                        
                                    
                                        

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.HashMap;
import java.util.logging.Logger;
import java.util.stream.Collectors;

public class SellerMagnetAPIClient {
    private static final Logger LOGGER = Logger.getLogger(SellerMagnetAPIClient.class.getName());
    private final HttpClient client;

    public SellerMagnetAPIClient() {
        this.client = HttpClient.newBuilder().build();
    }

    /**
     * Fetch data from Amazon ASIN Converter endpoint with retry logic and error handling.
     *
     * @param apiKey API key for authentication
     * 
     * @param asin ASIN or EAN to convert (e.g., "B08N5WRWNW" or "9781234567890")
     * 
     * @param marketplaceId Marketplace ID (e.g., "A1PA6795UKMFR9")
     * 
     * @param conversion_direction Conversion direction: "asin-to-ean" or "ean-to-asin"
     * 
     * @param maxRetries Maximum number of retry attempts
     * @param timeoutSeconds Request timeout in seconds
     * @return API response data as a String
     * @throws Exception If all retries fail
     */
    public String fetchAmazonASINConverter(String apiKey, String asin, String marketplaceId, String conversion_direction, int maxRetries, int timeoutSeconds) throws Exception {
        String url = "https://sellermagnet-api.com/amazon-asin-converter";
        Map params = new HashMap<>();
        
        params.put("asin", asin);
        
        params.put("marketplaceId", marketplaceId);
        
        params.put("conversion_direction", conversion_direction);
        
        
        String query = params.entrySet().stream()
            .map(e -> URLEncoder.encode(e.getKey(), StandardCharsets.UTF_8) + "=" + URLEncoder.encode(e.getValue(), StandardCharsets.UTF_8))
            .collect(Collectors.joining("&"));
        
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(url + "?" + query))
            .header("Authorization", "Bearer " + apiKey)
            .header("Content-Type", "application/json")
            .timeout(java.time.Duration.ofSeconds(timeoutSeconds))
            .GET()
            .build();
        
        for (int attempt = 0; attempt < maxRetries; attempt++) {
            try {
                LOGGER.info("Attempt " + (attempt + 1) + " to fetch Amazon ASIN Converter");
                HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
                if (response.statusCode() >= 200 && response.statusCode() < 300) {
                    return response.body();
                }
            } catch (Exception e) {
                LOGGER.severe("Attempt " + (attempt + 1) + " failed: " + e.getMessage());
                if (attempt + 1 == maxRetries) {
                    throw new Exception("Failed to fetch Amazon ASIN Converter after " + maxRetries + " attempts: " + e.getMessage());
                }
                Thread.sleep((long) Math.pow(2, attempt) * 1000); // Exponential backoff
            }
        }
        throw new Exception("Failed to fetch Amazon ASIN Converter after " + maxRetries + " attempts");
    }

    // Example usage
    public static void main(String[] args) {
        SellerMagnetAPIClient apiClient = new SellerMagnetAPIClient();
        try {
            String response = apiClient.fetchAmazonASINConverter(
                "YOUR_API_KEY",
                
                "ASIN or EAN to convert "B08N5WRWNW" or "9781234567890"",
                
                "Marketplace ID "A1PA6795UKMFR9"",
                
                "asin-to-ean",
                
                3,
                10
            );
            LOGGER.info("Response: " + response);
        } catch (Exception e) {
            LOGGER.severe("Error: " + e.getMessage());
        }
    }
}

package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "net/url"
    "time"
    "log"
)

// FetchAmazonASINConverter fetches data from Amazon ASIN Converter endpoint with retry logic and error handling.
//
// Parameters:
//   - apiKey: API key for authentication
//   
//   - asin: ASIN or EAN to convert (e.g., "B08N5WRWNW" or "9781234567890")
//   
//   - marketplaceId: Marketplace ID (e.g., "A1PA6795UKMFR9")
//   
//   - conversion_direction: Conversion direction: "asin-to-ean" or "ean-to-asin"
//   
//   - maxRetries: Maximum number of retry attempts
//   - timeout: Request timeout duration
//
// Returns:
//   - []byte: API response data
//   - error: Any error encountered
func FetchAmazonASINConverter(apiKey string, asin string, marketplaceId string, conversion_direction string, maxRetries int, timeout time.Duration) ([]byte, error) {
    client := &http.Client{Timeout: timeout}
    params := url.Values{}
    
    params.Add("asin", asin)
    
    params.Add("marketplaceId", marketplaceId)
    
    params.Add("conversion_direction", conversion_direction)
    
    
    url := "https://sellermagnet-api.com/amazon-asin-converter?" + params.Encode()
    
    for attempt := 0; attempt < maxRetries; attempt++ {
        log.Printf("Attempt %d to fetch Amazon ASIN Converter", attempt+1)
        req, err := http.NewRequest("GET", url, nil)
        if err != nil {
            return nil, fmt.Errorf("failed to create request: %v", err)
        }
        req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
        req.Header.Set("Content-Type", "application/json")
        
        resp, err := client.Do(req)
        if err != nil {
            log.Printf("Attempt %d failed: %v", attempt+1, err)
            if attempt+1 == maxRetries {
                return nil, fmt.Errorf("failed after %d attempts: %v", maxRetries, err)
            }
            time.Sleep(time.Duration(1<= 200 && resp.StatusCode < 300 {
            body, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                return nil, fmt.Errorf("failed to read response: %v", err)
            }
            return body, nil
        }
    }
    return nil, fmt.Errorf("failed after %d attempts", maxRetries)
}

// Example usage
func main() {
    response, err := FetchAmazonASINConverter(
        "YOUR_API_KEY",
        
        "ASIN or EAN to convert "B08N5WRWNW" or "9781234567890"",
        
        "Marketplace ID "A1PA6795UKMFR9"",
        
        "asin-to-ean",
        
        3,
        10*time.Second,
    )
    if err != nil {
        log.Fatalf("Error: %v", err)
    }
    log.Printf("Response: %s", response)
}

#!/bin/bash

# Configure logging
LOG_FILE="/var/log/sellermagnet_api.log"
log() {
    echo "[$(date -Iseconds)] $1" >> "$LOG_FILE"
}

# API request function with retry logic
fetch_amazon_asin_converter() {
    local API_KEY="$1"
    shift
    local URL="https://sellermagnet-api.com/amazon-asin-converter"
    local PARAMS="asin=$1&shift;marketplaceId=$1&shift;conversion_direction=$1&"
    local MAX_RETRIES=3
    local TIMEOUT=10

    log "Starting fetch for Amazon ASIN Converter"
    
    for ((i=1; i<=MAX_RETRIES; i++)); do
        RESPONSE=$(curl -s -X GET "${URL}?${PARAMS}" \
            -H "Authorization: Bearer ${API_KEY}" \
            -H "Content-Type: application/json" \
            --max-time ${TIMEOUT})
        if [ $? -eq 0 ]; then
            log "Fetch successful on attempt $i"
            echo "${RESPONSE}"
            return 0
        else
            log "Attempt $i failed"
            sleep $((2 ** i))
        fi
    done
    log "Error: Max retries reached"
    echo "Error: Max retries reached"
    return 1
}

# Example usage
fetch_amazon_asin_converter "YOUR_API_KEY" \
    
    "ASIN%20or%20EAN%20to%20convert%20%22B08N5WRWNW%22%20or%20%229781234567890%22" \
    
    "Marketplace%20ID%20%22A1PA6795UKMFR9%22" \
    
    "asin-to-ean" \
    
Use Case

Retrieve seller feedback to evaluate supplier reliability or monitor competitor performance, useful for dropshipping or sourcing platforms.

Endpoint: /amazon-seller-review

Method: GET

Parameters
Name Type Required Description
sellerId text Yes Seller ID (e.g., "A1B2C3D4E5F6G7")
marketplaceId text Yes Marketplace ID (e.g., "A1PA6795UKMFR9")
api_key text Yes Your API key
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "properties": {
    "data": {
      "additionalProperties": false,
      "properties": {
        "marketplace": {
          "additionalProperties": {
            "additionalProperties": false,
            "properties": {
              "last5Reviews": {
                "description": "List of up to 5 most recent customer reviews.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "dateRated": {
                      "description": "Date and reviewer name of the review, in a human-readable format.",
                      "type": "string"
                    },
                    "reviewText": {
                      "description": "Text content of the review.",
                      "minLength": 1,
                      "type": "string"
                    },
                    "starRating": {
                      "description": "Star rating of the review, formatted as \u0027X out of 5 stars\u0027.",
                      "pattern": "^[1-5] out of 5 stars$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "dateRated",
                    "reviewText",
                    "starRating"
                  ],
                  "type": "object"
                },
                "maxItems": 5,
                "type": "array"
              },
              "sellerFeedback": {
                "additionalProperties": false,
                "description": "Seller feedback ratings and review counts over different time periods.",
                "properties": {
                  "30": {
                    "additionalProperties": false,
                    "properties": {
                      "rating": {
                        "description": "Average rating over the last 30 days.",
                        "pattern": "^[0-5](\\.\\d)?$",
                        "type": "string"
                      },
                      "reviewsCount": {
                        "description": "Number of reviews over the last 30 days.",
                        "pattern": "^[0-9]+$",
                        "type": "string"
                      }
                    },
                    "required": [
                      "rating",
                      "reviewsCount"
                    ],
                    "type": "object"
                  },
                  "365": {
                    "additionalProperties": false,
                    "properties": {
                      "rating": {
                        "description": "Average rating over the last 365 days.",
                        "pattern": "^[0-5](\\.\\d)?$",
                        "type": "string"
                      },
                      "reviewsCount": {
                        "description": "Number of reviews over the last 365 days.",
                        "pattern": "^[0-9]+$",
                        "type": "string"
                      }
                    },
                    "required": [
                      "rating",
                      "reviewsCount"
                    ],
                    "type": "object"
                  },
                  "90": {
                    "additionalProperties": false,
                    "properties": {
                      "rating": {
                        "description": "Average rating over the last 90 days.",
                        "pattern": "^[0-5](\\.\\d)?$",
                        "type": "string"
                      },
                      "reviewsCount": {
                        "description": "Number of reviews over the last 90 days.",
                        "pattern": "^[0-9]+$",
                        "type": "string"
                      }
                    },
                    "required": [
                      "rating",
                      "reviewsCount"
                    ],
                    "type": "object"
                  },
                  "lifetime": {
                    "additionalProperties": false,
                    "properties": {
                      "rating": {
                        "description": "Average rating over the seller\u0027s lifetime.",
                        "pattern": "^[0-5](\\.\\d)?$",
                        "type": "string"
                      },
                      "reviewsCount": {
                        "description": "Total number of reviews over the seller\u0027s lifetime, with optional comma for thousands.",
                        "pattern": "^[0-9]+(,[0-9]+)?$",
                        "type": "string"
                      }
                    },
                    "required": [
                      "rating",
                      "reviewsCount"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "30",
                  "90",
                  "365",
                  "lifetime"
                ],
                "type": "object"
              }
            },
            "required": [
              "last5Reviews",
              "sellerFeedback"
            ],
            "type": "object"
          },
          "description": "Marketplace-specific data, keyed by marketplace ID.",
          "type": "object"
        },
        "sellerId": {
          "description": "Unique identifier for the seller.",
          "pattern": "^[A-Z0-9]+$",
          "type": "string"
        }
      },
      "required": [
        "marketplace",
        "sellerId"
      ],
      "type": "object"
    },
    "success": {
      "description": "Indicates whether the API request was successful.",
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "success"
  ],
  "type": "object"
}
Response Example
{
  "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"
          },
          "365": {
            "rating": "3.9",
            "reviewsCount": "114"
          },
          "90": {
            "rating": "3.6",
            "reviewsCount": "30"
          },
          "lifetime": {
            "rating": "4.5",
            "reviewsCount": "1,535"
          }
        }
      }
    },
    "sellerId": "A1CWSGXIR635I6"
  },
  "success": true
}
Code Examples
Python
Ruby
Javascript
Java
Go
Curl

import requests
import time
import logging

# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)

def fetch_get_amazon_seller_review(api_key, sellerId, marketplaceId, max_retries=3, timeout=10):
    """
    Fetch data from Get Amazon Seller Review endpoint with retry logic and error handling.
    
    Args:
        api_key (str): API key for authentication
        
        sellerId (text): Seller ID (e.g., "A1B2C3D4E5F6G7")
        
        marketplaceId (text): Marketplace ID (e.g., "A1PA6795UKMFR9")
        
        max_retries (int): Maximum number of retry attempts
        timeout (int): Request timeout in seconds
    
    Returns:
        dict: API response data
    
    Raises:
        Exception: If all retries fail
    """
    url = "https://sellermagnet-api.com/amazon-seller-review"
    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"
    }
    params = {
        
        "sellerId": sellerId,
        
        "marketplaceId": marketplaceId,
        
    }
    
    for attempt in range(max_retries):
        try:
            logger.info(f"Attempt {attempt + 1} to fetch Get Amazon Seller Review")
            response = requests.get(url, headers=headers, params=params, timeout=timeout)
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            logger.error(f"Attempt {attempt + 1} failed: {e}")
            if attempt + 1 == max_retries:
                raise Exception(f"Failed to fetch Get Amazon Seller Review after {max_retries} attempts: {e}")
            time.sleep(2 ** attempt)  # Exponential backoff
    
    return {}

# Example usage
if __name__ == "__main__":
    try:
        result = fetch_get_amazon_seller_review(
            api_key="YOUR_API_KEY",
            
            sellerId="Seller ID "A1B2C3D4E5F6G7"",
            
            marketplaceId="Marketplace ID "A1PA6795UKMFR9"",
            
        )
        logger.info(f"Response: {result}")
    except Exception as e:
        logger.error(f"Error: {e}")

require 'httparty'
require 'logger'

# Configure logging
logger = Logger.new(STDOUT)
logger.level = Logger::INFO

module SellerMagnetAPI
  class << self
    def fetch_get_amazon_seller_review(api_key, sellerId, marketplaceId, max_retries: 3, timeout: 10)
      # Fetch data from Get Amazon Seller Review endpoint with retry logic and error handling.
      #
      # @param api_key [String] API key for authentication
      # 
      # @param sellerId [Text] Seller ID (e.g., "A1B2C3D4E5F6G7")
      # 
      # @param marketplaceId [Text] Marketplace ID (e.g., "A1PA6795UKMFR9")
      # 
      # @param max_retries [Integer] Maximum number of retry attempts
      # @param timeout [Integer] Request timeout in seconds
      # @return [Hash] API response data
      # @raise [StandardError] If all retries fail
      url = "https://sellermagnet-api.com/amazon-seller-review"
      headers = {
        "Authorization" => "Bearer #{api_key}",
        "Content-Type" => "application/json"
      }
      params = {
        
        "sellerId" => sellerId,
        
        "marketplaceId" => marketplaceId,
        
      }

      max_retries.times do |attempt|
        begin
          logger.info("Attempt #{attempt + 1} to fetch Get Amazon Seller Review")
          response = HTTParty.get(url, headers: headers, query: params, timeout: timeout)
          return response.parsed_response if response.success?
        rescue StandardError => e
          logger.error("Attempt #{attempt + 1} failed: #{e.message}")
          raise("Failed to fetch Get Amazon Seller Review after #{max_retries} attempts: #{e.message}") if attempt + 1 == max_retries
          sleep(2 ** attempt) # Exponential backoff
        end
      end
    end
  end
end

# Example usage
begin
  result = SellerMagnetAPI.fetch_get_amazon_seller_review(
    "YOUR_API_KEY",
    
    "Seller ID "A1B2C3D4E5F6G7"",
    
    "Marketplace ID "A1PA6795UKMFR9"",
    
  )
  logger.info("Response: #{result}")
rescue StandardError => e
  logger.error("Error: #{e.message}")
end

const axios = require('axios');
const winston = require('winston');

// Configure logging
const logger = winston.createLogger({
    level: 'info',
    format: winston.format.combine(
        winston.format.timestamp(),
        winston.format.json()
    ),
    transports: [new winston.transports.Console()]
});

async function fetchGetAmazonSellerReview(apiKey, sellerId, marketplaceId, retries = 3, timeout = 10000) {
    /**
     * Fetch data from Get Amazon Seller Review endpoint with retry logic and error handling.
     * 
     * @param {string} apiKey - API key for authentication
     
     * @param {string} sellerId - Seller ID (e.g., "A1B2C3D4E5F6G7")
     
     * @param {string} marketplaceId - Marketplace ID (e.g., "A1PA6795UKMFR9")
     
     * @param {number} retries - Maximum number of retry attempts
     * @param {number} timeout - Request timeout in milliseconds
     * @returns {Promise} API response data
     * @throws {Error} If all retries fail
     */
    const url = `https://sellermagnet-api.com/amazon-seller-review`;
    const headers = {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json'
    };
    const params = {
        
        sellerId: sellerId,
        
        marketplaceId: marketplaceId,
        
    };

    for (let attempt = 0; attempt < retries; attempt++) {
        try {
            logger.info(`Attempt ${attempt + 1} to fetch Get Amazon Seller Review`);
            const response = await axios.get(url, { headers, params, timeout });
            return response.data;
        } catch (error) {
            logger.error(`Attempt ${attempt + 1} failed: ${error.message}`);
            if (attempt + 1 === retries) {
                throw new Error(`Failed to fetch Get Amazon Seller Review after ${retries} attempts: ${error.message}`);
            }
            await new Promise(resolve => setTimeout(resolve, 2 ** attempt * 1000)); // Exponential backoff
        }
    }
}

// Example usage
(async () => {
    try {
        const result = await fetchGetAmazonSellerReview(
            'YOUR_API_KEY',
            
            "Seller ID "A1B2C3D4E5F6G7"",
            
            "Marketplace ID "A1PA6795UKMFR9"",
            
        );
        logger.info('Response:', result);
    } catch (error) {
        logger.error(`Error: ${error.message}`);
    }
})();

                                                
                                            
                                        
                                    
                                        

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.HashMap;
import java.util.logging.Logger;
import java.util.stream.Collectors;

public class SellerMagnetAPIClient {
    private static final Logger LOGGER = Logger.getLogger(SellerMagnetAPIClient.class.getName());
    private final HttpClient client;

    public SellerMagnetAPIClient() {
        this.client = HttpClient.newBuilder().build();
    }

    /**
     * Fetch data from Get Amazon Seller Review endpoint with retry logic and error handling.
     *
     * @param apiKey API key for authentication
     * 
     * @param sellerId Seller ID (e.g., "A1B2C3D4E5F6G7")
     * 
     * @param marketplaceId Marketplace ID (e.g., "A1PA6795UKMFR9")
     * 
     * @param maxRetries Maximum number of retry attempts
     * @param timeoutSeconds Request timeout in seconds
     * @return API response data as a String
     * @throws Exception If all retries fail
     */
    public String fetchGetAmazonSellerReview(String apiKey, String sellerId, String marketplaceId, int maxRetries, int timeoutSeconds) throws Exception {
        String url = "https://sellermagnet-api.com/amazon-seller-review";
        Map params = new HashMap<>();
        
        params.put("sellerId", sellerId);
        
        params.put("marketplaceId", marketplaceId);
        
        
        String query = params.entrySet().stream()
            .map(e -> URLEncoder.encode(e.getKey(), StandardCharsets.UTF_8) + "=" + URLEncoder.encode(e.getValue(), StandardCharsets.UTF_8))
            .collect(Collectors.joining("&"));
        
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(url + "?" + query))
            .header("Authorization", "Bearer " + apiKey)
            .header("Content-Type", "application/json")
            .timeout(java.time.Duration.ofSeconds(timeoutSeconds))
            .GET()
            .build();
        
        for (int attempt = 0; attempt < maxRetries; attempt++) {
            try {
                LOGGER.info("Attempt " + (attempt + 1) + " to fetch Get Amazon Seller Review");
                HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
                if (response.statusCode() >= 200 && response.statusCode() < 300) {
                    return response.body();
                }
            } catch (Exception e) {
                LOGGER.severe("Attempt " + (attempt + 1) + " failed: " + e.getMessage());
                if (attempt + 1 == maxRetries) {
                    throw new Exception("Failed to fetch Get Amazon Seller Review after " + maxRetries + " attempts: " + e.getMessage());
                }
                Thread.sleep((long) Math.pow(2, attempt) * 1000); // Exponential backoff
            }
        }
        throw new Exception("Failed to fetch Get Amazon Seller Review after " + maxRetries + " attempts");
    }

    // Example usage
    public static void main(String[] args) {
        SellerMagnetAPIClient apiClient = new SellerMagnetAPIClient();
        try {
            String response = apiClient.fetchGetAmazonSellerReview(
                "YOUR_API_KEY",
                
                "Seller ID "A1B2C3D4E5F6G7"",
                
                "Marketplace ID "A1PA6795UKMFR9"",
                
                3,
                10
            );
            LOGGER.info("Response: " + response);
        } catch (Exception e) {
            LOGGER.severe("Error: " + e.getMessage());
        }
    }
}

package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "net/url"
    "time"
    "log"
)

// FetchGetAmazonSellerReview fetches data from Get Amazon Seller Review endpoint with retry logic and error handling.
//
// Parameters:
//   - apiKey: API key for authentication
//   
//   - sellerId: Seller ID (e.g., "A1B2C3D4E5F6G7")
//   
//   - marketplaceId: Marketplace ID (e.g., "A1PA6795UKMFR9")
//   
//   - maxRetries: Maximum number of retry attempts
//   - timeout: Request timeout duration
//
// Returns:
//   - []byte: API response data
//   - error: Any error encountered
func FetchGetAmazonSellerReview(apiKey string, sellerId string, marketplaceId string, maxRetries int, timeout time.Duration) ([]byte, error) {
    client := &http.Client{Timeout: timeout}
    params := url.Values{}
    
    params.Add("sellerId", sellerId)
    
    params.Add("marketplaceId", marketplaceId)
    
    
    url := "https://sellermagnet-api.com/amazon-seller-review?" + params.Encode()
    
    for attempt := 0; attempt < maxRetries; attempt++ {
        log.Printf("Attempt %d to fetch Get Amazon Seller Review", attempt+1)
        req, err := http.NewRequest("GET", url, nil)
        if err != nil {
            return nil, fmt.Errorf("failed to create request: %v", err)
        }
        req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
        req.Header.Set("Content-Type", "application/json")
        
        resp, err := client.Do(req)
        if err != nil {
            log.Printf("Attempt %d failed: %v", attempt+1, err)
            if attempt+1 == maxRetries {
                return nil, fmt.Errorf("failed after %d attempts: %v", maxRetries, err)
            }
            time.Sleep(time.Duration(1<= 200 && resp.StatusCode < 300 {
            body, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                return nil, fmt.Errorf("failed to read response: %v", err)
            }
            return body, nil
        }
    }
    return nil, fmt.Errorf("failed after %d attempts", maxRetries)
}

// Example usage
func main() {
    response, err := FetchGetAmazonSellerReview(
        "YOUR_API_KEY",
        
        "Seller ID "A1B2C3D4E5F6G7"",
        
        "Marketplace ID "A1PA6795UKMFR9"",
        
        3,
        10*time.Second,
    )
    if err != nil {
        log.Fatalf("Error: %v", err)
    }
    log.Printf("Response: %s", response)
}

#!/bin/bash

# Configure logging
LOG_FILE="/var/log/sellermagnet_api.log"
log() {
    echo "[$(date -Iseconds)] $1" >> "$LOG_FILE"
}

# API request function with retry logic
fetch_get_amazon_seller_review() {
    local API_KEY="$1"
    shift
    local URL="https://sellermagnet-api.com/amazon-seller-review"
    local PARAMS="sellerId=$1&shift;marketplaceId=$1&"
    local MAX_RETRIES=3
    local TIMEOUT=10

    log "Starting fetch for Get Amazon Seller Review"
    
    for ((i=1; i<=MAX_RETRIES; i++)); do
        RESPONSE=$(curl -s -X GET "${URL}?${PARAMS}" \
            -H "Authorization: Bearer ${API_KEY}" \
            -H "Content-Type: application/json" \
            --max-time ${TIMEOUT})
        if [ $? -eq 0 ]; then
            log "Fetch successful on attempt $i"
            echo "${RESPONSE}"
            return 0
        else
            log "Attempt $i failed"
            sleep $((2 ** i))
        fi
    done
    log "Error: Max retries reached"
    echo "Error: Max retries reached"
    return 1
}

# Example usage
fetch_get_amazon_seller_review "YOUR_API_KEY" \
    
    "Seller%20ID%20%22A1B2C3D4E5F6G7%22" \
    
    "Marketplace%20ID%20%22A1PA6795UKMFR9%22" \
    
Use Case

Access product details like price, images, and descriptions to build product comparison tools or enrich e-commerce catalogs.

Endpoint: /amazon-product-lookup

Method: GET

Parameters
Name Type Required Description
asin text Yes Product ASIN (e.g., 'B08N5WRWNW')
marketplaceId text Yes Marketplace ID (e.g., 'A1PA6795UKMFR9')
api_key text Yes Your API key
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "properties": {
    "data": {
      "additionalProperties": false,
      "properties": {
        "productInfo": {
          "additionalProperties": false,
          "description": "Detailed product information.",
          "properties": {
            "additionalDetails": {
              "additionalProperties": true,
              "description": "Detailed product information.",
              "properties": {
                "ASIN": {
                  "description": "Amazon Standard Identification Number (ASIN).",
                  "pattern": "^[A-Z0-9]{10}$",
                  "type": "string"
                },
                "Batteries": {
                  "description": "Battery requirements.",
                  "type": "string"
                },
                "Best Sellers Rank": {
                  "description": "Bestseller rank information.",
                  "type": "string"
                },
                "Customer Rating": {
                  "description": "Customer review summary.",
                  "type": "string"
                },
                "Date First Available": {
                  "description": "Date the product was first available.",
                  "type": "string"
                },
                "Item Weight": {
                  "description": "Weight of the item.",
                  "type": "string"
                },
                "Item model number": {
                  "description": "Model number of the item.",
                  "type": "string"
                },
                "Manufacturer": {
                  "description": "Manufacturer of the product.",
                  "type": "string"
                },
                "Number of Reviews": {
                  "description": "Total number of reviews with \u0027ratings\u0027 suffix.",
                  "type": "string"
                },
                "Product Dimensions": {
                  "description": "Dimensions of the product.",
                  "type": "string"
                },
                "Release date": {
                  "description": "Release date of the product.",
                  "type": "string"
                },
                "Type of item": {
                  "description": "Type of the item.",
                  "type": "string"
                }
              },
              "required": [
                "ASIN"
              ],
              "type": "object"
            },
            "asin": {
              "description": "Amazon Standard Identification Number (ASIN), a 10-character alphanumeric identifier.",
              "pattern": "^[A-Z0-9]{10}$",
              "type": "string"
            },
            "bestsellerRanks": {
              "additionalProperties": false,
              "description": "Bestseller rank information.",
              "properties": {
                "main_category": {
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "description": "Name of the main category.",
                      "minLength": 1,
                      "type": "string"
                    },
                    "rank": {
                      "description": "Bestseller rank in the main category.",
                      "minimum": 1,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "name",
                    "rank"
                  ],
                  "type": "object"
                },
                "subcategory": {
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "description": "Name of the subcategory (may be empty).",
                      "type": "string"
                    },
                    "rank": {
                      "description": "Bestseller rank in the subcategory (0 if not applicable).",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "name",
                    "rank"
                  ],
                  "type": "object"
                }
              },
              "required": [
                "main_category",
                "subcategory"
              ],
              "type": "object"
            },
            "bulletPoints": {
              "description": "List of product bullet points.",
              "items": {
                "description": "A product feature or specification.",
                "minLength": 1,
                "type": "string"
              },
              "type": "array"
            },
            "buyBoxInfo": {
              "additionalProperties": false,
              "description": "Buy box information.",
              "properties": {
                "currencyCode": {
                  "description": "Currency code (e.g., USD).",
                  "type": "string"
                },
                "currencyName": {
                  "description": "Full name of the currency.",
                  "minLength": 1,
                  "type": "string"
                },
                "currencySymbol": {
                  "description": "Symbol of the currency.",
                  "minLength": 1,
                  "type": "string"
                },
                "price": {
                  "description": "Buy box price.",
                  "minimum": 0,
                  "type": "number"
                },
                "sellerId": {
                  "description": "Unique identifier of the buy box seller.",
                  "pattern": "^[A-Z0-9]+$",
                  "type": "string"
                }
              },
              "required": [
                "currencyCode",
                "currencyName",
                "currencySymbol",
                "price",
                "sellerId"
              ],
              "type": "object"
            },
            "categories": {
              "additionalProperties": false,
              "description": "Bestseller category information.",
              "properties": {
                "bestsellerCategory": {
                  "description": "List of bestseller categories.",
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "description": "Category identifier.",
                        "type": "string"
                      },
                      "index": {
                        "description": "Index of the category in the hierarchy.",
                        "minimum": 1,
                        "type": "integer"
                      },
                      "name": {
                        "description": "Name of the category.",
                        "minLength": 1,
                        "type": "string"
                      },
                      "url": {
                        "description": "URL to the category page on Amazon.",
                        "format": "uri",
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "index",
                      "name",
                      "url"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "rootCategory": {
                  "additionalProperties": false,
                  "description": "Root category details.",
                  "properties": {
                    "id": {
                      "description": "Root category identifier.",
                      "type": "string"
                    },
                    "name": {
                      "description": "Name of the root category.",
                      "minLength": 1,
                      "type": "string"
                    },
                    "url": {
                      "description": "URL to the root category page on Amazon.",
                      "format": "uri",
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "url"
                  ],
                  "type": "object"
                }
              },
              "required": [
                "bestsellerCategory",
                "rootCategory"
              ],
              "type": "object"
            },
            "description": {
              "description": "Product description (may be empty).",
              "items": {
                "description": "A description segment.",
                "type": "string"
              },
              "type": "array"
            },
            "details": {
              "additionalProperties": true,
              "description": "Additional product details.",
              "properties": {
                "ASIN": {
                  "description": "Amazon Standard Identification Number (ASIN).",
                  "pattern": "^[A-Z0-9]{10}$",
                  "type": "string"
                },
                "Batteries": {
                  "description": "Battery requirements.",
                  "type": "string"
                },
                "Date First Available": {
                  "description": "Date the product was first available.",
                  "type": "string"
                },
                "Item Weight": {
                  "description": "Weight of the item.",
                  "type": "string"
                },
                "Item model number": {
                  "description": "Model number of the item.",
                  "type": "string"
                },
                "Manufacturer": {
                  "description": "Manufacturer of the product.",
                  "type": "string"
                },
                "Platform": {
                  "description": "Platform of the product.",
                  "type": "string"
                },
                "Product Dimensions": {
                  "description": "Dimensions of the product.",
                  "type": "string"
                },
                "Release date": {
                  "description": "Release date of the product.",
                  "type": "string"
                },
                "Type of item": {
                  "description": "Type of the item.",
                  "type": "string"
                }
              },
              "required": [
                "ASIN"
              ],
              "type": "object"
            },
            "hasAPlusContent": {
              "description": "Indicates if the product has A+ Content.",
              "type": "boolean"
            },
            "images": {
              "description": "List of product image URLs.",
              "items": {
                "description": "URL to a product image.",
                "format": "uri",
                "type": "string"
              },
              "type": "array"
            },
            "link": {
              "description": "URL to the product page on Amazon.",
              "format": "uri",
              "type": "string"
            },
            "listedSinceDate": {
              "description": "Date when the product was first listed, in YYYY-MM-DD format, or null if unavailable.",
              "format": "date",
              "type": [
                "string",
                "null"
              ]
            },
            "mainImage": {
              "description": "URL to the main product image.",
              "format": "uri",
              "type": "string"
            },
            "marketplaceId": {
              "description": "Unique identifier for the marketplace.",
              "pattern": "^[A-Z0-9]+$",
              "type": "string"
            },
            "reviews": {
              "additionalProperties": false,
              "description": "Product review summary.",
              "properties": {
                "averageRating": {
                  "description": "Average star rating.",
                  "maximum": 5,
                  "minimum": 0,
                  "type": "number"
                },
                "reviewSummary": {
                  "description": "Title of the review summary.",
                  "type": "string"
                },
                "totalReviews": {
                  "description": "Total number of reviews.",
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "averageRating",
                "reviewSummary",
                "totalReviews"
              ],
              "type": "object"
            },
            "title": {
              "description": "Title of the product.",
              "minLength": 1,
              "type": "string"
            },
            "variations": {
              "description": "List of product variations.",
              "items": {
                "additionalProperties": false,
                "description": "A product variation.",
                "properties": {
                  "asin": {
                    "description": "ASIN of the variation.",
                    "pattern": "^[A-Z0-9]{10}$",
                    "type": "string"
                  },
                  "attributes": {
                    "additionalProperties": true,
                    "description": "Attributes of the variation (e.g., Pattern Name, Style).",
                    "type": "object"
                  }
                },
                "required": [
                  "asin",
                  "attributes"
                ],
                "type": "object"
              },
              "type": "array"
            },
            "videos": {
              "description": "List of product video URLs.",
              "items": {
                "description": "URL to a product video.",
                "format": "uri",
                "type": "string"
              },
              "type": "array"
            }
          },
          "required": [
            "additionalDetails",
            "asin",
            "bestsellerRanks",
            "bulletPoints",
            "buyBoxInfo",
            "categories",
            "description",
            "details",
            "hasAPlusContent",
            "images",
            "link",
            "listedSinceDate",
            "mainImage",
            "marketplaceId",
            "reviews",
            "title",
            "variations",
            "videos"
          ],
          "type": "object"
        }
      },
      "required": [
        "productInfo"
      ],
      "type": "object"
    },
    "success": {
      "description": "Indicates whether the API request was successful.",
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "success"
  ],
  "type": "object"
}
Response Example
{
  "data": {
    "productInfo": {
      "additionalDetails": {
        "ASIN": "B0CL61F39H",
        "Batteries": "1 Lithium Ion batteries required. (included)",
        "Best Sellers Rank": "Nr. 31 in Video Games Nr. 1 in PlayStation 5 Consoles",
        "Customer Rating": "4.7 out of 5 stars",
        "Date First Available": "December 10, 2023",
        "Item Weight": "10.6 pounds",
        "Item model number": "CFI-2015",
        "Manufacturer": "Sony",
        "Number of Reviews": "7,092 ratings",
        "Product Dimensions": "14 x 17 x 7 inches; 10.6 Pounds",
        "Release date": "December 10, 2023",
        "Type of item": "Video Game"
      },
      "asin": "B0CL61F39H",
      "bestsellerRanks": {
        "main_category": {
          "name": "Video Games",
          "rank": 31
        },
        "subcategory": {
          "name": "PlayStation",
          "rank": 1
        }
      },
      "bulletPoints": [
        "Model Number CFI-2000",
        "Includes DualSense Wireless Controller, 1TB SSD, Disc Drive, 2 Horizontal Stand Feet, HDMI Cable, AC power cord, USB cable, printed materials, ASTRO\u2019s PLAYROOM (Pre-installed game)",
        "Vertical Stand sold separately"
      ],
      "buyBoxInfo": {
        "currencyCode": "USD",
        "currencyName": "United States Dollar",
        "currencySymbol": "$",
        "price": 444.99,
        "sellerId": "A3853PJW50SJG8"
      },
      "categories": {
        "bestsellerCategory": [
          {
            "id": "20972781011",
            "index": 1,
            "name": "PlayStation 5",
            "url": "https://www.amazon.com/b/ref=dp_bc_2?ie=UTF8\u0026node=20972781011"
          },
          {
            "id": "20972796011",
            "index": 2,
            "name": "Consoles",
            "url": "https://www.amazon.com/b/ref=dp_bc_3?ie=UTF8\u0026node=20972796011"
          }
        ],
        "rootCategory": {
          "id": "468642",
          "name": "Video Games",
          "url": "https://www.amazon.com/computer-video-games-hardware-accessories/b/ref=dp_bc_1?ie=UTF8\u0026node=468642"
        }
      },
      "description": [
        "Model Number CFI-2000",
        "Includes DualSense Wireless Controller, 1TB SSD, Disc Drive, 2 Horizontal Stand Feet, HDMI Cable, AC power cord, USB cable, printed materials, ASTRO\u2019s PLAYROOM (Pre-installed game)",
        "Vertical Stand sold separately",
        "The PS5 console unleashes new gaming possibilities that you never anticipated. Experience lightning fast loading with an ultra-high speed SSD, deeper immersion with support for haptic feedback, adaptive triggers, and 3D Audio*, and an all-new generation of incredible PlayStation games. Lightning Speed - Harness the power of a custom CPU, GPU, and SSD with Integrated I/O that rewrite the rules of what a PlayStation console can do. Stunning Games - Marvel at incredible graphics and experience new PS5 features. Play a back catalog of supported PS4 games. Breathtaking Immersion - Discover a deeper gaming experience with support for haptic feedback, adaptive triggers, and 3D Audio technology. Vertical stand sold separately. *3D audio via built-in TV speakers or analog/USB stereo headphones. Set up and latest system software update required."
      ],
      "details": {
        "ASIN": "B0CL61F39H",
        "Batteries": "1 Lithium Ion batteries required. (included)",
        "Date First Available": "December 10, 2023",
        "Item Weight": "10.6 pounds",
        "Item model number": "CFI-2015",
        "Manufacturer": "Sony",
        "Platform": "PlayStation 5",
        "Product Dimensions": "14 x 17 x 7 inches; 10.6 Pounds",
        "Release date": "December 10, 2023",
        "Type of item": "Video Game"
      },
      "hasAPlusContent": true,
      "images": [
        "https://m.media-amazon.com/images/I/41ECK5cY-2L._SL1000_.jpg",
        "https://m.media-amazon.com/images/I/41srF-iY93L._SL1000_.jpg",
        "https://m.media-amazon.com/images/I/41tVr19I3zL._SL1000_.jpg",
        "https://m.media-amazon.com/images/I/41HMaO9jO3L._SL1000_.jpg",
        "https://m.media-amazon.com/images/I/61e8hPmeoYL._SL1000_.jpg",
        "https://m.media-amazon.com/images/I/61Gj1Kc5R5L._SL1000_.jpg",
        "https://m.media-amazon.com/images/I/61r6PutKGwL._SL1000_.jpg",
        "https://m.media-amazon.com/images/I/717Id5h1fhL._SL1000_.jpg"
      ],
      "link": "https://www.amazon.com/dp/B0CL61F39H",
      "listedSinceDate": "2023-12-10",
      "mainImage": "https://m.media-amazon.com/images/I/31kTNmpm6vL.jpg",
      "marketplaceId": "ATVPDKIKX0DER",
      "reviews": {
        "averageRating": 4.7,
        "reviewSummary": "4.7 out of 5 stars",
        "totalReviews": 7092
      },
      "title": "PlayStation\u00ae5 console (slim)",
      "variations": [
        {
          "asin": "B0F6968Y5G",
          "attributes": {
            "Pattern Name": "PS5 w/ Black Ops Bundle",
            "Style": "PlayStation\u00ae5 Digital Edition (slim)"
          }
        },
        {
          "asin": "B0CL5KNB9M",
          "attributes": {
            "Pattern Name": "PS5 Only",
            "Style": "PlayStation\u00ae5 Digital Edition (slim)"
          }
        },
        {
          "asin": "B0CL61F39H",
          "attributes": {
            "Pattern Name": "PS5 Only",
            "Style": "PlayStation\u00ae5 console (slim)"
          }
        },
        {
          "asin": "B0F691TJTP",
          "attributes": {
            "Pattern Name": "PS5 w/ Black Ops Bundle",
            "Style": "PlayStation\u00ae5 console (slim)"
          }
        },
        {
          "asin": "B0FD54CGQ8",
          "attributes": {
            "Pattern Name": "PS5 w/ $100 PlayStation Store GC",
            "Style": "PlayStation\u00ae5 Digital Edition (slim)"
          }
        },
        {
          "asin": "B0FD4WGVH5",
          "attributes": {
            "Pattern Name": "PS5 w/ $100 PlayStation Store GC",
            "Style": "PlayStation\u00ae5 console (slim)"
          }
        }
      ],
      "videos": [
        "https://m.media-amazon.com/S/vse-vms-transcoding-artifact-us-east-1-prod/8af0ddf1-55f5-4e71-9463-39602c3edbae/default.jobtemplate.hls.m3u8",
        "https://m.media-amazon.com/S/vse-vms-transcoding-artifact-us-east-1-prod/50938d5c-2a9b-427a-b766-21b7cd63502e/default.jobtemplate.hls.m3u8"
      ]
    }
  },
  "success": true
}
Code Examples
Python
Ruby
Javascript
Java
Go
Curl

import requests
import time
import logging

# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)

def fetch_get_amazon_product(api_key, asin, marketplaceId, max_retries=3, timeout=10):
    """
    Fetch data from Get Amazon Product endpoint with retry logic and error handling.
    
    Args:
        api_key (str): API key for authentication
        
        asin (text): Product ASIN (e.g., 'B08N5WRWNW')
        
        marketplaceId (text): Marketplace ID (e.g., 'A1PA6795UKMFR9')
        
        max_retries (int): Maximum number of retry attempts
        timeout (int): Request timeout in seconds
    
    Returns:
        dict: API response data
    
    Raises:
        Exception: If all retries fail
    """
    url = "https://sellermagnet-api.com/amazon-product-lookup"
    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"
    }
    params = {
        
        "asin": asin,
        
        "marketplaceId": marketplaceId,
        
    }
    
    for attempt in range(max_retries):
        try:
            logger.info(f"Attempt {attempt + 1} to fetch Get Amazon Product")
            response = requests.get(url, headers=headers, params=params, timeout=timeout)
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            logger.error(f"Attempt {attempt + 1} failed: {e}")
            if attempt + 1 == max_retries:
                raise Exception(f"Failed to fetch Get Amazon Product after {max_retries} attempts: {e}")
            time.sleep(2 ** attempt)  # Exponential backoff
    
    return {}

# Example usage
if __name__ == "__main__":
    try:
        result = fetch_get_amazon_product(
            api_key="YOUR_API_KEY",
            
            asin="Product ASIN 'B08N5WRWNW'",
            
            marketplaceId="Marketplace ID 'A1PA6795UKMFR9'",
            
        )
        logger.info(f"Response: {result}")
    except Exception as e:
        logger.error(f"Error: {e}")

require 'httparty'
require 'logger'

# Configure logging
logger = Logger.new(STDOUT)
logger.level = Logger::INFO

module SellerMagnetAPI
  class << self
    def fetch_get_amazon_product(api_key, asin, marketplaceId, max_retries: 3, timeout: 10)
      # Fetch data from Get Amazon Product endpoint with retry logic and error handling.
      #
      # @param api_key [String] API key for authentication
      # 
      # @param asin [Text] Product ASIN (e.g., 'B08N5WRWNW')
      # 
      # @param marketplaceId [Text] Marketplace ID (e.g., 'A1PA6795UKMFR9')
      # 
      # @param max_retries [Integer] Maximum number of retry attempts
      # @param timeout [Integer] Request timeout in seconds
      # @return [Hash] API response data
      # @raise [StandardError] If all retries fail
      url = "https://sellermagnet-api.com/amazon-product-lookup"
      headers = {
        "Authorization" => "Bearer #{api_key}",
        "Content-Type" => "application/json"
      }
      params = {
        
        "asin" => asin,
        
        "marketplaceId" => marketplaceId,
        
      }

      max_retries.times do |attempt|
        begin
          logger.info("Attempt #{attempt + 1} to fetch Get Amazon Product")
          response = HTTParty.get(url, headers: headers, query: params, timeout: timeout)
          return response.parsed_response if response.success?
        rescue StandardError => e
          logger.error("Attempt #{attempt + 1} failed: #{e.message}")
          raise("Failed to fetch Get Amazon Product after #{max_retries} attempts: #{e.message}") if attempt + 1 == max_retries
          sleep(2 ** attempt) # Exponential backoff
        end
      end
    end
  end
end

# Example usage
begin
  result = SellerMagnetAPI.fetch_get_amazon_product(
    "YOUR_API_KEY",
    
    "Product ASIN 'B08N5WRWNW'",
    
    "Marketplace ID 'A1PA6795UKMFR9'",
    
  )
  logger.info("Response: #{result}")
rescue StandardError => e
  logger.error("Error: #{e.message}")
end

const axios = require('axios');
const winston = require('winston');

// Configure logging
const logger = winston.createLogger({
    level: 'info',
    format: winston.format.combine(
        winston.format.timestamp(),
        winston.format.json()
    ),
    transports: [new winston.transports.Console()]
});

async function fetchGetAmazonProduct(apiKey, asin, marketplaceId, retries = 3, timeout = 10000) {
    /**
     * Fetch data from Get Amazon Product endpoint with retry logic and error handling.
     * 
     * @param {string} apiKey - API key for authentication
     
     * @param {string} asin - Product ASIN (e.g., 'B08N5WRWNW')
     
     * @param {string} marketplaceId - Marketplace ID (e.g., 'A1PA6795UKMFR9')
     
     * @param {number} retries - Maximum number of retry attempts
     * @param {number} timeout - Request timeout in milliseconds
     * @returns {Promise} API response data
     * @throws {Error} If all retries fail
     */
    const url = `https://sellermagnet-api.com/amazon-product-lookup`;
    const headers = {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json'
    };
    const params = {
        
        asin: asin,
        
        marketplaceId: marketplaceId,
        
    };

    for (let attempt = 0; attempt < retries; attempt++) {
        try {
            logger.info(`Attempt ${attempt + 1} to fetch Get Amazon Product`);
            const response = await axios.get(url, { headers, params, timeout });
            return response.data;
        } catch (error) {
            logger.error(`Attempt ${attempt + 1} failed: ${error.message}`);
            if (attempt + 1 === retries) {
                throw new Error(`Failed to fetch Get Amazon Product after ${retries} attempts: ${error.message}`);
            }
            await new Promise(resolve => setTimeout(resolve, 2 ** attempt * 1000)); // Exponential backoff
        }
    }
}

// Example usage
(async () => {
    try {
        const result = await fetchGetAmazonProduct(
            'YOUR_API_KEY',
            
            "Product ASIN 'B08N5WRWNW'",
            
            "Marketplace ID 'A1PA6795UKMFR9'",
            
        );
        logger.info('Response:', result);
    } catch (error) {
        logger.error(`Error: ${error.message}`);
    }
})();

                                                
                                            
                                        
                                    
                                        

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.HashMap;
import java.util.logging.Logger;
import java.util.stream.Collectors;

public class SellerMagnetAPIClient {
    private static final Logger LOGGER = Logger.getLogger(SellerMagnetAPIClient.class.getName());
    private final HttpClient client;

    public SellerMagnetAPIClient() {
        this.client = HttpClient.newBuilder().build();
    }

    /**
     * Fetch data from Get Amazon Product endpoint with retry logic and error handling.
     *
     * @param apiKey API key for authentication
     * 
     * @param asin Product ASIN (e.g., 'B08N5WRWNW')
     * 
     * @param marketplaceId Marketplace ID (e.g., 'A1PA6795UKMFR9')
     * 
     * @param maxRetries Maximum number of retry attempts
     * @param timeoutSeconds Request timeout in seconds
     * @return API response data as a String
     * @throws Exception If all retries fail
     */
    public String fetchGetAmazonProduct(String apiKey, String asin, String marketplaceId, int maxRetries, int timeoutSeconds) throws Exception {
        String url = "https://sellermagnet-api.com/amazon-product-lookup";
        Map params = new HashMap<>();
        
        params.put("asin", asin);
        
        params.put("marketplaceId", marketplaceId);
        
        
        String query = params.entrySet().stream()
            .map(e -> URLEncoder.encode(e.getKey(), StandardCharsets.UTF_8) + "=" + URLEncoder.encode(e.getValue(), StandardCharsets.UTF_8))
            .collect(Collectors.joining("&"));
        
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(url + "?" + query))
            .header("Authorization", "Bearer " + apiKey)
            .header("Content-Type", "application/json")
            .timeout(java.time.Duration.ofSeconds(timeoutSeconds))
            .GET()
            .build();
        
        for (int attempt = 0; attempt < maxRetries; attempt++) {
            try {
                LOGGER.info("Attempt " + (attempt + 1) + " to fetch Get Amazon Product");
                HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
                if (response.statusCode() >= 200 && response.statusCode() < 300) {
                    return response.body();
                }
            } catch (Exception e) {
                LOGGER.severe("Attempt " + (attempt + 1) + " failed: " + e.getMessage());
                if (attempt + 1 == maxRetries) {
                    throw new Exception("Failed to fetch Get Amazon Product after " + maxRetries + " attempts: " + e.getMessage());
                }
                Thread.sleep((long) Math.pow(2, attempt) * 1000); // Exponential backoff
            }
        }
        throw new Exception("Failed to fetch Get Amazon Product after " + maxRetries + " attempts");
    }

    // Example usage
    public static void main(String[] args) {
        SellerMagnetAPIClient apiClient = new SellerMagnetAPIClient();
        try {
            String response = apiClient.fetchGetAmazonProduct(
                "YOUR_API_KEY",
                
                "Product ASIN 'B08N5WRWNW'",
                
                "Marketplace ID 'A1PA6795UKMFR9'",
                
                3,
                10
            );
            LOGGER.info("Response: " + response);
        } catch (Exception e) {
            LOGGER.severe("Error: " + e.getMessage());
        }
    }
}

package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "net/url"
    "time"
    "log"
)

// FetchGetAmazonProduct fetches data from Get Amazon Product endpoint with retry logic and error handling.
//
// Parameters:
//   - apiKey: API key for authentication
//   
//   - asin: Product ASIN (e.g., 'B08N5WRWNW')
//   
//   - marketplaceId: Marketplace ID (e.g., 'A1PA6795UKMFR9')
//   
//   - maxRetries: Maximum number of retry attempts
//   - timeout: Request timeout duration
//
// Returns:
//   - []byte: API response data
//   - error: Any error encountered
func FetchGetAmazonProduct(apiKey string, asin string, marketplaceId string, maxRetries int, timeout time.Duration) ([]byte, error) {
    client := &http.Client{Timeout: timeout}
    params := url.Values{}
    
    params.Add("asin", asin)
    
    params.Add("marketplaceId", marketplaceId)
    
    
    url := "https://sellermagnet-api.com/amazon-product-lookup?" + params.Encode()
    
    for attempt := 0; attempt < maxRetries; attempt++ {
        log.Printf("Attempt %d to fetch Get Amazon Product", attempt+1)
        req, err := http.NewRequest("GET", url, nil)
        if err != nil {
            return nil, fmt.Errorf("failed to create request: %v", err)
        }
        req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
        req.Header.Set("Content-Type", "application/json")
        
        resp, err := client.Do(req)
        if err != nil {
            log.Printf("Attempt %d failed: %v", attempt+1, err)
            if attempt+1 == maxRetries {
                return nil, fmt.Errorf("failed after %d attempts: %v", maxRetries, err)
            }
            time.Sleep(time.Duration(1<= 200 && resp.StatusCode < 300 {
            body, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                return nil, fmt.Errorf("failed to read response: %v", err)
            }
            return body, nil
        }
    }
    return nil, fmt.Errorf("failed after %d attempts", maxRetries)
}

// Example usage
func main() {
    response, err := FetchGetAmazonProduct(
        "YOUR_API_KEY",
        
        "Product ASIN 'B08N5WRWNW'",
        
        "Marketplace ID 'A1PA6795UKMFR9'",
        
        3,
        10*time.Second,
    )
    if err != nil {
        log.Fatalf("Error: %v", err)
    }
    log.Printf("Response: %s", response)
}

#!/bin/bash

# Configure logging
LOG_FILE="/var/log/sellermagnet_api.log"
log() {
    echo "[$(date -Iseconds)] $1" >> "$LOG_FILE"
}

# API request function with retry logic
fetch_get_amazon_product() {
    local API_KEY="$1"
    shift
    local URL="https://sellermagnet-api.com/amazon-product-lookup"
    local PARAMS="asin=$1&shift;marketplaceId=$1&"
    local MAX_RETRIES=3
    local TIMEOUT=10

    log "Starting fetch for Get Amazon Product"
    
    for ((i=1; i<=MAX_RETRIES; i++)); do
        RESPONSE=$(curl -s -X GET "${URL}?${PARAMS}" \
            -H "Authorization: Bearer ${API_KEY}" \
            -H "Content-Type: application/json" \
            --max-time ${TIMEOUT})
        if [ $? -eq 0 ]; then
            log "Fetch successful on attempt $i"
            echo "${RESPONSE}"
            return 0
        else
            log "Attempt $i failed"
            sleep $((2 ** i))
        fi
    done
    log "Error: Max retries reached"
    echo "Error: Max retries reached"
    return 1
}

# Example usage
fetch_get_amazon_product "YOUR_API_KEY" \
    
    "Product%20ASIN%20%27B08N5WRWNW%27" \
    
    "Marketplace%20ID%20%27A1PA6795UKMFR9%27" \
    
Use Case

Analyze multiple offers for a product to identify the best price or seller, perfect for price tracking or arbitrage applications.

Endpoint: /amazon-product-offers

Method: GET

Parameters
Name Type Required Description
asin text Yes Product ASIN (e.g., 'B08N5WRWNW')
marketplaceId text Yes Marketplace ID (e.g., 'A1PA6795UKMFR9')
geo_location text No Detailed Geo Location ZIP CODE
api_key text Yes Your API key
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "properties": {
    "data": {
      "additionalProperties": false,
      "properties": {
        "asin": {
          "description": "Amazon Standard Identification Number (ASIN), a 10-character alphanumeric identifier.",
          "pattern": "^[A-Z0-9]{10}$",
          "type": "string"
        },
        "buyBox": {
          "additionalProperties": false,
          "description": "Buy box information.",
          "properties": {
            "condition": {
              "description": "Condition of the buy box product.",
              "enum": [
                "New",
                "Used - Like New",
                "Used - Very Good",
                "Used - Good",
                "Used - Acceptable"
              ],
              "type": "string"
            },
            "deliveryDate": {
              "description": "Expected delivery date in YYYY-MM-DD format.",
              "format": "date",
              "type": "string"
            },
            "fulfillmentType": {
              "description": "Fulfillment method (FBA or FBM).",
              "enum": [
                "FBA",
                "FBM"
              ],
              "type": "string"
            },
            "inventory": {
              "description": "Number of items available in seller\u0027s inventory.",
              "minimum": 0,
              "type": "integer"
            },
            "positivePercentage": {
              "description": "Percentage of positive reviews for the seller.",
              "maximum": 100,
              "minimum": 0,
              "type": "integer"
            },
            "priceWithoutShipping": {
              "description": "Price excluding shipping.",
              "minimum": 0,
              "type": "number"
            },
            "sellerId": {
              "description": "Unique identifier of the buy box seller or \u0027Amazon\u0027.",
              "pattern": "^[A-Z0-9]+$|^Amazon$",
              "type": "string"
            },
            "sellerName": {
              "description": "Name of the buy box seller.",
              "minLength": 1,
              "type": "string"
            },
            "shippingPrice": {
              "description": "Shipping cost for the buy box offer.",
              "minimum": 0,
              "type": "number"
            },
            "totalPrice": {
              "description": "Total price including shipping.",
              "minimum": 0,
              "type": "number"
            },
            "totalReviews": {
              "description": "Total number of reviews for the seller.",
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "condition",
            "deliveryDate",
            "fulfillmentType",
            "inventory",
            "positivePercentage",
            "priceWithoutShipping",
            "sellerId",
            "sellerName",
            "shippingPrice",
            "totalPrice",
            "totalReviews"
          ],
          "type": "object"
        },
        "currency": {
          "additionalProperties": false,
          "description": "Currency details.",
          "properties": {
            "code": {
              "description": "Currency code (e.g., USD).",
              "type": "string"
            },
            "name": {
              "description": "Full name of the currency.",
              "minLength": 1,
              "type": "string"
            },
            "symbol": {
              "description": "Symbol of the currency.",
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "code",
            "name",
            "symbol"
          ],
          "type": "object"
        },
        "marketplaceId": {
          "description": "Unique identifier for the marketplace.",
          "pattern": "^[A-Z0-9]+$",
          "type": "string"
        },
        "offers": {
          "description": "List of offers for the product.",
          "items": {
            "additionalProperties": false,
            "description": "Details of an offer for the product.",
            "properties": {
              "condition": {
                "description": "Condition of the product.",
                "enum": [
                  "New",
                  "Used - Like New",
                  "Used - Very Good",
                  "Used - Good",
                  "Used - Acceptable"
                ],
                "type": "string"
              },
              "deliveryDate": {
                "description": "Expected delivery date in YYYY-MM-DD format.",
                "format": "date",
                "type": "string"
              },
              "fulfillmentType": {
                "description": "Fulfillment method (FBA or FBM).",
                "enum": [
                  "FBA",
                  "FBM"
                ],
                "type": "string"
              },
              "inventory": {
                "description": "Number of items available in seller\u0027s inventory.",
                "minimum": 0,
                "type": "integer"
              },
              "positivePercentage": {
                "description": "Percentage of positive reviews for the seller.",
                "maximum": 100,
                "minimum": 0,
                "type": "integer"
              },
              "priceWithoutShipping": {
                "description": "Price excluding shipping.",
                "minimum": 0,
                "type": "number"
              },
              "sellerId": {
                "description": "Unique identifier of the seller or \u0027Amazon\u0027.",
                "pattern": "^[A-Z0-9]+$|^Amazon$",
                "type": "string"
              },
              "sellerName": {
                "description": "Name of the seller.",
                "minLength": 1,
                "type": "string"
              },
              "shippingPrice": {
                "description": "Shipping cost for the offer.",
                "minimum": 0,
                "type": "number"
              },
              "totalPrice": {
                "description": "Total price including shipping.",
                "minimum": 0,
                "type": "number"
              },
              "totalReviews": {
                "description": "Total number of reviews for the seller.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "condition",
              "deliveryDate",
              "fulfillmentType",
              "inventory",
              "positivePercentage",
              "priceWithoutShipping",
              "sellerId",
              "sellerName",
              "shippingPrice",
              "totalPrice",
              "totalReviews"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "productLink": {
          "description": "URL to the product page on Amazon.",
          "format": "uri",
          "type": "string"
        },
        "productMainImage": {
          "description": "URL to the main product image.",
          "format": "uri",
          "type": "string"
        },
        "productTitle": {
          "description": "Title of the product.",
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "asin",
        "buyBox",
        "currency",
        "marketplaceId",
        "offers",
        "productLink",
        "productMainImage",
        "productTitle"
      ],
      "type": "object"
    },
    "success": {
      "description": "Indicates whether the API request was successful.",
      "type": "boolean"
    }
  },
  "required": [
    "data",
    "success"
  ],
  "type": "object"
}
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
      },
      {
        "condition": "Used - Very Good",
        "deliveryDate": "2025-06-30",
        "fulfillmentType": "FBM",
        "inventory": 1,
        "positivePercentage": 40,
        "priceWithoutShipping": 418.99,
        "sellerId": "A2NBVGK6C0HCUA",
        "sellerName": "Fix N Plug",
        "shippingPrice": 3.99,
        "totalPrice": 422.98,
        "totalReviews": 30
      },
      {
        "condition": "Used - Good",
        "deliveryDate": "2025-06-30",
        "fulfillmentType": "FBM",
        "inventory": 1,
        "positivePercentage": 94,
        "priceWithoutShipping": 423.99,
        "sellerId": "AZZMAGMBAQU46",
        "sellerName": "VG1shop (Serial # Recorded)",
        "shippingPrice": 3.99,
        "totalPrice": 427.98,
        "totalReviews": 163
      },
      {
        "condition": "Used - Acceptable",
        "deliveryDate": "2025-06-28",
        "fulfillmentType": "FBM",
        "inventory": 1,
        "positivePercentage": 0,
        "priceWithoutShipping": 433.85,
        "sellerId": "Amazon",
        "sellerName": "Amazon Resale",
        "shippingPrice": 0,
        "totalPrice": 433.85,
        "totalReviews": 0
      },
      {
        "condition": "Used - Very Good",
        "deliveryDate": "2025-07-01",
        "fulfillmentType": "FBM",
        "inventory": 1,
        "positivePercentage": 73,
        "priceWithoutShipping": 419.99,
        "sellerId": "AO9EU0V84CET9",
        "sellerName": "StarEdge Electronics",
        "shippingPrice": 15.75,
        "totalPrice": 435.74,
        "totalReviews": 154
      },
      {
        "condition": "Used - Very Good",
        "deliveryDate": "2025-06-27",
        "fulfillmentType": "FBM",
        "inventory": 2,
        "positivePercentage": 74,
        "priceWithoutShipping": 441.49,
        "sellerId": "A2E7NH3SLWCOH4",
        "sellerName": "Tech for Less",
        "shippingPrice": 0,
        "totalPrice": 441.49,
        "totalReviews": 56746
      },
      {
        "condition": "Used - Very Good",
        "deliveryDate": "2025-06-27",
        "fulfillmentType": "FBM",
        "inventory": 1,
        "positivePercentage": 84,
        "priceWithoutShipping": 443.7,
        "sellerId": "A3JEKQLX9Y2C9L",
        "sellerName": "SaveCentral",
        "shippingPrice": 0,
        "totalPrice": 443.7,
        "totalReviews": 7483
      },
      {
        "condition": "Used - Like New",
        "deliveryDate": "2025-06-27",
        "fulfillmentType": "FBM",
        "inventory": 2,
        "positivePercentage": 80,
        "priceWithoutShipping": 439.99,
        "sellerId": "A1KOYPV53GXGUI",
        "sellerName": "JRS GAMES",
        "shippingPrice": 3.99,
        "totalPrice": 443.98,
        "totalReviews": 81
      },
      {
        "condition": "Used - Very Good",
        "deliveryDate": "2025-06-28",
        "fulfillmentType": "FBA",
        "inventory": 8,
        "positivePercentage": 82,
        "priceWithoutShipping": 444.99,
        "sellerId": "A3853PJW50SJG8",
        "sellerName": "Wardyga Management Services LLC",
        "shippingPrice": 0,
        "totalPrice": 444.99,
        "totalReviews": 60
      }
    ],
    "productLink": "https://www.amazon.com/dp/B0CL61F39H",
    "productMainImage": "https://m.media-amazon.com/images/I/31kTNmpm6vL.jpg",
    "productTitle": "PlayStation\u00ae5 console (slim)"
  },
  "success": true
}
Code Examples
Python
Ruby
Javascript
Java
Go
Curl

import requests
import time
import logging

# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)

def fetch_get_amazon_product_offers(api_key, asin, marketplaceId, geo_location, max_retries=3, timeout=10):
    """
    Fetch data from Get Amazon Product Offers endpoint with retry logic and error handling.
    
    Args:
        api_key (str): API key for authentication
        
        asin (text): Product ASIN (e.g., 'B08N5WRWNW')
        
        marketplaceId (text): Marketplace ID (e.g., 'A1PA6795UKMFR9')
        
        geo_location (text): Detailed Geo Location ZIP CODE
        
        max_retries (int): Maximum number of retry attempts
        timeout (int): Request timeout in seconds
    
    Returns:
        dict: API response data
    
    Raises:
        Exception: If all retries fail
    """
    url = "https://sellermagnet-api.com/amazon-product-offers"
    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"
    }
    params = {
        
        "asin": asin,
        
        "marketplaceId": marketplaceId,
        
        "geo_location": geo_location,
        
    }
    
    for attempt in range(max_retries):
        try:
            logger.info(f"Attempt {attempt + 1} to fetch Get Amazon Product Offers")
            response = requests.get(url, headers=headers, params=params, timeout=timeout)
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            logger.error(f"Attempt {attempt + 1} failed: {e}")
            if attempt + 1 == max_retries:
                raise Exception(f"Failed to fetch Get Amazon Product Offers after {max_retries} attempts: {e}")
            time.sleep(2 ** attempt)  # Exponential backoff
    
    return {}

# Example usage
if __name__ == "__main__":
    try:
        result = fetch_get_amazon_product_offers(
            api_key="YOUR_API_KEY",
            
            asin="Product ASIN 'B08N5WRWNW'",
            
            marketplaceId="Marketplace ID 'A1PA6795UKMFR9'",
            
            geo_location="geo_location",
            
        )
        logger.info(f"Response: {result}")
    except Exception as e:
        logger.error(f"Error: {e}")

require 'httparty'
require 'logger'

# Configure logging
logger = Logger.new(STDOUT)
logger.level = Logger::INFO

module SellerMagnetAPI
  class << self
    def fetch_get_amazon_product_offers(api_key, asin, marketplaceId, geo_location, max_retries: 3, timeout: 10)
      # Fetch data from Get Amazon Product Offers endpoint with retry logic and error handling.
      #
      # @param api_key [String] API key for authentication
      # 
      # @param asin [Text] Product ASIN (e.g., 'B08N5WRWNW')
      # 
      # @param marketplaceId [Text] Marketplace ID (e.g., 'A1PA6795UKMFR9')
      # 
      # @param geo_location [Text] Detailed Geo Location ZIP CODE
      # 
      # @param max_retries [Integer] Maximum number of retry attempts
      # @param timeout [Integer] Request timeout in seconds
      # @return [Hash] API response data
      # @raise [StandardError] If all retries fail
      url = "https://sellermagnet-api.com/amazon-product-offers"
      headers = {
        "Authorization" => "Bearer #{api_key}",
        "Content-Type" => "application/json"
      }
      params = {
        
        "asin" => asin,
        
        "marketplaceId" => marketplaceId,
        
        "geo_location" => geo_location,
        
      }

      max_retries.times do |attempt|
        begin
          logger.info("Attempt #{attempt + 1} to fetch Get Amazon Product Offers")
          response = HTTParty.get(url, headers: headers, query: params, timeout: timeout)
          return response.parsed_response if response.success?
        rescue StandardError => e
          logger.error("Attempt #{attempt + 1} failed: #{e.message}")
          raise("Failed to fetch Get Amazon Product Offers after #{max_retries} attempts: #{e.message}") if attempt + 1 == max_retries
          sleep(2 ** attempt) # Exponential backoff
        end
      end
    end
  end
end

# Example usage
begin
  result = SellerMagnetAPI.fetch_get_amazon_product_offers(
    "YOUR_API_KEY",
    
    "Product ASIN 'B08N5WRWNW'",
    
    "Marketplace ID 'A1PA6795UKMFR9'",
    
    "geo_location",
    
  )
  logger.info("Response: #{result}")
rescue StandardError => e
  logger.error("Error: #{e.message}")
end

const axios = require('axios');
const winston = require('winston');

// Configure logging
const logger = winston.createLogger({
    level: 'info',
    format: winston.format.combine(
        winston.format.timestamp(),
        winston.format.json()
    ),
    transports: [new winston.transports.Console()]
});

async function fetchGetAmazonProductOffers(apiKey, asin, marketplaceId, geo_location, retries = 3, timeout = 10000) {
    /**
     * Fetch data from Get Amazon Product Offers endpoint with retry logic and error handling.
     * 
     * @param {string} apiKey - API key for authentication
     
     * @param {string} asin - Product ASIN (e.g., 'B08N5WRWNW')
     
     * @param {string} marketplaceId - Marketplace ID (e.g., 'A1PA6795UKMFR9')
     
     * @param {string} geo_location - Detailed Geo Location ZIP CODE
     
     * @param {number} retries - Maximum number of retry attempts
     * @param {number} timeout - Request timeout in milliseconds
     * @returns {Promise} API response data
     * @throws {Error} If all retries fail
     */
    const url = `https://sellermagnet-api.com/amazon-product-offers`;
    const headers = {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json'
    };
    const params = {
        
        asin: asin,
        
        marketplaceId: marketplaceId,
        
        geo_location: geo_location,
        
    };

    for (let attempt = 0; attempt < retries; attempt++) {
        try {
            logger.info(`Attempt ${attempt + 1} to fetch Get Amazon Product Offers`);
            const response = await axios.get(url, { headers, params, timeout });
            return response.data;
        } catch (error) {
            logger.error(`Attempt ${attempt + 1} failed: ${error.message}`);
            if (attempt + 1 === retries) {
                throw new Error(`Failed to fetch Get Amazon Product Offers after ${retries} attempts: ${error.message}`);
            }
            await new Promise(resolve => setTimeout(resolve, 2 ** attempt * 1000)); // Exponential backoff
        }
    }
}

// Example usage
(async () => {
    try {
        const result = await fetchGetAmazonProductOffers(
            'YOUR_API_KEY',
            
            "Product ASIN 'B08N5WRWNW'",
            
            "Marketplace ID 'A1PA6795UKMFR9'",
            
            "geo_location",
            
        );
        logger.info('Response:', result);
    } catch (error) {
        logger.error(`Error: ${error.message}`);
    }
})();

                                                
                                            
                                        
                                    
                                        

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.HashMap;
import java.util.logging.Logger;
import java.util.stream.Collectors;

public class SellerMagnetAPIClient {
    private static final Logger LOGGER = Logger.getLogger(SellerMagnetAPIClient.class.getName());
    private final HttpClient client;

    public SellerMagnetAPIClient() {
        this.client = HttpClient.newBuilder().build();
    }

    /**
     * Fetch data from Get Amazon Product Offers endpoint with retry logic and error handling.
     *
     * @param apiKey API key for authentication
     * 
     * @param asin Product ASIN (e.g., 'B08N5WRWNW')
     * 
     * @param marketplaceId Marketplace ID (e.g., 'A1PA6795UKMFR9')
     * 
     * @param geo_location Detailed Geo Location ZIP CODE
     * 
     * @param maxRetries Maximum number of retry attempts
     * @param timeoutSeconds Request timeout in seconds
     * @return API response data as a String
     * @throws Exception If all retries fail
     */
    public String fetchGetAmazonProductOffers(String apiKey, String asin, String marketplaceId, String geo_location, int maxRetries, int timeoutSeconds) throws Exception {
        String url = "https://sellermagnet-api.com/amazon-product-offers";
        Map params = new HashMap<>();
        
        params.put("asin", asin);
        
        params.put("marketplaceId", marketplaceId);
        
        params.put("geo_location", geo_location);
        
        
        String query = params.entrySet().stream()
            .map(e -> URLEncoder.encode(e.getKey(), StandardCharsets.UTF_8) + "=" + URLEncoder.encode(e.getValue(), StandardCharsets.UTF_8))
            .collect(Collectors.joining("&"));
        
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(url + "?" + query))
            .header("Authorization", "Bearer " + apiKey)
            .header("Content-Type", "application/json")
            .timeout(java.time.Duration.ofSeconds(timeoutSeconds))
            .GET()
            .build();
        
        for (int attempt = 0; attempt < maxRetries; attempt++) {
            try {
                LOGGER.info("Attempt " + (attempt + 1) + " to fetch Get Amazon Product Offers");
                HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
                if (response.statusCode() >= 200 && response.statusCode() < 300) {
                    return response.body();
                }
            } catch (Exception e) {
                LOGGER.severe("Attempt " + (attempt + 1) + " failed: " + e.getMessage());
                if (attempt + 1 == maxRetries) {
                    throw new Exception("Failed to fetch Get Amazon Product Offers after " + maxRetries + " attempts: " + e.getMessage());
                }
                Thread.sleep((long) Math.pow(2, attempt) * 1000); // Exponential backoff
            }
        }
        throw new Exception("Failed to fetch Get Amazon Product Offers after " + maxRetries + " attempts");
    }

    // Example usage
    public static void main(String[] args) {
        SellerMagnetAPIClient apiClient = new SellerMagnetAPIClient();
        try {
            String response = apiClient.fetchGetAmazonProductOffers(
                "YOUR_API_KEY",
                
                "Product ASIN 'B08N5WRWNW'",
                
                "Marketplace ID 'A1PA6795UKMFR9'",
                
                "geo_location",
                
                3,
                10
            );
            LOGGER.info("Response: " + response);
        } catch (Exception e) {
            LOGGER.severe("Error: " + e.getMessage());
        }
    }
}

package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "net/url"
    "time"
    "log"
)

// FetchGetAmazonProductOffers fetches data from Get Amazon Product Offers endpoint with retry logic and error handling.
//
// Parameters:
//   - apiKey: API key for authentication
//   
//   - asin: Product ASIN (e.g., 'B08N5WRWNW')
//   
//   - marketplaceId: Marketplace ID (e.g., 'A1PA6795UKMFR9')
//   
//   - geo_location: Detailed Geo Location ZIP CODE
//   
//   - maxRetries: Maximum number of retry attempts
//   - timeout: Request timeout duration
//
// Returns:
//   - []byte: API response data
//   - error: Any error encountered
func FetchGetAmazonProductOffers(apiKey string, asin string, marketplaceId string, geo_location string, maxRetries int, timeout time.Duration) ([]byte, error) {
    client := &http.Client{Timeout: timeout}
    params := url.Values{}
    
    params.Add("asin", asin)
    
    params.Add("marketplaceId", marketplaceId)
    
    params.Add("geo_location", geo_location)
    
    
    url := "https://sellermagnet-api.com/amazon-product-offers?" + params.Encode()
    
    for attempt := 0; attempt < maxRetries; attempt++ {
        log.Printf("Attempt %d to fetch Get Amazon Product Offers", attempt+1)
        req, err := http.NewRequest("GET", url, nil)
        if err != nil {
            return nil, fmt.Errorf("failed to create request: %v", err)
        }
        req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
        req.Header.Set("Content-Type", "application/json")
        
        resp, err := client.Do(req)
        if err != nil {
            log.Printf("Attempt %d failed: %v", attempt+1, err)
            if attempt+1 == maxRetries {
                return nil, fmt.Errorf("failed after %d attempts: %v", maxRetries, err)
            }
            time.Sleep(time.Duration(1<= 200 && resp.StatusCode < 300 {
            body, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                return nil, fmt.Errorf("failed to read response: %v", err)
            }
            return body, nil
        }
    }
    return nil, fmt.Errorf("failed after %d attempts", maxRetries)
}

// Example usage
func main() {
    response, err := FetchGetAmazonProductOffers(
        "YOUR_API_KEY",
        
        "Product ASIN 'B08N5WRWNW'",
        
        "Marketplace ID 'A1PA6795UKMFR9'",
        
        "geo_location",
        
        3,
        10*time.Second,
    )
    if err != nil {
        log.Fatalf("Error: %v", err)
    }
    log.Printf("Response: %s", response)
}

#!/bin/bash

# Configure logging
LOG_FILE="/var/log/sellermagnet_api.log"
log() {
    echo "[$(date -Iseconds)] $1" >> "$LOG_FILE"
}

# API request function with retry logic
fetch_get_amazon_product_offers() {
    local API_KEY="$1"
    shift
    local URL="https://sellermagnet-api.com/amazon-product-offers"
    local PARAMS="asin=$1&shift;marketplaceId=$1&shift;geo_location=$1&"
    local MAX_RETRIES=3
    local TIMEOUT=10

    log "Starting fetch for Get Amazon Product Offers"
    
    for ((i=1; i<=MAX_RETRIES; i++)); do
        RESPONSE=$(curl -s -X GET "${URL}?${PARAMS}" \
            -H "Authorization: Bearer ${API_KEY}" \
            -H "Content-Type: application/json" \
            --max-time ${TIMEOUT})
        if [ $? -eq 0 ]; then
            log "Fetch successful on attempt $i"
            echo "${RESPONSE}"
            return 0
        else
            log "Attempt $i failed"
            sleep $((2 ** i))
        fi
    done
    log "Error: Max retries reached"
    echo "Error: Max retries reached"
    return 1
}

# Example usage
fetch_get_amazon_product_offers "YOUR_API_KEY" \
    
    "Product%20ASIN%20%27B08N5WRWNW%27" \
    
    "Marketplace%20ID%20%27A1PA6795UKMFR9%27" \
    
    "geo_location" \
    
Use Case

Retrieve a list of Amazon marketplaces to configure region-specific API requests or display marketplace options in your app.

Endpoint: /amazon-get-marketplaces

Method: GET

Parameters
Name Type Required Description
api_key text Yes Your API key
{
  "type": "object",
  "properties": {
    "success": { "type": "boolean" },
    "data": {
      "type": "object",
      "properties": {
        
        "api_key": { "type": "text" },
        
        "timestamp": { "type": "string", "format": "date-time" }
      },
      "required": ["api_key", "timestamp"]
    },
    "message": { "type": "string" }
  },
  "required": ["success", "data", "message"]
}
Response Example
{
  "marketplaces": [
    {
      "country": "Germany",
      "id": "A1PA6795UKMFR9",
      "name": "Amazon.de"
    }
  ]
}
Code Examples
Python
Ruby
Javascript
Java
Go
Curl

import requests
import time
import logging

# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)

def fetch_get_amazon_marketplaces(api_key, max_retries=3, timeout=10):
    """
    Fetch data from Get Amazon Marketplaces endpoint with retry logic and error handling.
    
    Args:
        api_key (str): API key for authentication
        
        max_retries (int): Maximum number of retry attempts
        timeout (int): Request timeout in seconds
    
    Returns:
        dict: API response data
    
    Raises:
        Exception: If all retries fail
    """
    url = "https://sellermagnet-api.com/amazon-get-marketplaces"
    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"
    }
    params = {
        
    }
    
    for attempt in range(max_retries):
        try:
            logger.info(f"Attempt {attempt + 1} to fetch Get Amazon Marketplaces")
            response = requests.get(url, headers=headers, params=params, timeout=timeout)
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            logger.error(f"Attempt {attempt + 1} failed: {e}")
            if attempt + 1 == max_retries:
                raise Exception(f"Failed to fetch Get Amazon Marketplaces after {max_retries} attempts: {e}")
            time.sleep(2 ** attempt)  # Exponential backoff
    
    return {}

# Example usage
if __name__ == "__main__":
    try:
        result = fetch_get_amazon_marketplaces(
            api_key="YOUR_API_KEY",
            
        )
        logger.info(f"Response: {result}")
    except Exception as e:
        logger.error(f"Error: {e}")

require 'httparty'
require 'logger'

# Configure logging
logger = Logger.new(STDOUT)
logger.level = Logger::INFO

module SellerMagnetAPI
  class << self
    def fetch_get_amazon_marketplaces(api_key, max_retries: 3, timeout: 10)
      # Fetch data from Get Amazon Marketplaces endpoint with retry logic and error handling.
      #
      # @param api_key [String] API key for authentication
      # 
      # @param max_retries [Integer] Maximum number of retry attempts
      # @param timeout [Integer] Request timeout in seconds
      # @return [Hash] API response data
      # @raise [StandardError] If all retries fail
      url = "https://sellermagnet-api.com/amazon-get-marketplaces"
      headers = {
        "Authorization" => "Bearer #{api_key}",
        "Content-Type" => "application/json"
      }
      params = {
        
      }

      max_retries.times do |attempt|
        begin
          logger.info("Attempt #{attempt + 1} to fetch Get Amazon Marketplaces")
          response = HTTParty.get(url, headers: headers, query: params, timeout: timeout)
          return response.parsed_response if response.success?
        rescue StandardError => e
          logger.error("Attempt #{attempt + 1} failed: #{e.message}")
          raise("Failed to fetch Get Amazon Marketplaces after #{max_retries} attempts: #{e.message}") if attempt + 1 == max_retries
          sleep(2 ** attempt) # Exponential backoff
        end
      end
    end
  end
end

# Example usage
begin
  result = SellerMagnetAPI.fetch_get_amazon_marketplaces(
    "YOUR_API_KEY",
    
  )
  logger.info("Response: #{result}")
rescue StandardError => e
  logger.error("Error: #{e.message}")
end

const axios = require('axios');
const winston = require('winston');

// Configure logging
const logger = winston.createLogger({
    level: 'info',
    format: winston.format.combine(
        winston.format.timestamp(),
        winston.format.json()
    ),
    transports: [new winston.transports.Console()]
});

async function fetchGetAmazonMarketplaces(apiKey, retries = 3, timeout = 10000) {
    /**
     * Fetch data from Get Amazon Marketplaces endpoint with retry logic and error handling.
     * 
     * @param {string} apiKey - API key for authentication
     
     * @param {number} retries - Maximum number of retry attempts
     * @param {number} timeout - Request timeout in milliseconds
     * @returns {Promise} API response data
     * @throws {Error} If all retries fail
     */
    const url = `https://sellermagnet-api.com/amazon-get-marketplaces`;
    const headers = {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json'
    };
    const params = {
        
    };

    for (let attempt = 0; attempt < retries; attempt++) {
        try {
            logger.info(`Attempt ${attempt + 1} to fetch Get Amazon Marketplaces`);
            const response = await axios.get(url, { headers, params, timeout });
            return response.data;
        } catch (error) {
            logger.error(`Attempt ${attempt + 1} failed: ${error.message}`);
            if (attempt + 1 === retries) {
                throw new Error(`Failed to fetch Get Amazon Marketplaces after ${retries} attempts: ${error.message}`);
            }
            await new Promise(resolve => setTimeout(resolve, 2 ** attempt * 1000)); // Exponential backoff
        }
    }
}

// Example usage
(async () => {
    try {
        const result = await fetchGetAmazonMarketplaces(
            'YOUR_API_KEY',
            
        );
        logger.info('Response:', result);
    } catch (error) {
        logger.error(`Error: ${error.message}`);
    }
})();

                                                
                                            
                                        
                                    
                                        

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.HashMap;
import java.util.logging.Logger;
import java.util.stream.Collectors;

public class SellerMagnetAPIClient {
    private static final Logger LOGGER = Logger.getLogger(SellerMagnetAPIClient.class.getName());
    private final HttpClient client;

    public SellerMagnetAPIClient() {
        this.client = HttpClient.newBuilder().build();
    }

    /**
     * Fetch data from Get Amazon Marketplaces endpoint with retry logic and error handling.
     *
     * @param apiKey API key for authentication
     * 
     * @param maxRetries Maximum number of retry attempts
     * @param timeoutSeconds Request timeout in seconds
     * @return API response data as a String
     * @throws Exception If all retries fail
     */
    public String fetchGetAmazonMarketplaces(String apiKey, int maxRetries, int timeoutSeconds) throws Exception {
        String url = "https://sellermagnet-api.com/amazon-get-marketplaces";
        Map params = new HashMap<>();
        
        
        String query = params.entrySet().stream()
            .map(e -> URLEncoder.encode(e.getKey(), StandardCharsets.UTF_8) + "=" + URLEncoder.encode(e.getValue(), StandardCharsets.UTF_8))
            .collect(Collectors.joining("&"));
        
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(url + "?" + query))
            .header("Authorization", "Bearer " + apiKey)
            .header("Content-Type", "application/json")
            .timeout(java.time.Duration.ofSeconds(timeoutSeconds))
            .GET()
            .build();
        
        for (int attempt = 0; attempt < maxRetries; attempt++) {
            try {
                LOGGER.info("Attempt " + (attempt + 1) + " to fetch Get Amazon Marketplaces");
                HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
                if (response.statusCode() >= 200 && response.statusCode() < 300) {
                    return response.body();
                }
            } catch (Exception e) {
                LOGGER.severe("Attempt " + (attempt + 1) + " failed: " + e.getMessage());
                if (attempt + 1 == maxRetries) {
                    throw new Exception("Failed to fetch Get Amazon Marketplaces after " + maxRetries + " attempts: " + e.getMessage());
                }
                Thread.sleep((long) Math.pow(2, attempt) * 1000); // Exponential backoff
            }
        }
        throw new Exception("Failed to fetch Get Amazon Marketplaces after " + maxRetries + " attempts");
    }

    // Example usage
    public static void main(String[] args) {
        SellerMagnetAPIClient apiClient = new SellerMagnetAPIClient();
        try {
            String response = apiClient.fetchGetAmazonMarketplaces(
                "YOUR_API_KEY",
                
                3,
                10
            );
            LOGGER.info("Response: " + response);
        } catch (Exception e) {
            LOGGER.severe("Error: " + e.getMessage());
        }
    }
}

package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "net/url"
    "time"
    "log"
)

// FetchGetAmazonMarketplaces fetches data from Get Amazon Marketplaces endpoint with retry logic and error handling.
//
// Parameters:
//   - apiKey: API key for authentication
//   
//   - maxRetries: Maximum number of retry attempts
//   - timeout: Request timeout duration
//
// Returns:
//   - []byte: API response data
//   - error: Any error encountered
func FetchGetAmazonMarketplaces(apiKey string, maxRetries int, timeout time.Duration) ([]byte, error) {
    client := &http.Client{Timeout: timeout}
    params := url.Values{}
    
    
    url := "https://sellermagnet-api.com/amazon-get-marketplaces?" + params.Encode()
    
    for attempt := 0; attempt < maxRetries; attempt++ {
        log.Printf("Attempt %d to fetch Get Amazon Marketplaces", attempt+1)
        req, err := http.NewRequest("GET", url, nil)
        if err != nil {
            return nil, fmt.Errorf("failed to create request: %v", err)
        }
        req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
        req.Header.Set("Content-Type", "application/json")
        
        resp, err := client.Do(req)
        if err != nil {
            log.Printf("Attempt %d failed: %v", attempt+1, err)
            if attempt+1 == maxRetries {
                return nil, fmt.Errorf("failed after %d attempts: %v", maxRetries, err)
            }
            time.Sleep(time.Duration(1<= 200 && resp.StatusCode < 300 {
            body, err := ioutil.ReadAll(resp.Body)
            if err != nil {
                return nil, fmt.Errorf("failed to read response: %v", err)
            }
            return body, nil
        }
    }
    return nil, fmt.Errorf("failed after %d attempts", maxRetries)
}

// Example usage
func main() {
    response, err := FetchGetAmazonMarketplaces(
        "YOUR_API_KEY",
        
        3,
        10*time.Second,
    )
    if err != nil {
        log.Fatalf("Error: %v", err)
    }
    log.Printf("Response: %s", response)
}

#!/bin/bash

# Configure logging
LOG_FILE="/var/log/sellermagnet_api.log"
log() {
    echo "[$(date -Iseconds)] $1" >> "$LOG_FILE"
}

# API request function with retry logic
fetch_get_amazon_marketplaces() {
    local API_KEY="$1"
    shift
    local URL="https://sellermagnet-api.com/amazon-get-marketplaces"
    local PARAMS=""
    local MAX_RETRIES=3
    local TIMEOUT=10

    log "Starting fetch for Get Amazon Marketplaces"
    
    for ((i=1; i<=MAX_RETRIES; i++)); do
        RESPONSE=$(curl -s -X GET "${URL}?${PARAMS}" \
            -H "Authorization: Bearer ${API_KEY}" \
            -H "Content-Type: application/json" \
            --max-time ${TIMEOUT})
        if [ $? -eq 0 ]; then
            log "Fetch successful on attempt $i"
            echo "${RESPONSE}"
            return 0
        else
            log "Attempt $i failed"
            sleep $((2 ** i))
        fi
    done
    log "Error: Max retries reached"
    echo "Error: Max retries reached"
    return 1
}

# Example usage
fetch_get_amazon_marketplaces "YOUR_API_KEY" \