当前位置:网站首页>淘宝商品历史价格接口/商品历史价走势接口代码对接分享
淘宝商品历史价格接口/商品历史价走势接口代码对接分享
2022-06-13 08:20:00 【wx_1597063760】
一、淘宝商品历史价格接口/商品历史价走势接口代码如下:
点击获取key和secret
1.请求参数:
请求参数:num_iid=584458528092
参数说明:num_iid:商品id
2.响应参数:
名称 类型 必须 示例值 描述
num_iid Bigint 0 584458528092 宝贝ID
title String 0 女装 SUPIMA COTTON圆领T恤(短袖) 413674 优衣库UNIQLO 商品标题
detail_url String 0 https://item.taobao.com/item.htm?id=584458528092 宝贝链接
pic_url String 0 宝贝图片
lower_price Float 0 39.00 最低价
lower_date String 0 2020-12-22 最低价日期
current_price Float 0 39.00 当前价
change_price_remark String 0
item Mix 0 {
"date": "2020-06-25", "price": "39.00", "discount": "",} 价格信息
3.请求示例(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://获取key/taobao/item_history_price/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=584458528092";
JSONObject json = getRequestFromUrl(url);
System.out.println(json.toString());
}
}
4.响应示例:
{
code: 200,
msg: "请求成功【success】",
total_results: "7",
data: {
item_id: "570759102711",
max_price: "128.00",
min_price: "34.90",
last_date: "2020-05-20",
total: "7",
price_list: {
2019-06-30: "39.90",
2020-04-16: "128.00",
2020-04-30: "39.90",
2020-05-04: "128.00",
2020-05-13: "34.90",
2020-05-17: "39.90",
2020-05-19: "34.90"
}
}
}
该接口可以获取淘宝天猫商品价格价格,价格走势,可用于做一般销量监控、短视频带货销量价格监控,行业数据分析业务,代购业务,商城建设需要数据业务,数据分析等业务,希望以上接口代码对接能够帮助到有需要的朋友。
边栏推荐
- CCNP_ BT static routing
- Edge browser uses bdtab new tab plug-in (BD new tab)
- 学习记录4: einops // cudnn.benchamark=true // hook
- IPFs cluster setup process
- Phpexcel 10008 error resolution
- How to dynamically delete data rows in a table through JS (keep the head)
- PHP isset() method ignores data error handling caused by null parameter value
- Process and scheduled task management
- Determine whether a string is rotated from another string
- Leetcode- sort arrays by parity
猜你喜欢

赋予代码生命力--读代码整洁之道

学习记录4: einops // cudnn.benchamark=true // hook

适合生鲜批发行业的几种精准接单方式

Redis subscribe connection timeout interrupt problem solution

Is there any good management software to solve the problems faced by tea wholesalers

Start from scratch - implement the jpetstore website -1- establish the project framework and project introduction

BD新标签页(BdTab)插件如何登入?

How app inventor accesses resource files in assets directory

ERP基础数据 金蝶

Structural analysis of hyperledger fabric (I)
随机推荐
Phpexcel 10008 error resolution
Daffodil upgrade (self idempotent)
HCIP_ Static experiment
从零开始-实现JpetStore网站-1-建立项目框架以及项目介绍
sizeof、strlen求字符长度
Basic operation of dfinity (ICP) development-4
ERP basic data Huaxia
HCIP_ OSPF irregular area
关于redis使用分布式锁的封装工具类
使用kvm创建三台能通局域网的虚拟机
钉钉小程序如何隐藏tab
[virt-manager]远程管理启动虚拟机时,鼠标飘逸的问题
How to dynamically delete data rows in a table through JS (keep the head)
Leetcode- sort arrays by parity
微服务项目搭建三:自动生成代码
ES6 deleting an attribute of an object
判断一个字符串是否由另外一个字符串旋转而来
Founder of Starbucks: no longer open "public toilets" to non store consumers for safety reasons
Live broadcast review | bas technology innovation exploration under active defense system
Amino encoding protocol