通过商品ID获取到拼多多APP详情接口,包括主图,价格,优惠券信息,优惠价,已拼数量,商品拼单价,商品评论内容等数据,拼多多商品详情接口接入方案

一、接口参数说明:
1.通过拼多多商品ID,获取到包括主图,价格,优惠券信息,优惠价,已拼数量,商品拼单价,商品评论内容等页面上有的数据均可以拿到,希望能够帮助到有需要的朋友,代码对接如下:
2.公共参数
名称 类型 必须 描述
key String 是 调用key(必须以GET方式拼接在URL中,点击获取测试key和secret
secret String 是 调用密钥
api_name String 是 API接口名称(包括在请求地址中)[item_search,item_get,item_search_shop等]
cache String 否 [yes,no]默认yes,将调用缓存的数据,速度比较快
result_type String 否 [json,jsonu,xml,serialize,var_export]返回数据格式,默认为json,jsonu输出的内容中文可以直接阅读
lang String 否 [cn,en,ru]翻译语言,默认cn简体中文
version String 否 API版本
二、请求参数:
请求参数:num_iid=1620002566
参数说明:num_iid:商品ID ;
三、响应参数:
名称 类型 示例值 描述
num_iid String 1999629976 商品ID
title String 2019新款女装短袖t恤女夏宽松韩版休闲上衣百搭蝙蝠衫五分袖体恤 商品标题
price Float 8.8 价格
minGroupPrice String
maxGroupPrice String
total_price Float
orginal_price Float 原价
nick String 雅怡服饰1688 卖家昵称
num Int 233 库存
sales Int 76 销量
detail_url String http://yangkeduo.com/goods.html?goods_id=1999629976 宝贝链接
desc String 本店默认申通快递【还有百世汇通 中通快递 中通 韵达 邮政】。商家建议尺码仅供参考。如有其它问题请及时联系客服!喜欢的赶紧购买,质量保证,买的放心,穿的也开心! 商品备注
item_imgs Mix [{“url”: “//t00img.yangkeduo.com/t05img/images/2018-06-28/24bcb29df1195edaea840afd3e1bdaf9.jpeg?imageMogr2/strip%7CimageView2/2/w/1300/q/80”}] 宝贝图片列表
pic_url String //t00img.yangkeduo.com/t05img/images/2018-06-28/24bcb29df1195edaea840afd3e1bdaf9.jpeg?imageMogr2/thumbnail/150x/quality/50 宝贝图片
props_name String 商品属性名
prop_imgs Mix {“prop_img”: [ {“properties”: “0:0;1:1”, “url”: “//t00img.yangkeduo.com/t10img/images/2018-06-28/5c8f783ab2c4fea0ffea8fac73d8b2c2.jpeg”}]} 商品属性图片列表
props Mix 商品详情
skus Mix {“sku”: [{“price”: “16.56”, “total_price”: null, “orginal_price”: “20.9”, “properties”: “0:0;1:1”, “properties_name”: “0:0:颜色:黑色;1:1:尺码:M【75-100斤】”, “quantity”: 221, “sku_id”: 36410965966}] 商品规格信息
props_list Mix { “0:0”: “颜色:黑色”,“1:1”: “尺码:M【75-100斤】”} 商品属性
props_img Mix {“0:0;1:1”: “//t00img.yangkeduo.com/t10img/images/2018-06-28/5c8f783ab2c4fea0ffea8fac73d8b2c2.jpeg”} 属性图片
property_alias String 商品属性别名
seller_info Mix {“nick”: “雅怡服饰1688”, “city”: “”, “level”: null, “rate”: null, “score”: 4.27, “delivery_score”: 4.37, “item_score”: 4.38, “shop_type”: “”, “user_num_id”: “”, “sid”: 99033, “shop_name”: “雅怡服饰1688”, “zhuy”: “”, “menu”: [] } 卖家信息
shop_item Mix []
relate_items Mix []
四、请求示例:(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://vx19970108018/pinduoduo/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=1620002566";
		JSONObject json = getRequestFromUrl(url);
		System.out.println(json.toString());
	}

}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值