### GET /v1/asin/{marketplace}/{asin} Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Retrieves detailed information for a specific Amazon product using its ASIN and marketplace identifier. ```APIDOC ## GET /v1/asin/{marketplace}/{asin} ### Description Retrieves detailed information for a specific Amazon product including price, sales, ranking, and ratings. ### Method GET ### Endpoint /v1/asin/{marketplace}/{asin} ### Parameters #### Path Parameters - **marketplace** (string) - Required - Market identifier - **asin** (string) - Required - Amazon ASIN code ### Response #### Success Response (200) - **code** (string) - Status code - **message** (string) - Response message - **data** (object) - Product details object #### Response Example { "code": "OK", "message": "成功", "data": { "asin": "B01BI90V8M", "title": "Product Title", "price": 29.99, "bsr": 1234, "rating": 4.5, "ratings": 1500 } } ``` -------------------------------- ### Perform Full Product Research Workflow in Java Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Demonstrates initializing the client and executing a sequence of API calls including category retrieval, product filtering, ASIN detail lookup, and competitor analysis. ```java import com.alibaba.fastjson.JSONObject; import com.iyunya.api.dto.*; import com.iyunya.api.request.ApiRequestClient; import com.iyunya.api.util.Result; import java.io.IOException; import java.util.Arrays; public class SellerSpriteDemo { public static void main(String[] args) throws IOException { // 1. 初始化客户端 String url = "https://api.sellersprite.com/"; String secretKey = "your-secret-key"; ApiRequestClient client = ApiRequestClient.build(url, secretKey); // 2. 获取类目节点 ProductNodeReqDto nodeReqDto = new ProductNodeReqDto(); nodeReqDto.setMarketplace("US"); Result nodeResult = client.execute(nodeReqDto); System.out.println("类目节点: " + JSONObject.toJSONString(nodeResult)); // 3. 产品调研 - 筛选电子产品类目下的热销产品 ProductChooseReqDto chooseReqDto = new ProductChooseReqDto(); chooseReqDto.setMarketplace("US"); chooseReqDto.setMonth("nearly"); chooseReqDto.setMinPrice(15.0f); chooseReqDto.setMaxPrice(100.0f); chooseReqDto.setMinRating(4.0f); chooseReqDto.setMinUnits(500); chooseReqDto.setBadgeBS("Y"); chooseReqDto.setPage(1); chooseReqDto.setSize(10); Result chooseResult = client.execute(chooseReqDto); System.out.println("产品调研结果: " + JSONObject.toJSONString(chooseResult)); // 4. 查询具体 ASIN 详情 AsinReqDto asinReqDto = new AsinReqDto(); asinReqDto.setMarketplace("US"); asinReqDto.setAsin("B01BI90V8M"); Result asinResult = client.execute(asinReqDto); System.out.println("ASIN 详情: " + JSONObject.toJSONString(asinResult)); // 5. 竞品分析 CompetitorProductReqDto competitorReqDto = new CompetitorProductReqDto(); competitorReqDto.setMarketplace("US"); competitorReqDto.setMonth("nearly"); competitorReqDto.setBrand("Anker"); Result competitorResult = client.execute(competitorReqDto); System.out.println("竞品分析: " + JSONObject.toJSONString(competitorResult)); } } ``` -------------------------------- ### Initialize API Client Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Instantiate the ApiRequestClient with your gateway URL and secret key. This client handles authentication and request routing for all API calls. ```java import com.iyunya.api.request.ApiRequestClient; import com.iyunya.api.util.Result; // 网关地址 String url = "https://api.sellersprite.com/"; // API 秘钥 String secretKey = "your-secret-key"; // 构建 API 客户端 ApiRequestClient client = ApiRequestClient.build(url, secretKey); // 客户端将自动添加以下请求头: // - context-type: application/json // - secret-key: your-secret-key ``` -------------------------------- ### Query ASIN Details Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Retrieve detailed information for a specific Amazon product using its ASIN and marketplace. Requires `AsinReqDto` and `ApiRequestClient`. ```java import com.iyunya.api.dto.AsinReqDto; import com.iyunya.api.request.ApiRequestClient; import com.iyunya.api.util.Result; import com.alibaba.fastjson.JSONObject; // 初始化客户端 ApiRequestClient client = ApiRequestClient.build("https://api.sellersprite.com/", "your-secret-key"); // 创建 ASIN 查询请求参数 AsinReqDto asinReqDto = new AsinReqDto(); asinReqDto.setMarketplace("US"); // 市场标识 asinReqDto.setAsin("B01BI90V8M"); // 亚马逊 ASIN 编码 // 执行请求 Result result = client.execute(asinReqDto); System.out.println(JSONObject.toJSONString(result)); // 响应示例: // { // "code": "OK", // "message": "成功", // "data": { // "asin": "B01BI90V8M", // "title": "Product Title", // "price": 29.99, // "bsr": 1234, // "rating": 4.5, // "ratings": 1500, // ... // } // } ``` -------------------------------- ### Perform Competitor Analysis Lookup in Java Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Queries competitor data based on brand, seller, or ASIN list. Requires at least one filtering condition to be set in the request object. ```java import com.iyunya.api.dto.CompetitorProductReqDto; import com.iyunya.api.request.ApiRequestClient; import com.iyunya.api.util.Result; import com.alibaba.fastjson.JSONObject; import java.util.Arrays; // 初始化客户端 ApiRequestClient client = ApiRequestClient.build("https://api.sellersprite.com/", "your-secret-key"); // 创建竞品查询请求参数 CompetitorProductReqDto competitorReqDto = new CompetitorProductReqDto(); // 必填参数 competitorReqDto.setMarketplace("US"); // 市场标识 competitorReqDto.setMonth("nearly"); // 查询日期: nearly(最近) // 可选筛选条件 - 至少选择一个 competitorReqDto.setBrand("Anker"); // 品牌名称 competitorReqDto.setSellerName("AnkerDirect"); // 卖家名称 competitorReqDto.setAsins(Arrays.asList( // ASIN 列表 "B01BI90V8M", "B07DBXZZN3", "B08L8LG4M3" )); // 可选筛选条件 competitorReqDto.setKeyword("charger"); // 关键字 competitorReqDto.setNodeIdPath("172282"); // 类目节点路径 competitorReqDto.setSymbol("N"); // 是否查询变体 ASIN: Y(否)/N(是) // 执行请求 Result result = client.execute(competitorReqDto); System.out.println(JSONObject.toJSONString(result)); // 响应示例: // { // "code": "OK", // "message": "成功", // "data": [ // { // "asin": "B01BI90V8M", // "brand": "Anker", // "seller": "AnkerDirect", // "units": 5000, // "revenue": 150000.00, // ... // }, // ... // ] // } ``` -------------------------------- ### Product Research with Filters Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Query Amazon product data using detailed filters for price, sales, BSR, ratings, keywords, and more. Specify marketplace, date range, and pagination. Requires `ProductChooseReqDto` and `ApiRequestClient`. ```java import com.iyunya.api.dto.ProductChooseReqDto; import com.iyunya.api.request.ApiRequestClient; import com.iyunya.api.util.Result; import com.alibaba.fastjson.JSONObject; // 初始化客户端 ApiRequestClient client = ApiRequestClient.build("https://api.sellersprite.com/", "your-secret-key"); // 创建产品调研请求参数 ProductChooseReqDto chooseReqDto = new ProductChooseReqDto(); // 必填参数 chooseReqDto.setMarketplace("US"); // 市场: US, UK, DE, JP, FR, IT, ES, CA, MX, IN, AU chooseReqDto.setMonth("nearly"); // 筛选日期: nearly(最近), 或具体月份 // 可选筛选条件 - 价格范围 chooseReqDto.setMinPrice(10.0f); // 最低价格 chooseReqDto.setMaxPrice(50.0f); // 最高价格 // 可选筛选条件 - 销售数据 chooseReqDto.setMinUnits(100); // 最低月销量 chooseReqDto.setMaxUnits(5000); // 最高月销量 chooseReqDto.setMinRevenue(1000.0f); // 最低月销售额 chooseReqDto.setMaxRevenue(50000.0f); // 最高月销售额 // 可选筛选条件 - BSR 排名 chooseReqDto.setMinBsr(1); // 大类 BSR 最低排名 chooseReqDto.setMaxBsr(10000); // 大类 BSR 最高排名 chooseReqDto.setMinBsrCr(-0.5f); // BSR 最低增长率 chooseReqDto.setMaxBsrCr(0.5f); // BSR 最高增长率 // 可选筛选条件 - 评分 chooseReqDto.setMinRating(4.0f); // 最低评分值 chooseReqDto.setMaxRating(5.0f); // 最高评分值 chooseReqDto.setMinRatings(10); // 最低评分数 chooseReqDto.setMaxRatings(1000); // 最高评分数 // 可选筛选条件 - 其他 chooseReqDto.setKeyword("bluetooth"); // 关键字搜索 chooseReqDto.setExcludeKeywords("refurbished"); // 排除关键字 chooseReqDto.setNodeIdPath("172282"); // 类目 ID 路径 chooseReqDto.setFulfillment("FBA"); // 配送方式: AMZ, FBA, FBM chooseReqDto.setBadgeBS("Y"); // Best Seller 标识: Y/N chooseReqDto.setBadgeAC("Y"); // Amazon's Choice 标识: Y/N chooseReqDto.setSellerNation("CN"); // 卖家所属地 chooseReqDto.setSymbol("N"); // 是否查询变体 ASIN: Y(否)/N(是) // 分页参数 chooseReqDto.setPage(1); // 页码 chooseReqDto.setSize(20); // 每页数量 // 执行请求 Result result = client.execute(chooseReqDto); System.out.println(JSONObject.toJSONString(result)); // 响应示例: // { // "code": "OK", // "message": "成功", // "data": [...] // } ``` -------------------------------- ### Query Product Category Nodes in Java Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Retrieves the Amazon product category tree structure. Use the nodeIdPath parameter to fetch sub-nodes within a specific category hierarchy. ```java import com.iyunya.api.dto.ProductNodeReqDto; import com.iyunya.api.request.ApiRequestClient; import com.iyunya.api.util.Result; import com.alibaba.fastjson.JSONObject; // 初始化客户端 ApiRequestClient client = ApiRequestClient.build("https://api.sellersprite.com/", "your-secret-key"); // 创建类目节点查询请求参数 ProductNodeReqDto nodeReqDto = new ProductNodeReqDto(); nodeReqDto.setMarketplace("US"); // 市场标识 // 可选: 指定节点路径获取子节点 // 节点 ID 路径格式: 父节点ID:子节点ID:孙节点ID nodeReqDto.setNodeIdPath("2335752011:240775501:2407776011"); // 执行请求 Result result = client.execute(nodeReqDto); System.out.println(JSONObject.toJSONString(result)); // 响应示例: // { // "code": "OK", // "message": "成功", // "data": [ // { // "nodeId": "172282", // "nodeName": "Electronics", // "children": [...] // }, // ... // ] // } ``` -------------------------------- ### Error Handling Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Information on how to handle API responses and potential errors. ```APIDOC ## Error Handling API responses are structured using a unified `Result` object. The `code` field indicates the request status, allowing for appropriate error handling. ### Response Structure ```java // Assuming 'result' is the Result object obtained from an API call String code = result.getCode(); String message = result.getMessage(); Object data = result.getData(); // Contains the actual data on success ``` ### Common Error Codes - **OK**: The request was successful. - **ERROR_PARAM**: Invalid parameters were provided. - **ERROR_SECRET_KEY**: The provided API secret key is incorrect. - **ERROR_SECRET_KEY_OVERDUE**: The API secret key has expired. - **ERROR_VISIT_MAX**: The API access limit has been reached. - **ERROR_SECRET_KEY_INVALID**: The API secret key is invalid. - **ERROR_SERVER_INTERNAL**: An internal server error occurred. ### Example Usage ```java Result result = client.execute(requestDto); switch (result.getCode()) { case "OK": // Handle successful response System.out.println("Request successful: " + result.getData()); break; case "ERROR_PARAM": System.err.println("Parameter error: " + result.getMessage()); break; case "ERROR_SECRET_KEY": System.err.println("Secret key error, please check your API key."); break; case "ERROR_SECRET_KEY_OVERDUE": System.err.println("Secret key has expired, please renew or replace it."); break; case "ERROR_VISIT_MAX": System.err.println("API access limit reached."); break; case "ERROR_SECRET_KEY_INVALID": System.err.println("Invalid secret key."); break; case "ERROR_SERVER_INTERNAL": System.err.println("Internal server error, please try again later."); break; default: System.err.println("Unknown error: " + result.getCode() + " - " + result.getMessage()); } ``` ``` -------------------------------- ### POST /v1/product/research Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Queries Amazon product data using multi-dimensional filters such as price, sales volume, BSR ranking, and ratings to identify potential products. ```APIDOC ## POST /v1/product/research ### Description Queries Amazon product data using multi-dimensional filters to discover potential products. ### Method POST ### Endpoint /v1/product/research ### Parameters #### Request Body - **marketplace** (string) - Required - Market identifier (US, UK, DE, JP, FR, IT, ES, CA, MX, IN, AU) - **month** (string) - Required - Filter date (nearly or specific month) - **minPrice** (float) - Optional - Minimum price - **maxPrice** (float) - Optional - Maximum price - **minUnits** (int) - Optional - Minimum monthly sales - **maxUnits** (int) - Optional - Maximum monthly sales - **minRevenue** (float) - Optional - Minimum monthly revenue - **maxRevenue** (float) - Optional - Maximum monthly revenue - **minBsr** (int) - Optional - Minimum BSR ranking - **maxBsr** (int) - Optional - Maximum BSR ranking - **minBsrCr** (float) - Optional - Minimum BSR growth rate - **maxBsrCr** (float) - Optional - Maximum BSR growth rate - **minRating** (float) - Optional - Minimum rating value - **maxRating** (float) - Optional - Maximum rating value - **minRatings** (int) - Optional - Minimum number of ratings - **maxRatings** (int) - Optional - Maximum number of ratings - **keyword** (string) - Optional - Keyword search - **excludeKeywords** (string) - Optional - Excluded keywords - **nodeIdPath** (string) - Optional - Category ID path - **fulfillment** (string) - Optional - Fulfillment method (AMZ, FBA, FBM) - **badgeBS** (string) - Optional - Best Seller badge (Y/N) - **badgeAC** (string) - Optional - Amazon's Choice badge (Y/N) - **sellerNation** (string) - Optional - Seller country - **symbol** (string) - Optional - Include variants (Y/N) - **page** (int) - Optional - Page number - **size** (int) - Optional - Items per page ### Request Example { "marketplace": "US", "month": "nearly", "minPrice": 10.0, "maxPrice": 50.0 } ### Response #### Success Response (200) - **code** (string) - Status code - **message** (string) - Response message - **data** (array) - List of product data #### Response Example { "code": "OK", "message": "成功", "data": [] } ``` -------------------------------- ### Competitor Analysis Query API Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Query competitor data based on brand, seller name, ASIN list, and other conditions for competitor analysis and market competition research. ```APIDOC ## POST /v1/product/competitor-lookup ### Description Query competitor data based on brand, seller name, ASIN list, and other conditions for competitor analysis and market competition research. ### Method POST ### Endpoint /v1/product/competitor-lookup ### Query Parameters - **marketplace** (string) - Required - The marketplace identifier (e.g., "US"). - **month** (string) - Required - The query date. Use "nearly" for the most recent data. ### Request Body - **brand** (string) - Optional - The brand name to filter by. - **sellerName** (string) - Optional - The seller name to filter by. - **asins** (array of strings) - Optional - A list of ASINs to query. - **keyword** (string) - Optional - A keyword to filter by. - **nodeIdPath** (string) - Optional - The category node path to filter by. - **symbol** (string) - Optional - Indicates whether to query variant ASINs. Use 'Y' for No, 'N' for Yes. ### Request Example ```java // Initialize client ApiRequestClient client = ApiRequestClient.build("https://api.sellersprite.com/", "your-secret-key"); // Create request parameters CompetitorProductReqDto competitorReqDto = new CompetitorProductReqDto(); competitorReqDto.setMarketplace("US"); // Required competitorReqDto.setMonth("nearly"); // Required // Optional filters - at least one should be provided if not using ASINs // competitorReqDto.setBrand("Anker"); // competitorReqDto.setSellerName("AnkerDirect"); // competitorReqDto.setAsins(Arrays.asList("B01BI90V8M", "B07DBXZZN3", "B08L8LG4M3")); // Other optional filters // competitorReqDto.setKeyword("charger"); // competitorReqDto.setNodeIdPath("172282"); // competitorReqDto.setSymbol("N"); // Execute request Result result = client.execute(competitorReqDto); System.out.println(JSONObject.toJSONString(result)); ``` ### Response #### Success Response (200) - **asin** (string) - The ASIN of the competitor product. - **brand** (string) - The brand of the competitor product. - **seller** (string) - The seller of the competitor product. - **units** (integer) - The number of units sold. - **revenue** (float) - The revenue generated. #### Response Example ```json { "code": "OK", "message": "成功", "data": [ { "asin": "B01BI90V8M", "brand": "Anker", "seller": "AnkerDirect", "units": 5000, "revenue": 150000.00 } ] } ``` ``` -------------------------------- ### Product Category Node Query API Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Query the Amazon product category node tree structure to obtain category hierarchy information and category IDs, supporting filtering by category during product selection. ```APIDOC ## GET /v1/product/node ### Description Query the Amazon product category node tree structure to obtain category hierarchy information and category IDs, supporting filtering by category during product selection. ### Method GET ### Endpoint /v1/product/node ### Query Parameters - **marketplace** (string) - Required - The marketplace identifier (e.g., "US"). - **nodeIdPath** (string) - Optional - Specifies a node path to retrieve child nodes. Format: `parent_node_id:child_node_id:grandchild_node_id`. ### Request Example ```java // Initialize client ApiRequestClient client = ApiRequestClient.build("https://api.sellersprite.com/", "your-secret-key"); // Create request parameters ProductNodeReqDto nodeReqDto = new ProductNodeReqDto(); nodeReqDto.setMarketplace("US"); // Required // Optional: nodeReqDto.setNodeIdPath("2335752011:240775501:2407776011"); // Execute request Result result = client.execute(nodeReqDto); System.out.println(JSONObject.toJSONString(result)); ``` ### Response #### Success Response (200) - **nodeId** (string) - The ID of the category node. - **nodeName** (string) - The name of the category node. - **children** (array) - An array of child nodes, if any. #### Response Example ```json { "code": "OK", "message": "成功", "data": [ { "nodeId": "172282", "nodeName": "Electronics", "children": [...] } ] } ``` ``` -------------------------------- ### Handle API Error Responses in Java Source: https://context7.com/cdyunya/sellersprite-api-demo/llms.txt Uses the Result object's code field to determine request success or specific error states. Implement a switch-case block to handle various API error codes. ```java import com.iyunya.api.util.Result; import com.iyunya.api.util.ResultEnum; // 执行 API 请求 Result result = client.execute(requestDto); // 检查响应状态 String code = result.getCode(); String message = result.getMessage(); switch (code) { case "OK": // 成功处理 Object data = result.getData(); System.out.println("请求成功: " + data); break; case "ERROR_PARAM": // 参数错误 System.err.println("参数错误: " + message); break; case "ERROR_SECRET_KEY": // 秘钥错误 System.err.println("秘钥错误,请检查 API 秘钥"); break; case "ERROR_SECRET_KEY_OVERDUE": // 秘钥过期 System.err.println("秘钥已过期,请续费或更换秘钥"); break; case "ERROR_VISIT_MAX": // 访问次数超限 System.err.println("接口访问次数已达上限"); break; case "ERROR_SECRET_KEY_INVALID": // 秘钥无效 System.err.println("秘钥无效"); break; case "ERROR_SERVER_INTERNAL": // 服务器内部错误 System.err.println("服务器内部错误,请稍后重试"); break; default: System.err.println("未知错误: " + code + " - " + message); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.