当前位置:网站首页>淘宝商品历史价格接口/商品历史价走势接口代码对接分享
淘宝商品历史价格接口/商品历史价走势接口代码对接分享
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"
}
}
}
该接口可以获取淘宝天猫商品价格价格,价格走势,可用于做一般销量监控、短视频带货销量价格监控,行业数据分析业务,代购业务,商城建设需要数据业务,数据分析等业务,希望以上接口代码对接能够帮助到有需要的朋友。
边栏推荐
- Edge浏览器使用BdTab新标签页插件(BD新标签页)
- Sizeof, strlen find character length
- 钉钉小程序 父子传参数对象 子组件页面不更新?
- 从零开始-实现JpetStore网站-1-建立项目框架以及项目介绍
- Amino encoding protocol
- CCNP_ Bt- Reissue
- Local shooting range 2- file upload vulnerability (III) - Network Security
- sizeof、strlen求字符长度
- Penetration problem (main directory, password explosion, database uploading Trojan horse)
- Call to undefined function think\captcha\imagettftext()
猜你喜欢

星巴克创始人:出于安全考量 或不再向非店内消费者开放“公厕”

Microservice system architecture construction I: Environment Construction

CCNP_ BT static routing

ERP basic data concept

HCIP_ OSPF irregular area

Edge浏览器使用BdTab新标签页插件(BD新标签页)

When submitting the laravel admin form and using the required verification, an error is reported when the value is 0

Which is the stronger fresh food distribution and sorting management system?

Using KVM to create three virtual machines that can communicate with local area network

Cosmos star application case
随机推荐
How to download and install stm32cubemx
MySQL query exercise
17. how to understand multi version concurrency control and read / write sets of fabric smart contracts? (vernacular version)
CCNP_ Bt-ospf big experiment (1)
Wechat upload picture material interface
Why do wholesalers use the order system
Data accuracy problems caused by inconsistent data types during sum in MySQL
ES6 deleting an attribute of an object
Shellshock Attack Lab
直播回顾 | 积极防御体系下BAS技术创新探索
水仙花升级版(自幂数)
System safety and Application
Shell脚本常用开发规范
How to use annotations in word
LVM management exercise
Deploy Yum warehouse and NFS shared services
有什么好的管理软件来解决茶叶批发商面临的难题
如何通过JS动态删除table中的数据行(保留head)
Dfinity (ICP) deployment and development-2
Word中批注的使用方法