联系我们
返回顶部
当前位置 : API集市 > 拼多多
拼多多 使用人数( 98 )

拼多多

275

简介 : 拼多多商城接口

标签 : 综合电商

上架时间 : 2016-12-28

类型 :

使用教程

总调用次数( 每小时更新 )

拼多多商品信息 ¥ 1.50 元/100次 辅助工具 每天免费测试 30

接口服务

接口延迟等级: - 平台反爬等级: -
平台升级频率: -

数据指标

最大数据量: 无限制 最大页数: 无限制
每页数据量: 10 数据实时性: 实时
数据回溯性: 全部 数据排序项: 平台默认
缺失的数据字段: 暂无 备注:

接口标识

请求示例

注: 该接口为实时数据接口,可能受目标平台或网络状态影响,会存在一定的错误率,建议在程序中加入出错重试机制。
错误码参照
-- 请求示例 url 默认请求参数已经做URL编码 curl -i "http://api01.idataapi.cn:8000/product/pinduoduo?apikey={您自己的apikey}&kw=%E6%89%8B%E6%9C%BA"
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 = "http://api01.idataapi.cn:8000/product/pinduoduo?apikey={您自己的apikey}&kw=%E6%89%8B%E6%9C%BA"; JSONObject json = getRequestFromUrl(url);; System.out.println(json.toString()); } }
//using System.Net.Security; //using System.Security.Cryptography.X509Certificates; private const String method = "GET"; static void Main(string[] args) { String bodys = ""; // 请求示例 url 默认请求参数已经做URL编码 String url = "http://api01.idataapi.cn:8000/product/pinduoduo?apikey={您自己的apikey}&kw=%E6%89%8B%E6%9C%BA"; HttpWebRequest httpRequest = null; HttpWebResponse httpResponse = null; if (url.Contains("https://")) { ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult); httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url)); } else { httpRequest = (HttpWebRequest)WebRequest.Create(url); } httpRequest.Method = method; if (0 < bodys.Length) { byte[] data = Encoding.UTF8.GetBytes(bodys); using (Stream stream = httpRequest.GetRequestStream()) { stream.Write(data, 0, data.Length); } } try { httpResponse = (HttpWebResponse)httpRequest.GetResponse(); } catch (WebException ex) { httpResponse = (HttpWebResponse)ex.Response; } Console.WriteLine(httpResponse.StatusCode); Console.WriteLine(httpResponse.Method); Console.WriteLine(httpResponse.Headers); Stream st = httpResponse.GetResponseStream(); StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8")); Console.WriteLine(reader.ReadToEnd()); Console.WriteLine("\n"); } public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) { return true; }
<?php $method = "GET"; // 请求示例 url 默认请求参数已经做URL编码 $url = "http://api01.idataapi.cn:8000/product/pinduoduo?apikey={您自己的apikey}&kw=%E6%89%8B%E6%9C%BA"; $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_ENCODING, "gzip"); var_dump(curl_exec($curl)); ?>
# coding:utf-8 """ Compatible for python2.x and python3.x requirement: pip install requests """ from __future__ import print_function import requests # 请求示例 url 默认请求参数已经做URL编码 url = "http://api01.idataapi.cn:8000/product/pinduoduo?apikey={您自己的apikey}&kw=%E6%89%8B%E6%9C%BA" headers = { "Accept-Encoding": "gzip", "Connection": "close" } if __name__ == "__main__": r = requests.get(url, headers=headers) json_obj = r.json() print(json_obj)

请求参数( 标记* 参数为多选一关系,用户可以根据需要选择填写 )

参数名 类型 必填 示例值 描述
kw string * 关键词
catid string * 分类ID
id string * 3027211304
pageToken string 翻页值

返回参数

参数名 类型 示例值 描述
  • retcode string 000000 返回的状态码
  • -
    data array [...] 返回数据
    • publishDateStr string null 发布时间:字符串格式
    • marketPrice number 12799 市场价
    • catId1 string null 1级分类ID
    • tags string null 标签
    • sellerId string 398601 销售者ID或店铺名
    • saleCount number 74396 销售数
    • catId3 string null 3级分类ID
    • rating string null 商品评分
    • originPlace string null 产地
    • brandName string null 商标名
    • id string 3027211304 产品ID
    • +
      keyValues array [...] 键值对
      • key string 品牌 商品的一般属性:键
      • value string ['Apple/苹果'] 商品的一般属性:值
    • catName3 string null 3级分类名
    • imageUrls array [...] 图像url合集
    • subtitle string null 副标题
    • sellerScreenName string 酷选数码专营店 销售者的昵称
    • publishDate string null 发布时间:时间戳格式
    • saleRank string null 销售排名
    • lowPrice number 8999 价格区间的低价
    • catPathKey string null 分类key, 值为 catName1_catName2_...catNameN
    • catName2 string null 2级分类名
    • price number 10188 价格
    • +
      skuOptions array [...] 商品的单品选项
      • price number 9000 价格
      • name string 颜色:金色 版本:64GB 商品的名称
      • lastPrice number 8999 商品上次的价格(优惠)
      • discountPrice number 8999 商品的折扣价、拼团价等优
      • id number 65120622822 产品ID
      • stockSize number 501 库存量
    • stockSize number 4234 库存量
    • discount string null 折扣:统一为0到10
    • storehouse string null 仓库
    • description string 【下单即送:Lightning接口数据线 全屏钢化膜 防摔软胶套】正规授权经销商 商品的描述
    • highPrice number 9000 价格区间的高价
    • queryWord string null 查询关键字
    • soldout string null 是否售完
    • warranties array [...] 商品的条款
    • url string https://mobile.yangkeduo.com/goods.html?goods_id=3027211304 该产品链接
    • likeCount string null 点赞数或喜爱数
    • catId2 string null 2级分类ID
    • promotions string null 优惠、促销信息
    • commentCount string null 评论数
    • mallType string null 通常为1, 海外为2
    • title string 【国行正品带票】iPhone Xs Max 全网通苹果手机 抢券请看详情页【预售 商品名称
    • appPrice string null 通过手机购买价格
    • catName1 string null 1级分类名
    • favoriteCount string null 收藏数
  • appCode string pinduoduo 本次查询的api名
  • dataType string product 本次查询的api类型
  • pageToken string null 翻页值
  • hasNext boolean false 是否有下一页

返回示例值

{
    "retcode": "000000",
    "data": [
        {
            "publishDateStr": null,
            "marketPrice": 12799,
            "catId1": null,
            "tags": null,
            "sellerId": "398601",
            "saleCount": 74396,
            "catId3": null,
            "rating": null,
            "originPlace": null,
            "brandName": null,
            "id": "3027211304",
            "keyValues": [
                {
                    "key": "品牌",
                    "value": "['Apple\/苹果']"
                },
                {
                    "key": "型号",
                    "value": "['iPhone XS Max']"
                },
                {
                    "key": "存储容量",
                    "value": "['64GB', '256GB', '512GB']"
                },
                {
                    "key": "屏幕尺寸",
                    "value": "['6.5英寸']"
                }
            ],
            "catName3": null,
            "imageUrls": [
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/fb84c913415c3deb7770ff91a458c5dd.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-19\/f65312f2ccc2ae716daed9fca3d8b8c0.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/4dd28a647448e4186e86a0f2d754e467.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/a01bfc6df705fb4ae16b77f1de840478.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/04f8d21fe09d3c5fc05b031bc27842e1.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/898e2c7770075ecdd873b4617456de7c.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/b374ef8db725d37bdae7749e9ec12224.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/fd88d6aad7644bc643fddc710715e576.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/a98df599bf6d14b62e49bc175ff54dec.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/a279c96da4c3d091100b43c0575a433c.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/52d02ea37b05bab40d4493175e96e992.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/3a6bbb7ecd682c10dd8b65273b7e6eaf.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/1c0f7653186e1681c266714857cd3881.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/6073ab70e6caffd4c9af8b4f4832fe43.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/a7273a8874779c91ca3992444dbcac7d.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/5a600b2fabfd0b7a2c38305fbc10e34a.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-01\/1acf47e1020c1651b2b6df992b22e3a9.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-10-21\/5a88185da9f21ad19d5461dde82cca3c.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-09-21\/701f498b74a388d95551e8f13c97847a.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-12-25\/db19da86bf203d83116b134630f4a9cb.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-12-24\/a75c087dfb2c028888c0fd010374302e.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-12-24\/a15036f8ec3f808656305f69650daf4f.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2018-12-25\/2e572231a4f2261d6db69116f0fd45c1.jpeg",
                "http:\/\/t00img.yangkeduo.com\/goods\/images\/2019-01-10\/88387f3d9c7f5a9102ab68c0f9336598.jpeg"
            ],
            "subtitle": null,
            "sellerScreenName": "酷选数码专营店",
            "publishDate": null,
            "saleRank": null,
            "lowPrice": 8999,
            "catPathKey": null,
            "catName2": null,
            "price": 10188,
            "skuOptions": [
                {
                    "price": 9000,
                    "name": "颜色:金色\n版本:64GB",
                    "lastPrice": 8999,
                    "discountPrice": 8999,
                    "id": 65120622822,
                    "stockSize": 501
                },
                {
                    "price": 10189,
                    "name": "颜色:金色\n版本:256GB",
                    "lastPrice": 10188,
                    "discountPrice": 10188,
                    "id": 65120622823,
                    "stockSize": 2726
                },
                {
                    "price": 9000,
                    "name": "颜色:银色\n版本:64GB",
                    "lastPrice": 8999,
                    "discountPrice": 8999,
                    "id": 65120622825,
                    "stockSize": 505
                },
                {
                    "price": 9000,
                    "name": "颜色:深空灰色\n版本:64GB",
                    "lastPrice": 8999,
                    "discountPrice": 8999,
                    "id": 65120622828,
                    "stockSize": 502
                },
                {
                    "price": 10189,
                    "name": "颜色:深空灰色\n版本:256GB",
                    "lastPrice": 10188,
                    "discountPrice": 10188,
                    "id": 65120622829,
                    "stockSize": 0
                }
            ],
            "stockSize": 4234,
            "discount": null,
            "storehouse": null,
            "description": "【下单即送:Lightning接口数据线 全屏钢化膜 防摔软胶套】正规授权经销商,酷选数码专营店承诺:①所销售产品均为全新正品,大陆行货,支持全国联保,带正规电子发票。②所销售产品支持7天无理由退换货。③所销售产品使用顺丰包邮【由于商品订单量大,用户下单后不支持修改地址,下单前请仔细确认收货信息。每人限购1台,多拍订单有权取消,相似收货人,收货地址均视为相同订单】",
            "highPrice": 9000,
            "queryWord": null,
            "soldout": null,
            "warranties": [
                "商家承诺指定区域“顺丰包邮”,未履行服务将赔付15元无门槛代金券",
                "确认收货前申请退货退款,消费者将会收到退货运费补贴",
                "购买成功后,商家承诺为您开具正品发票",
                "品牌方售后电话报修,直达品牌售后",
                "所有商品均无条件包邮",
                "满足相应条件时,消费者可申请7天无理由退换货",
                "若收到商品是假冒品牌,可获得十倍赔偿"
            ],
            "url": "https:\/\/mobile.yangkeduo.com\/goods.html?goods_id=3027211304",
            "likeCount": null,
            "catId2": null,
            "promotions": null,
            "commentCount": null,
            "mallType": null,
            "title": "【国行正品带票】iPhone Xs Max 全网通苹果手机 抢券请看详情页【预售:1月15日发完】",
            "appPrice": null,
            "catName1": null,
            "favoriteCount": null
        }
    ],
    "appCode": "pinduoduo",
    "dataType": "product",
    "pageToken": null,
    "hasNext": false
}

数据详细介绍

拼多多商品API,支持关键词、分类搜索、以及id拿取商品详细信息。 当前拼团价=>discountPrice,上次的拼团价=>lastPrice

状态码

状态返回值格式 : JSON

{

message:"API rate limit exceeded",

retcode:100703

}

平台上所有接口按调用次数收费,具体请参看以下状态码表。

状态代码 状态信息 详细描述 是否收费?
000000 invoke successfully(data is not null) 成功调用并返回数据
100002 Search no result 目标参数搜索没结果
100301 Account not found 用户帐号不存在
100303 Search no result 账号未收录
100000 Server internal error 服务器内部错误
100001 Network error 网络错误
100004 Target server error 目标服务器错误
100005 Param error 用户输入参数错误
100700 Invalid authentication credentials 授权失败
100701 API stopped 您的当前API已停用
100702 Account stopped 您的账户已停用
100703 API rate limit exceeded 并发已达上限
100704 API maintenance API维护中
100705 API not found with these values API不存在
100706 Please add api first 请先添加api
100707 Number of calls exceeded 调用次数超限
100802 Missing url param 'time' or uri path is not equal to 2 请求路径错误或者缺少"time"参数
100803 Wrong pageToken 参数pageToken有误

经常一起购买的数据