淘宝API技术解析,实现关键词搜索淘宝商品(商品详情接口等)

news/2024/11/29 15:04:07/

 淘宝提供了开放平台接口(API)来实现按图搜索淘宝商品的功能。您可以通过以下步骤来实现:

  1. 获取开放平台的访问权限:首先,您需要在淘宝开放平台创建一个应用,获取访问淘宝API的权限。具体的申请步骤和要求可以参考淘宝开放平台的文档。

  2. 上传图片并获取图片URL:将用户上传的图片通过接口上传到淘宝服务器,并获取图片的URL。淘宝提供了相应的API接口来实现这一步骤。

  3. 调用按图搜索API:使用淘宝提供的按图搜索API,将第二步中获取到的图片URL作为参数发送请求。按图搜索API会返回与该图片相似的商品列表。

  4. 解析并展示搜索结果:根据按图搜索API返回的结果,您可以解析其中的商品信息(如商品名称、价格、销量等),并将其展示给用户。

taobao.item_get

公共参数

名称类型必须描述
keyString调用key(必须以GET方式拼接在URL中)API接口
secretString调用密钥
api_nameStringAPI接口名称(包括在请求地址中)[item_search,item_get,item_search_shop等]
cacheString[yes,no]默认yes,将调用缓存的数据,速度比较快
result_typeString[json,jsonu,xml,serialize,var_export]返回数据格式,默认为json,jsonu输出的内容中文可以直接阅读
langString[cn,en,ru]翻译语言,默认cn简体中文
versionStringAPI版本

请求参数

请求参数:num_iid=652874751412&is_promotion=1

参数说明:num_iid:淘宝商品ID
is_promotion:是否获取取促销价

响应示例

{"item": {"num_iid": "520813250866","title": "三刃木折叠刀过安检创意迷你钥匙扣钥匙刀军刀随身多功能小刀包邮","desc_short": "","price": 25.8,"total_price": 0,"suggestive_price": 0,"orginal_price": "25.80","nick": "欢乐购客栈","num": "832","min_num": 0,"detail_url": "http://item.taobao.com/item.htm?id=520813250866","pic_url": "//img.alicdn.com/imgextra/i4/2596264565/TB2p30elFXXXXXQXpXXXXXXXXXX_!!2596264565.jpg","brand": "三刃木","brandId": "4036703","rootCatId": "50013886","cid": "50014822","favcount": "4824","fanscount": "1469","crumbs": [],"created_time": "","modified_time": "","delist_time": "","desc": "<p style=\"text-align:center;\"><span style=\"color:#ff0000;\"><span style=\"font-size:24.0px;\"><strong>小店所有产品都支持刻字,如需刻字,拍之前联系客服即可。</strong></span></span></p> <p style=\"text-align:center;\"><span style=\"font-size:18.0px;\"><strong>炎炎夏日来临,一把随身携带便携式的折叠小刀,<span style=\"color:#ff0000;\">带开瓶器功能</span>,喝酒不用愁。(钥匙刀不带开瓶器功能)</strong></span></p> <p style=\"text-align:center;\"><strong style=\"color:#000000;line-height:1.5;\"><span style=\"font-size:18.0px;\"><span style=\"line-height:18.0px;\">可以当吊牌项链装饰,也可当钥匙扣挂饰, 水果刀 开瓶器 户外防身.</span></span></strong></p> <p style=\"text-align:center;\"><strong style=\"line-height:1.5;\"><span style=\"font-size:24.0px;\">部分客户跟我们反映链子质量还不够好,因此小店已重新订购一批质量更好的链子赠送,<span style=\"color:#ff0000;\">加量不加价</span>,只为让你买的更舒心,戴的更放心。</span></strong></p> <p style=\"text-align:center;\"><span style=\"font-size:36.0px;\"><strong>购买就送<span style=\"color:#ff0000;\">工具刀卡和链子</span>一条</strong></span></p> <p style=\"text-align:center;\"><span style=\"font-size:36.0px;\"><strong><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB2Sci2jXXXXXXFXpXXXXXXXXXX_!!2596264565.png\" size=\"611x442\"> </strong></span></p> <p style=\"text-align:center;\"><span style=\"font-size:18.0px;\"><strong>璀璨钻石套餐包含【SK016D钥匙扣+GJ019C折叠刀+GJ017D工具卡】</strong></span><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB2wWohmXXXXXX8XXXXXXXXXXXX_!!2596264565.jpg\" size=\"750x600\" /></p> <p style=\"text-align:center;\"><span style=\"font-size:18.0px;\"><strong>超凡大师套餐包括【304不锈钢钥匙扣+GJ019C折叠刀+GJ017D工具卡】</strong></span><a href=\"//item.taobao.com/item.htm?id=520798805877\" target=\"_blank\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i4/2596264565/TB2_uiXnFXXXXXBXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"float:none;margin:0.0px;\" /></a></p> <p style=\"text-align:center;\">&nbsp;</p> <p style=\"text-align:center;\"><span style=\"font-size:18.0px;\"><strong>最强王者套餐包括【钛钢钥匙扣+GJ019C折叠刀+GJ017D工具卡】<a href=\"//item.taobao.com/item.htm?id=520801586805\" target=\"_blank\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i4/2596264565/TB2Gm9xnFXXXXbmXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"float:none;margin:0.0px;\" /></a> </strong></span></p> <p style=\"text-align:center;\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB28Ox4b77OyuJjSsplXXXqdpXa_!!2596264565.jpg\" size=\"749x553\"> <img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i1/2596264565/TB2.mTddVXXXXbeXpXXXXXXXXXX_!!2596264565.jpg\" style=\"line-height:1.5;\" size=\"750x653\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB21Ro.jl0lpuFjSszdXXcdxFXa_!!2596264565.jpg\" size=\"750x653\"> <img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i4/2596264565/TB2q9CelVXXXXcUXXXXXXXXXXXX_!!2596264565.jpg\" size=\"750x340\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB21EX9lVXXXXaXXpXXXXXXXXXX_!!2596264565.jpg\" size=\"750x416\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB2udCylVXXXXXgXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i1/2596264565/TB2EARxjB8lpuFjSspaXXXJKpXa_!!2596264565.jpg\" size=\"750x515\"> <img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB2ssuwlVXXXXafXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i2/2596264565/TB2nAHqgyC9MuFjSZFoXXbUzFXa_!!2596264565.jpg\" size=\"750x606\"> <img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB2ahCelVXXXXc_XXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB2w1JnjwRkpuFjy1zeXXc.6FXa_!!2596264565.jpg\" size=\"750x469\"> <img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB2C902lVXXXXbnXpXXXXXXXXXX_!!2596264565.jpg_q90.jpg\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i1/2596264565/TB2sGR3lVXXXXblXpXXXXXXXXXX_!!2596264565.jpg_q90.jpg\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i1/2596264565/TB2ZBGxlVXXXXXMXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i1/2596264565/TB2MjWklVXXXXcaXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i2/2596264565/TB2UgV3lVXXXXbdXpXXXXXXXXXX_!!2596264565.jpg_q90.jpg\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i2/2596264565/TB2ip5XlVXXXXX2XpXXXXXXXXXX_!!2596264565.jpg_q90.jpg\"> <img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i2/2596264565/TB2sMTBdVXXXXXlXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"line-height:1.5;\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB2d3HfdVXXXXahXpXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"line-height:1.5;\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i4/2596264565/TB2AVbBdVXXXXXkXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"line-height:1.5;\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i2/2596264565/TB2nf_wdVXXXXaMXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"line-height:1.5;\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i4/2596264565/TB2dLYddVXXXXbtXpXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"line-height:1.5;\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i2/2596264565/TB2H1_adVXXXXbWXpXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"line-height:1.5;\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i2/2596264565/TB2eBzsdVXXXXbuXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"line-height:1.5;\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i4/2596264565/TB2dOTndVXXXXcCXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"line-height:1.5;\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i2/2596264565/TB2fK2tdVXXXXbkXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"line-height:1.5;\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i2/2596264565/TB29zjedVXXXXaFXpXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"line-height:1.5;\"><img align=\"absmiddle\" src=\"//img.alicdn.com/imgextra/i3/2596264565/TB2i7rmdVXXXXcTXXXXXXXXXXXX_!!2596264565.jpg_q90.jpg\" style=\"line-height:1.5;\" /></p>","item_imgs": [{"url": "//img.alicdn.com/imgextra/i4/2596264565/TB2p30elFXXXXXQXpXXXXXXXXXX_!!2596264565.jpg"},{"url": "//img.alicdn.com/imgextra/i2/2596264565/TB2onxRlVXXXXcDXpXXXXXXXXXX_!!2596264565.jpg"},{"url": "//img.alicdn.com/imgextra/i1/2596264565/TB2a.x.lVXXXXXPXpXXXXXXXXXX_!!2596264565.jpg"},{"url": "//img.alicdn.com/imgextra/i2/2596264565/TB2iWE6bKZkyKJjSszbXXblwFXa_!!2596264565.jpg"},{"url": "//img.alicdn.com/imgextra/i4/2596264565/TB2j2cTXib_F1JjSZFzXXc6KXXa_!!2596264565.jpg"}],"item_weight": "0","item_size": "","location": "广东深圳","post_fee": "","express_fee": "0.00","ems_fee": "","shipping_to": "广东广州白云区","has_discount": "false","video": [],"is_virtual": "","sample_id": "","is_promotion": "false","props_name": "1627207:1347647754:颜色分类:长方形带开瓶器+送工具刀卡+链子;1627207:1347647753:颜色分类:椭圆形带开瓶器+送工具刀卡+链子;1627207:1195392087:颜色分类:GJ018X钥匙刀+送工具刀卡+链子;1627207:1331112595:颜色分类:超凡大师套餐【送工具卡+链子】;1627207:1331112594:颜色分类:最强王者套餐【送工具卡+链子】;1627207:1331264247:颜色分类:璀璨钻石套餐【送工具卡+链子】","prop_imgs": {"prop_img": [{"properties": "1627207:1347647754","url": "//img.alicdn.com/imgextra/i3/2596264565/TB2.XeblVXXXXXkXpXXXXXXXXXX_!!2596264565.jpg"},{"properties": "1627207:1347647753","url": "//img.alicdn.com/imgextra/i4/2596264565/TB2dTrjdVXXXXXBXpXXXXXXXXXX_!!2596264565.jpg"},{"properties": "1627207:1195392087","url": "//img.alicdn.com/imgextra/i2/2596264565/TB2j22kdVXXXXXdXpXXXXXXXXXX_!!2596264565.jpg"},{"properties": "1627207:1331112595","url": "//img.alicdn.com/imgextra/i4/2596264565/TB2_uiXnFXXXXXBXXXXXXXXXXXX_!!2596264565.jpg"},{"properties": "1627207:1331112594","url": "//img.alicdn.com/imgextra/i4/2596264565/TB2Gm9xnFXXXXbmXXXXXXXXXXXX_!!2596264565.jpg"},{"properties": "1627207:1331264247","url": "//img.alicdn.com/imgextra/i3/2596264565/TB2wWohmXXXXXX8XXXXXXXXXXXX_!!2596264565.jpg"}]},"property_alias": "1627207:1347647754:长方形带开瓶器+送工具刀卡+链子;1627207:1347647753:椭圆形带开瓶器+送工具刀卡+链子;1627207:1195392087:GJ018X钥匙刀+送工具刀卡+链子;1627207:1331112595:超凡大师套餐【送工具卡+链子】;1627207:1331112594:最强王者套餐【送工具卡+链子】;1627207:1331264247:璀璨钻石套餐【送工具卡+链子】","props": [{"name": "品牌","value": "三刃木"},{"name": "产地","value": "中国"},{"name": "颜色分类","value": "长方形带开瓶器+送工具刀卡+链子,椭圆形带开瓶器+送工具刀卡+链子,GJ018X钥匙刀+送工具刀卡+链子,超凡大师套餐【送工具卡+链子】,最强王者套餐【送工具卡+链子】,璀璨钻石套餐【送工具卡+链子】"},{"name": "吊牌价","value": "46"},{"name": "功能数量","value": "5个及以下"},{"name": "货号","value": "GJ019C"},{"name": "附加功能","value": "开瓶器,刀,螺丝刀,钥匙圈,其他"}],"total_sold": "1","skus": {"sku": [{"price": "39","orginal_price": "39.00","properties": "1627207:1347647754","properties_name": "1627207:1347647754:颜色分类:长方形带开瓶器+送工具刀卡+链子","quantity": "104","sku_id": "3166598625985"},{"price": "39","orginal_price": "39.00","properties": "1627207:1347647753","properties_name": "1627207:1347647753:颜色分类:椭圆形带开瓶器+送工具刀卡+链子","quantity": "370","sku_id": "3166598625984"},{"price": "25.8","orginal_price": "25.80","properties": "1627207:1195392087","properties_name": "1627207:1195392087:颜色分类:GJ018X钥匙刀+送工具刀卡+链子","quantity": "34","sku_id": "3144644292458"},{"price": "73.8","orginal_price": "73.80","properties": "1627207:1331112595","properties_name": "1627207:1331112595:颜色分类:超凡大师套餐【送工具卡+链子】","quantity": "157","sku_id": "3161300228970"},{"price": "91.8","orginal_price": "91.80","properties": "1627207:1331112594","properties_name": "1627207:1331112594:颜色分类:最强王者套餐【送工具卡+链子】","quantity": "0","sku_id": "3161300228969"},{"price": "63.8","orginal_price": "63.80","properties": "1627207:1331264247","properties_name": "1627207:1331264247:颜色分类:璀璨钻石套餐【送工具卡+链子】","quantity": "167","sku_id": "3161107666655"}]},"seller_id": "2596264565","sales": "1","shop_id": "127203758","props_list": {"1627207:1347647754": "颜色分类:长方形带开瓶器+送工具刀卡+链子","1627207:1347647753": "颜色分类:椭圆形带开瓶器+送工具刀卡+链子","1627207:1195392087": "颜色分类:GJ018X钥匙刀+送工具刀卡+链子","1627207:1331112595": "颜色分类:超凡大师套餐【送工具卡+链子】","1627207:1331112594": "颜色分类:最强王者套餐【送工具卡+链子】","1627207:1331264247": "颜色分类:璀璨钻石套餐【送工具卡+链子】"},"seller_info": {"title": "欢乐购客栈","shop_name": "欢乐购客栈","sid": "127203758","zhuy": "//shop127203758.taobao.com","level": "12","shop_type": "C","user_num_id": "2596264565","nick": "欢乐购客栈","cid": null,"delivery_score": "4.8 ","item_score": "4.8 ","score_p": "4.8 "},"tmall": "false","error": "","warning": "","url_log": [],"stuff_status": "","shopinfo": {"shop_name": "欢乐购客栈","shop_id": "127203758"},"data_from": "mtop","method": "item_mtop:item_get","promo_type": null,"props_img": {"1627207:1347647754": "//img.alicdn.com/imgextra/i3/2596264565/TB2.XeblVXXXXXkXpXXXXXXXXXX_!!2596264565.jpg","1627207:1347647753": "//img.alicdn.com/imgextra/i4/2596264565/TB2dTrjdVXXXXXBXpXXXXXXXXXX_!!2596264565.jpg","1627207:1195392087": "//img.alicdn.com/imgextra/i2/2596264565/TB2j22kdVXXXXXdXpXXXXXXXXXX_!!2596264565.jpg","1627207:1331112595": "//img.alicdn.com/imgextra/i4/2596264565/TB2_uiXnFXXXXXBXXXXXXXXXXXX_!!2596264565.jpg","1627207:1331112594": "//img.alicdn.com/imgextra/i4/2596264565/TB2Gm9xnFXXXXbmXXXXXXXXXXXX_!!2596264565.jpg","1627207:1331264247": "//img.alicdn.com/imgextra/i3/2596264565/TB2wWohmXXXXXX8XXXXXXXXXXXX_!!2596264565.jpg"},"rate_grade": "","shop_item": [],"relate_items": []},


http://www.ppmy.cn/news/1062087.html

相关文章

Unity中的数学基础——贝塞尔曲线

一&#xff1a;前言 一条贝塞尔曲线是由一组定义的控制点P0到 Pn&#xff0c;n1为线性&#xff0c;n2为二次......第一个和最后一个控制点称为起点和终点&#xff0c;中间的控制点一般不会位于曲线上 获取两个点之间的点就是通过线性插值&#xff08; Mathf.Lerp&#xff09…

【广州华锐视点】VR教学课件编辑工具有哪些用处?

随着科技的不断发展&#xff0c;教育领域也在不断地进行创新。在众多的创新技术中&#xff0c;虚拟现实(VR)技术的应用为教育带来了前所未有的变革。广州华锐视点开发的VR教学课件编辑工具作为一种新型的教育工具&#xff0c;可以为我们的教学提供许多支持&#xff0c;从而提升…

IDEA 配置注释模板

目录 一、配置类模板注释 二、配置方法注释 一、配置类模板注释 打开IDEA&#xff0c;打开settings(快捷键&#xff1a;Ctrl Alt s)&#xff0c;选择Editor&#xff0c;找到File and Code Templates&#xff0c;设置需要配置注释的文件类型&#xff0c;如下图所示&#xf…

最新本地大模型进展#Chinese-LLaMA-2支持16k长上下文

‍‍ Hi&#xff0c;今天为大家介绍最新的本地中文语言模型进展。 [2023/08/25] Chinese-LLaMA-2发布了新的更新&#xff1a; 长上下文模型Chinese-LLaMA-2-7B-16K和Chinese-LLaMA-2-13B-16K&#xff0c;支持16K上下文&#xff0c;并可通过NTK方法进一步扩展至24K。 这意味着在…

K8s学习笔记1

一、课程介绍&#xff1a; 1、背景&#xff1a; 1&#xff09;从基础设备主机化向容器化转换。 2&#xff09;从人肉式运维工作模式向自动化运维模式转换。 3&#xff09;从自动化运维体系向全体系智能化运维模式转换。 2、课程目标人群: 1&#xff09;掌握Linux操作系统基…

wordpress搭建博客教程总结_01主题配置

目前搭建效果站 薪火相传 (yuetan.wang) 日间 月间 爱心 页面、 爱心冲击波! (yuetan.wang) 好看的主题分享 个人博客主题分享(WordPress) – Echo小窝 博客主要效果 1. Argon

RabbitMQ手动签收消息

RabbitMQ手动签收消息 这里讲解SpringBoot使用RabbitMQ进行有回调的用法和消费者端手动签收消息的用法。 1、pom依赖 <?xml version"1.0" encoding"UTF-8"?> <project xmlns"http://maven.apache.org/POM/4.0.0" xmlns:xsi"h…

板卡设计+硬件每日学习十个知识点(44)23.8.24 (检测单元设计,接口部分设计,板卡电源输入设计,电源检测电路)

文章目录 1.检测单元介绍&#xff08;使用GD32单片机&#xff09;2.GD32的最小系统板3.GD32的温度监测4.GD32的电压监测和电流监测5.GD32的布线6.接口部分设计7.板卡电源输入设计8.电源检测电路 1.检测单元介绍&#xff08;使用GD32单片机&#xff09; 答&#xff1a; 首先要为…