当前位置: 首页 > news >正文

虾皮shopee根据ID取商品详情 API 返回值说明

1、公共参数

请求地址: https://api-gw.onebound.cn/shopee/item_get

名称类型必须描述
keyString调用key(必须以GET方式拼接在URL中)
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版本

2、请求参数

请求参数:num_iid=264070136/5637247041&country=.com.my

参数说明:num_iid:商品ID-country:网站后缀(.com.my;.vn;.ph)

3、响应参数

Version: Date:

名称类型必须示例值描述

num_iid

Bigint05637247041宝贝ID

title

String0Fashionable plus size womens dress 2020 new spring and summer dress was thin and thin and fat sister dress two-piece suit宝贝标题

price

Float022.17价格

orginal_price

String031.68原价

num

Int03836库存

detail_url

String0https://shopee.com.my/product/264070136/5637247041宝贝链接

pic_url

String0https://cf.shopee.com.my/file/f8bc1116ea922e5ed87a492390b1cc1a宝贝图片

brand

String0No Brand品牌名称

favcount

Int02027

desc

String0

skus

Mix0{"sku": [{"price": "39", "total_price": null, "orginal_price": "39.00", "properties": "0:0", "properties_name": "0:0:T-shirt+skirt:M 建议【42.5-50KG】", "quantity": "305", "sku_id": "3166598625985"}]商品规格信息列表

has_discount

String0true

item_size

String0

cid

Int016

currency

String0MYR

size_chart

String0https://cf.shopee.com.my/file/6105b7c64414c2012908bff679b9321d

sales

Int0138销量

item_imgs

Mix0[{ "url": "https://cf.shopee.com.my/file/f8bc1116ea922e5ed87a492390b1cc1a"}商品图片

discount

String030%

location

String0Mainland China发货地

shop_id

Int0151372205店铺ID

seller_info

Mix0{"nick": "qzq1274334183.my", "city": "Mainland China", "level": 12, "seller_promotion_refresh_time": "2021-01-19 02:00:00", "zhuy": "https://shopee.com.my/shop/264070136/search", "shop_type": "A"}卖家信息

prop_imgs

Mix0[]属性图片

props_list

Mix0{20509:9974422: 尺码:36}商品属性

props_name

String00:0:T-shirt+skirt:M 建议【42.5-50KG】;0:1:T-shirt+skirt:L 建议 【50-57.5kg】;商品属性名

props

Mix0[{ "name": "产地","value": "中国" }]商品详情

current_lang

String0en

currency_code

String0MYR

props_img

Mix01627207:28326": "//img.alicdn.com/imgextra/i2/2844096782/O1CN01VrjpXt1zyCc9DvERE_!!2844096782.jpg属性图片

shop_item

Mix0[]

relate_items

Mix0[]

tmall

Boolean0false是否天猫

error

String0错误信息

warning

String0price_json error;skus miss;警告信息

url_log

Mix0[]

method

String0item_tmall:pget_item

promo_type

String0

4、请求示例

  • Curl
  • PHP
  • PHPsdk
  • JAVA
  • C#
  • Python
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 = "https://api-gw.onebound.cn/shopee/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=264070136/5637247041&country=.com.my";
		JSONObject json = getRequestFromUrl(url);
		System.out.println(json.toString());
	}

}

相关文章:

  • 小程序问题汇总
  • OpenCV C++双目摄像头实现双目测距
  • 【老师见打系列】:我只是写了一个自动回复讨论的脚本~
  • MATLAB | 如何使用MATLAB绘制甘特图(gantt chart)
  • STM32定时器深入学习
  • JavaConfig
  • codeblock图形界面编程(十)文件操作
  • 算法与数据结构【30天】集训营——详解查找章节数据结构(C语言版 第2版)课后习题答案 (20)
  • 对象以死嘛?对象什么时候该死?看这一篇就够了
  • DDoS报告团伙规模
  • Android 注解与注解处理器简述
  • 【C++】STL——vector(万字详解)
  • Rust学习指南(一)安装RUST后台管理框架
  • 车载操作系统汇总
  • 硬件工程师成长之路(10.1)——芯片选型
  • 分享一款快速APP功能测试工具
  • 「面试题」如何实现一个圣杯布局?
  • ES6系统学习----从Apollo Client看解构赋值
  • HTML-表单
  • iOS 颜色设置看我就够了
  • JS基础之数据类型、对象、原型、原型链、继承
  • Leetcode 27 Remove Element
  • RedisSerializer之JdkSerializationRedisSerializer分析
  • ⭐ Unity 开发bug —— 打包后shader失效或者bug (我这里用Shader做两张图片的合并发现了问题)
  • Vue.js源码(2):初探List Rendering
  • VuePress 静态网站生成
  • 记一次用 NodeJs 实现模拟登录的思路
  • 可能是历史上最全的CC0版权可以免费商用的图片网站
  • 前端面试之闭包
  • 实习面试笔记
  • 使用Maven插件构建SpringBoot项目,生成Docker镜像push到DockerHub上
  • 小程序01:wepy框架整合iview webapp UI
  • 一个完整Java Web项目背后的密码
  • 用 Swift 编写面向协议的视图
  • Nginx惊现漏洞 百万网站面临“拖库”风险
  • 扩展资源服务器解决oauth2 性能瓶颈
  • 如何在招聘中考核.NET架构师
  • # C++之functional库用法整理
  • # 数据结构
  • #ubuntu# #git# repository git config --global --add safe.directory
  • #考研#计算机文化知识1(局域网及网络互联)
  • #控制台大学课堂点名问题_课堂随机点名
  • (145)光线追踪距离场柔和阴影
  • (9)YOLO-Pose:使用对象关键点相似性损失增强多人姿态估计的增强版YOLO
  • (二)正点原子I.MX6ULL u-boot移植
  • (附源码)ssm教师工作量核算统计系统 毕业设计 162307
  • (牛客腾讯思维编程题)编码编码分组打印下标(java 版本+ C版本)
  • (五)关系数据库标准语言SQL
  • (幽默漫画)有个程序员老公,是怎样的体验?
  • .Net Attribute详解(上)-Attribute本质以及一个简单示例
  • .NET Windows:删除文件夹后立即判断,有可能依然存在
  • .NET开源全面方便的第三方登录组件集合 - MrHuo.OAuth
  • .net连接MySQL的方法
  • .NET中winform传递参数至Url并获得返回值或文件
  • ?