IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> Java知识库 -> 通过seller_nick:店铺昵称或者是店铺主链接获取店铺所有商品接口,1688店铺所有商品接口接口获取方案 -> 正文阅读

[Java知识库]通过seller_nick:店铺昵称或者是店铺主链接获取店铺所有商品接口,1688店铺所有商品接口接口获取方案

一、接口参数说明:
方式一:通过店铺昵称ID可以拿到店铺所有商品,包括:店铺的所有商品,num_iid 宝贝ID,商品标题,宝贝图片,价格,商品链接,可以翻页拿到店铺所有的商品详情数据。
点击获取到key和secret
在这里插入图片描述
方式二:通过店铺主链接拿到店铺商品接口,包括:包括:店铺的所有商品,num_iid 宝贝ID,商品标题,宝贝图片,价格,商品链接,可以翻页拿到店铺所有的商品详情数据等。
二、请求参数:
请求参数:seller_nick=b2b-2200733087881719de&start_price=0&end_price=0&q=&page=1&cid=
参数说明:seller_nick:店铺昵称或sid(目前只支持sid))
sort:排序[bid,_bid,_sale,_credit]
(bid:总价(升序)_bid:总价(降序),sale:销量,默认综合排序,time:新品)
sort=new为店铺上新数据,格式不统一,请注意
page:页数
三、响应参数:
在这里插入图片描述
四、请求示例:(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和secret/1688/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&seller_nick=b2b-2200733087881719de&start_price=0&end_price=0&q=&page=1&cid=";
		JSONObject json = getRequestFromUrl(url);
		System.out.println(json.toString());
	}

}

响应示例:

{
	"user": {
		"id": null,
		"nick": null,
		"good_num": null,
		"level": null,
		"created": null,
		"shop_type": null,
		"user_num_id": null,
		"company_id": null,
		"company_dj": null,
		"company_time": null,
		"company_info": null,
		"cid": "-1",
		"sid": null,
		"pic_url": null,
		"video": null,
		"title": null,
		"address": null,
		"phone": null,
		"zhuy": "./page/contactinfo.htm",
		"fh_score": null,
		"hm_score": null,
		"xy_score": null,
		"ht_score": null,
		"menu": null
	},
	"items": {
		"item": [
			{
				"num_iid": "629206406356",
				"title": "天语欧博信米图手机X27S Mate30 P40 Pro个性简约时尚手机壳批发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2020/782/417/21694714287_2101792098.jpg",
				"price": "19.9",
				"detail_url": "https://m.1688.com/offer/629206406356.html"
			},
			{
				"num_iid": "606991177049",
				"title": "大容量10000毫安全新爆款移动电源自带线充电宝礼品厂家直销",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2019/517/800/12487008715_2101792098.jpg",
				"price": "39.9",
				"detail_url": "https://m.1688.com/offer/606991177049.html"
			},
			{
				"num_iid": "603067013582",
				"title": "P3跨境新爆款现货6.5寸水滴大屏全网通4G智能手机海外代发OEM定制",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2019/492/814/12111418294_2101792098.jpg",
				"price": "52.0",
				"detail_url": "https://m.1688.com/offer/603067013582.html"
			},
			{
				"num_iid": "613515982791",
				"title": "5.8寸大屏工作室root纯净版2+16G云群控抖音快手微信手机OEM批发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2020/270/438/13682834072_2101792098.jpg",
				"price": "66.0",
				"detail_url": "https://m.1688.com/offer/613515982791.html"
			},
			{
				"num_iid": "637339319017",
				"title": "P40 Pro品牌爆款6.5寸水滴大屏8+256G全网通5G安卓智能手机批代发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2020/278/368/16085863872_2101792098.jpg",
				"price": "298.0",
				"detail_url": "https://m.1688.com/offer/637339319017.html"
			},
			{
				"num_iid": "632168014097",
				"title": "新款30pro 7.5寸水滴大屏8+256G全网通5G低价智能手机正品代批发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2019/048/299/12073992840_2101792098.jpg",
				"price": "298.0",
				"detail_url": "https://m.1688.com/offer/632168014097.html"
			},
			{
				"num_iid": "624579363633",
				"title": "mate30 pro新款6.5英寸水滴大屏8+256G全网通5G低价智能手机批发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2020/285/407/17053704582_2101792098.jpg",
				"price": "298.0",
				"detail_url": "https://m.1688.com/offer/624579363633.html"
			},
			{
				"num_iid": "624015201074",
				"title": "新款X27 6.5寸全面水滴大屏8+128G全网通5G安卓智能手机批代发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2019/469/649/11428946964_2101792098.jpg",
				"price": "298.0",
				"detail_url": "https://m.1688.com/offer/624015201074.html"
			},
			{
				"num_iid": "634673693747",
				"title": "真新款mate40 pro 7.2寸水滴大屏8+256G全网通5G低价智能手机批发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/O1CN01vYUdfL1ZrAfnyJVZy_!!6000000003247-0-cib.jpg",
				"price": "299.0",
				"detail_url": "https://m.1688.com/offer/634673693747.html"
			},
			{
				"num_iid": "634599513272",
				"title": "新款mate40 pro 7.2寸水滴大屏10+256G全网通5G低价智能手机批发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/O1CN01hXorlV24Cdi8vAod4_!!6000000007355-0-cib.jpg",
				"price": "299.0",
				"detail_url": "https://m.1688.com/offer/634599513272.html"
			},
			{
				"num_iid": "589766232746",
				"title": "新款X27 6.5寸全面水滴大屏8+128G全网通5G安卓智能手机批代发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2020/976/670/13387076679_2101792098.jpg",
				"price": "308.0",
				"detail_url": "https://m.1688.com/offer/589766232746.html"
			},
			{
				"num_iid": "636684457600",
				"title": "爆款hviv mate30 pro6.8寸水滴大屏256G全网通低价智能手机批代发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2020/610/814/19520418016_2101792098.jpg",
				"price": "398.0",
				"detail_url": "https://m.1688.com/offer/636684457600.html"
			},
			{
				"num_iid": "622583886323",
				"title": "爆款Hviv Mate40Pro+6.8寸水滴大屏512G全网通低价智能手机批代发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/O1CN01O9vUUY285Y3UOWbWL_!!2200733087881-0-cib.jpg",
				"price": "399.0",
				"detail_url": "https://m.1688.com/offer/622583886323.html"
			},
			{
				"num_iid": "589984649469",
				"title": "6.5寸大屏安卓9.0工作室root纯净版4+64G云群控抖音快手阅读手机",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2019/242/368/10339863242_902098348.jpg",
				"price": "469.0",
				"detail_url": "https://m.1688.com/offer/589984649469.html"
			},
			{
				"num_iid": "617854475887",
				"title": "电视话购物工作室root纯净版4+64G云群控抖音快手微信手机OEM批发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2019/382/361/12287163283_2101792098.jpg",
				"price": "698.0",
				"detail_url": "https://m.1688.com/offer/617854475887.html"
			},
			{
				"num_iid": "624494524174",
				"title": "爆款hviv mate30 pro6.8寸水滴大屏256G全网通低价智能手机批代发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2020/876/517/19593715678_2101792098.jpg",
				"price": "998.0",
				"detail_url": "https://m.1688.com/offer/624494524174.html"
			},
			{
				"num_iid": "630981381989",
				"title": "品牌P40 Pro+7.5寸水滴大屏10+256G全网通低价智能手机正品代批发",
				"pic_url": "https://cbu01.alicdn.com/img/ibank/2020/062/412/20219214260_2101792098.jpg",
				"price": "1199.0",
				"detail_url": "https://m.1688.com/offer/630981381989.html"
			}
		],
		"total_results": "17",
		"page_size": 20,
		"pagecount": 1,
		"page": "1",
		"url": null
	},
	"error": "",
	"secache": "3bbcb618f225b45561bbb1686d15b91c",
	"secache_time": 1615280560,
	"secache_date": "2021-03-09 17:02:40",
	"translate_status": "",
	"translate_time": 0,
	"language": {
		"default_lang": "cn",
		"current_lang": "cn"
	},
	"reason": "",
	"error_code": "0000",
	"cache": 0,
	"api_info": "today:8 max:10000",
	"execution_time": 7.492,
	"server_time": "Beijing/2021-03-09 17:02:40",
	"client_ip": "106.6.35.144",
	"call_args": {
		"nick": "b2b-2200733087881719de"
	},
	"api_type": "1688",
	"translate_language": "zh-CN",
	"translate_engine": "google_cn",
	"server_memory": "3.56MB",
	"request_id": "gw-4.604739a9443f6"
}

API 工具
API SDK调用示例
APISDK下载
API测试工具

如何开通API测试,点击立即开通

  Java知识库 最新文章
计算距离春节还有多长时间
系统开发系列 之WebService(spring框架+ma
springBoot+Cache(自定义有效时间配置)
SpringBoot整合mybatis实现增删改查、分页查
spring教程
SpringBoot+Vue实现美食交流网站的设计与实
虚拟机内存结构以及虚拟机中销毁和新建对象
SpringMVC---原理
小李同学: Java如何按多个字段分组
打印票据--java
上一篇文章      下一篇文章      查看所有文章
加:2022-03-17 21:56:42  更:2022-03-17 22:00:28 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/24 9:32:22-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码