接口使用场景等说明:多多进宝现在和淘宝联盟、京东联盟一样,采用的是加密字符串商品ID,如:E1921KwH23Eb23wfD15BQ3zBX22s2tA_Jh3Sx2Q19a
如果您需要把它还原成拼多多的数字商品ID,如5251195119,那么就可以使用本接口。
本接口专门用于把多多进宝的字符串ID转成拼多多的数字商品ID,需要专用会员卡。
比如 :
E1921KwH23Eb23wfD15BQ3zBX22s2tA_Jh3Sx2Q19a
转换成:
5251195119或 https://mobile.yangkeduo.com/goods2.html?goods_id=5251195119
| 环境 | http 地址 | https 地址 |
|---|---|---|
| 正式环境 | http://api.veapi.cn/pdd/pddstridtonum | 暂无 |
| 参数名称 | 参数类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| vekey | String | 是 | V123M56 | 公共参数,接口秘钥,请在会员中心获取 |
| strid | String | 是 | E1921KwH23Eb23wfD15BQ3zBX22s2tA_Jh3Sx2Q19a | 多多进宝的字符串ID |
| p_id | String | 是 | 4319236_3421117 | 您的PID |
| custom_parameters | String | 是 | 6138 | 和p_id关联的custom_parameters,具体参考备案文档 |
GET/POST http://api.veapi.cn/pdd/pddstridtonum?vekey=xxx&p_id=427943516_342136517&custom_parameters=7888&strid=E1921KwH23Eb23wfD15BQ3zBX22s2tA_Jh3Sx2Q19a
$api="http://api.veapi.cn/pdd/pddstridtonum?vekey=xxx&p_id=427943516_342136517&custom_parameters=7888&strid=E1921KwH23Eb23wfD15BQ3zBX22s2tA_Jh3Sx2Q19a"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $api); //curl_setopt($ch, CURLOPT_POST, true); //POST方式时启用 //curl_setopt($ch, CURLOPT_POSTFIELDS, $postData ); //POST方式时传参 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //如果使用https请启用 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //如果使用https请启用 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); //返回数据流,不直接输出 curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); //使用gzip压缩传输让访问更快 curl_setopt($ch, CURLOPT_TIMEOUT, 6); //允许执行的最长秒数。这里设定6S curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); $result = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); echo $result; //返回值
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpRequest;
public class testGetParam {
public static void main(String[] args) {
// API网址
String url = "http://api.veapi.cn/pdd/pddstridtonum?vekey=xxx&p_id=427943516_342136517&custom_parameters=7888&strid=E1921KwH23Eb23wfD15BQ3zBX22s2tA_Jh3Sx2Q19a";
// JDK 8u111版本后,若目标页面为HTTPS协议,请启用proxy用户密码鉴权
//System.setProperty("jdk.http.auth.tunneling.disabledSchemes", "");
// 发送请求
String result = HttpRequest.get(url)
.timeout(10000)//设置超时,毫秒
.execute().body();
System.out.println(result);
}
}
import requests # 要访问的API网页 target_url = "http://api.veapi.cn/pdd/pddstridtonum?vekey=xxx&p_id=427943516_342136517&custom_parameters=7888&strid=E1921KwH23Eb23wfD15BQ3zBX22s2tA_Jh3Sx2Q19a" # 发送请求 response = requests.get(target_url) # 获取页面内容 if response.status_code == 200: print response.text
| 参数名称 | 参数类型 | 示例值 | 描述 |
|---|---|---|---|
| input_strid | String | E1921KwH23Eb23wfD15BQ3zBX22s2tA_Jh3Sx2Q19a | 您提供的多多进宝的商品字符串ID |
| num_id | Number | 5251195119 | 上面input_strid入参的字符串ID转换出来的拼多多数字商品ID |
| url | String | https://mobile.yangkeduo.com/goods.html?goods_id=5251195119 | 指数字商品的官网详情链接 |
{ "error": "0", "msg": "拼多多字符串商品ID成功转换成数字ID", "data": { "input_strid": "E1921KwH23Eb23wfD15BQ3zBX22s2tA_Jh3Sx2Q19a", "num_id": "5251195119", "url": "https://mobile.yangkeduo.com/goods.html?goods_id=5251195119" }, "request_id": "126s2HY" }