亚马逊公司(Amazon,简称亚马逊;NASDAQ:AMZN),2022年营收为5140亿美元, 是美国最大的一家网络电子商务公司,位于华盛顿州的西雅图。是网络上最早开始经营电子商务的公司之一,亚马逊成立于1994年, 一开始只经营网络的书籍销售业务,现在则扩及了范围相当广的其他产品,已成为全球商品品种最多的网上零售商和全球第二大互联网企业,在公司名下,也包括了AlexaInternet、a9、lab126、和互联网电影数据库(Internet Movie Database,IMDB)等子公司。
通用参数说明
version:API版本
key:调用key,测试key:test_api_key
api_name:API类型[item_search,seller_info]
cache:[yes,no]默认yes,将调用缓存的数据,速度比较快
result_type:[json,xml,serialize,var_export]返回数据格式,默认为json
lang:[cn,en,ru] 翻译语言,默认cn简体中文
API:itemsearch 参数说明: q:搜索关键字,支持url cat:分类ID start_price:开始价格 end_price:结束价格 sort:排序[bid,_bid,_sale,_credit,_income,_prom,_comm] (bid:总价,sale:销量,credit信用/人气,income收入,月推广量,comm月支出佣金。加前缀为从大到小排序) page:
API:seller_info 参数说明: nick:店铺id【722324510天猫,2239713891淘宝】
接下来我会展示操作及说明
item_search-按关键字搜索商品 公共参数
名称 类型 必须 描述 key String 是 获取调用key(必须以GET方式拼接在URL中) secret String 是 调用密钥 api_name String 是 API接口名称(包括在请求地址中)[item_search,item_get,item_search_shop等] cache String 否 [yes,no]默认yes,将调用缓存的数据,速度比较快 result_type String 否 [json,jsonu,xml,serialize,var_export]返回数据格式,默认为json,jsonu输出的内容中文可以直接阅读 lang String 否 [cn,en,ru]翻译语言,默认cn简体中文 version String 否 API版本
请求参数
请求参数:q=鞋子&start_price=&end_price=&page=&cat=&discount_only=&sort=&page_size=&seller_info=&nick=&ppath=
参数说明:q:搜索关键字 cat:分类ID start_price:开始价格 end_price:结束价格 sort:排序 page:
响应参数
Version: Date:
名称 类型 必须 示例值 描述 items
item[] 0 按关键字搜索商品 num_iid
String 0 B014QN8RG0 商品ID title
String 0 Topsky 远行客 户外登山鞋 男鞋耐磨越野跑鞋低帮爬山轻便徒步鞋防滑户外鞋子 休闲透气运动鞋 21907A 商品标题 pic_url
String 0 images-cn.ssl-images-amazon.com/images/I/51… 商品图片 promotion_price
Float 0 269.00 优惠价 price
Float 0 269.00 价格 price_range
String 0 价格范围 sales
String 0 销量 sample_id
Bigint 0 商品风格标识ID seller_nick
String 0 约薇女装官方旗舰店 卖家昵称 post_fee
Float 0 物流费用 area
String 0 店铺所在地 请求示例
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.net.URL; import java.nio.charset.Charset; import org.json.JSONException; import org.json.JSONObject; import java.io.PrintWriter; import java.net.URLConnection;
public class Example { private static String readAll(Reader rd) throws IOException { StringBuilder sb = new StringBuilder(); int cp; while ((cp = rd.read()) != -1) { sb.append((char) cp); } return sb.toString(); } public static JSONObject postRequestFromUrl(String url, String body) throws IOException, JSONException { URL realUrl = new URL(url); URLConnection conn = realUrl.openConnection(); conn.setDoOutput(true); conn.setDoInput(true); PrintWriter out = new PrintWriter(conn.getOutputStream()); out.print(body); out.flush(); InputStream instream = conn.getInputStream(); try { BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8"))); String jsonText = readAll(rd); JSONObject json = new JSONObject(jsonText); return json; } finally { instream.close(); } } public static JSONObject getRequestFromUrl(String url) throws IOException, JSONException { URL realUrl = new URL(url); URLConnection conn = realUrl.openConnection(); InputStream instream = conn.getInputStream(); try { BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8"))); String jsonText = readAll(rd); JSONObject json = new JSONObject(jsonText); return json; } finally { instream.close(); } } public static void main(String[] args) throws IOException, JSONException { // 请求示例 url 默认请求参数已经URL编码处理 String url = "/?key=><您自己的apiKey>&secret=<您自己的apiSecret>&q=鞋子&start_price=&end_price=&page=&cat=&discount_only=&sort=&page_size=&seller_info=&nick=&ppath="; JSONObject json = getRequestFromUrl(url); System.out.println(json.toString()); }
} 响应示例
{ "items": { "url": "www.onebound.cn/s/ref=nb_sb…", "keyword": "鞋子", "page": 1, "real_total_results": "109553", "total_results": 4400, "item": [ { "title": "Clarks Originals Trigenic Flex 休闲鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 258, "num_iid": "B015DWSQ3W", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "ECCO 爱步 男士Terracruise Lt低帮登山鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 115, "num_iid": "B07DTMGDBJ", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks 男式 商务正装休闲皮鞋 Tilden Free 一脚蹬乐福鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 45, "num_iid": "B00TTJJTBY", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks Men's Nature II Derbys 男士皮鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 301, "num_iid": "B002SNAYA8", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks 女士Taylor Shine切尔西靴", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 477, "num_iid": "B01D1XDXDI", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "ECCO 爱步 男士Irving德比鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 45, "num_iid": "B06Y1MYKHF", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Aigle 艾高 Tenere Light 女士高帮徒步远足鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 23, "num_iid": "B00SVDG4IA", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "ECCO 爱步 Biom Fjuel男士跑鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 208, "num_iid": "B00VJ32RGC", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Vans 范斯 Ward 女士绒面革/帆布低帮运动鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 51, "num_iid": "B078PH6WC2", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "ECCO 爱步 男士Melbourne 粗皮鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 71, "num_iid": "B076ZXM14W", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks Hamble Oak 女士皮鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 345, "num_iid": "B0050N5DO0", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks Men's Derby 男士系带乐福鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 39, "num_iid": "B07F8Y4276", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Skechers Flex Advantage Sr 男士一脚蹬运动鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 3, "num_iid": "B07TVPNVHT", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks 女士Linvale Jerica闭趾高跟鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 18, "num_iid": "B07B8VX1VJ", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "ECCO 爱步 HELSINKI 男士 德比鞋 皮鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 33, "num_iid": "B001O9CNQK", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "ECCO 爱步 男士Exostridem训练鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 64, "num_iid": "B07MG97GZ6", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "ECCO 爱步 欧文Irving系列 男式一脚蹬式便鞋 乐福鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 15, "num_iid": "B075JR8C1K", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "ECCO 爱步 女士 Terracruise Lt 户外登山运动鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 29, "num_iid": "B07DTH3MVB", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Gabor 女式时尚包头高跟鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "B07Q32QW8B", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks 男子Tilden Plain 德比牛津平底鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 152, "num_iid": "B00TTJHAQK", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "ECCO 爱步 Soft 2 柔酷2号 女式胶底鞋 运动休闲鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 9, "num_iid": "B00V39NEXC", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Puma 彪马 Axis 中性成人运动鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 19, "num_iid": "B07F2Q6PXV", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks 女式 Orinoco Club 切尔西靴", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/91…", "price": "", "promotion_price": "", "price_range": null, "sales": 91, "num_iid": "B00475B8ZU", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Gabor 女士时尚高跟鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "B07NSHGXQP", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks Vennor Walk 男士皮鞋 德比鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/51…", "price": "", "promotion_price": "", "price_range": null, "sales": 11, "num_iid": "B075DLRK1B", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "4堂时尚搭配课:鞋子、包包、配饰、内衣", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/41…", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "B0757LR5BZ", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "PUMA 彪马 Tazon 6 Fracture FM 男士运动鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 24, "num_iid": "B01C3LK6DO", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "SAFERUNSAFERUN一次性鞋垫(女性用尺寸) 50双装 39(约24.5cm)根据鞋子的大小剪刀剪裁 吸收不适的汗水并保持鞋内干爽 纸鞋垫", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/51…", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "B07S1B8S7S", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks 男士 Becken Cap 德比鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/51…", "price": "", "promotion_price": "", "price_range": null, "sales": 43, "num_iid": "B07DPNB7GS", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "PUMA 彪马 中性款 Anzarun Lite Jr 运动鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "B07S8QCD6S", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "VANS 范斯 Filmore Decon 女式平底鞋 运动休闲鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 27, "num_iid": "B07FXQDNR8", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "2Toms 无臭鞋子和齿轮喷雾 - 消除汗液产生的异味(8 盎司瓶装)", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 283, "num_iid": "B003WPPC3K", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks 其乐 男士布洛克烤花 商务休闲皮鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 38, "num_iid": "B071WPJT5N", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Columbia 男士 Fairbanks 低帮运动鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 503, "num_iid": "B07RJTKTWY", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Ecco 爱步 Exostride Summer Trail 男士户外运动鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 17, "num_iid": "B07V9PR2RH", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Gabor 女士休闲浅口芭蕾舞鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "B07Q41LKVQ", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "HÖGL Ballerinas Boulevard 10 0-120014", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 4, "num_iid": "B00M65BY3E", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Kiwi Shoe Passion 女士凝胶鞋垫,隐形,防滑减震,1 双", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "B01HI8TG3S", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Gabor 女士舒适时尚包头高跟鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 6, "num_iid": "B07Q32W85Z", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "The Bridge Story Uomo 钱包 IV 皮革 10 厘米", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "B0093AZERC", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "ECCO 爱步 Men’s Exostrike Mid 户外男靴", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 56, "num_iid": "B07C6894LM", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Merrell 男士 Move Glove 交叉训练鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 44, "num_iid": "B07KM3DBW2", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Harmonia bloom 鞋系列 [工作靴/黑色]", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "B08WQ2891P", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Timberland 女士 Nellie 双重防水踝靴", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 316, "num_iid": "B005JQS5F2", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Skechers 斯凯奇 女式 Synergy 2.0 重金属运动鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "B07GFGBB4J", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Nike 耐克 Wearallday 男士跑步鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/61…", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "B0838KJV9T", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Clarks Un系列 Aldric Park 男式皮鞋 德比鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/81…", "price": "", "promotion_price": "", "price_range": null, "sales": 83, "num_iid": "B0756D885V", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "Skechers 斯凯奇 女士 Go Walk 5 -Limelight 一脚蹬运动鞋", "pic_url": "images-cn.ssl-images-amazon.cn/images/I/71…", "price": "", "promotion_price": "", "price_range": null, "sales": 1, "num_iid": "B07P29WJFW", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" }, { "title": "", "pic_url": "", "price": "", "promotion_price": "", "price_range": null, "sales": 0, "num_iid": "", "sample_id": "", "seller_nick": "", "post_fee": "", "area": "" } ], "related_keywords": "", "nav_catcamp": null, "nav_filter": null }, "error_code": "0000", "reason": "ok", "secache": "e299413c54b7d53e00a8046fc5bd7bdb", "secache_time": 1615425986, "secache_date": "2021-03-11 09:26:26", "translate_status": "", "translate_time": 0, "language": { "default_lang": "cn", "current_lang": "cn" }, "error": "", "cache": 0, "api_info": "today:0 max:10000", "execution_time": 5.169, "server_time": "Beijing/2021-03-11 09:26:26", "client_ip": "106.6.35.144", "call_args": { "q": "鞋子" }, "api_type": "amazon", "translate_language": "zh-CN", "translate_engine": "google_cn", "server_memory": "2.99MB", "request_id": "gw-3.604971be1ca59" } 文章内容有限,欢迎私信沟通交流!