Contact Us
Back top
Current Location : APIs > 京东商城
京东商城 Transactions( 132 )

京东商城

Intro. : JD

Tag : 综合电商 On Shelves Time : 2016-09-28

Type :

商品 排名 评论

Tutorials

Total invocations(updated per hour)

京东商城 1.00 yuan/100calls

API Mark

Example

注: 该接口为实时数据接口,可能受目标平台或网络调整影响存在一定错误率,建议程序中加入出错重试机制。
iDataAPI力求每个数据产口都为您提供稳定,持久的服务,平台上所有接口按成功调用次数收费,出错不收费,请放心使用。
Error Code
-- 请求示例 url 默认请求参数已经做URL编码 curl -i "http://api01.idataapi.cn:8000/product/jd?apikey=你自己的apikey&catid=655&pageToken=1"
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/jd?apikey=你自己的apikey&catid=655&pageToken=1"; 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/jd?apikey=你自己的apikey&catid=655&pageToken=1"; 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/jd?apikey=你自己的apikey&catid=655&pageToken=1"; $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/jd?apikey=你自己的apikey&catid=655&pageToken=1" headers = { "Accept-Encoding": "gzip", "Connection": "close" } if __name__ == "__main__": r = requests.get(url, headers=headers) json_obj = r.json() print(json_obj)

Request Field( Params marked* means users should choose one from the each marked items to fill in.)

Property Name Type Mandatory Example Description
kw string * 小米 关键词
shopid string * 1000000904 京东店铺ID
goodsid string * 100000287145 京东商城网页端商品ID
pageToken string 1 翻页值
sortType string 商品排序规则(默认销量排序)
size string 10
startPrice string
endPrice string

Response Fields

Property Name Type Example Description
  • hasNext boolean false 是否有下一页
  • -
    data array [...] 返回数据
    • imageUrls array [...] 图片链接集合
    • mallType number 1 1.普通商品 2.全球购
    • commentCount number 1208910 评论数
    • url string https://item.jd.com/1385736.html 该产品链接
    • brandName string null 品牌名称
    • price number 64 价格
    • id string 1385736 产品ID
    • sellerId string 1000008625 店铺ID
    • subtitle string null 副标题
    • skuOptions array null sku选项列表
    • sellerScreenName string 欧德堡牛奶京东自营旗舰店 店铺名称
    • tags array [...] 商品标签
    • rating number 4.92 商品评分
    • detailImageUrls array [...] 商品详情图片链接集合
    • catPathKey string null 分类key, 值为 catName1_catName2_...catNameN
    • +
      relevantProducts array [...] 相关商品(看了又看)
      • title string 德国 进口牛奶 Arla爱氏晨曦 全脂牛奶 200ml*24 整箱装 商品名称
      • url string https://item.jd.com/1857014.html 该产品链接
      • price number 56 价格
      • id number 1857014 产品ID
      • coverUrl string http://img11.360buyimg.com/n1/s150x150_jfs/t3106/217/4074848997/93532/fc9827e4/57fdf859N2f3f8dd7.jpg 产品封面
    • selfSale boolean true 是否自营
    • title string 德国 进口牛奶 欧德堡(Oldenburger)超高温处理全脂纯牛奶200ml* 商品名称
    • promotions array [...] 优惠、促销信息
    • +
      keyValues array [...] 键值对(商品参数)
      • key string 配料 商品参数键
      • value string 生牛乳 商品参数值
    • +
      recommendations array [...] 推荐商品
      • title string 【京东超市】德国 进口牛奶 欧德堡(Oldenburger)超高温处理脱脂纯牛奶 商品名称
      • url string https://item.jd.com/2816155.html 该产品链接
      • id string 2816155 产品ID
      • coverUrl string https://img10.360buyimg.com/n2/jfs/t2629/207/1735652768/271500/94a11a6f/5747a52bNc356e6c4.jpg 产品封面
    • queryWord string null 来自分类名称
    • saleRank string null 销售排名
    • soldout string null 是否售完
    • goodRatingRatio number 0.983 好评率
  • appCode string jd 本次查询的api名
  • dataType string product 本次查询的api类型
  • pageToken string null 翻页值
  • retcode string 000000 返回的状态码

Returns The Sample

null

Detailed Data

No Details

状态码

Status Code Return Value Format : JSON

{

message:"API rate limit exceeded",

retcode:100703

}

The API in our platform is only paid when invoked successfully. For the detail, please refer to the below table.

Status Code Code Meaning Detailed Description Need paid or not?
000000 invoke successfully(data is not null) 成功调用并返回数据
100002 Search no result 目标参数搜索没结果
100000 Server internal error 服务器内部错误
100001 Network error 网络错误
100004 Target server error 目标服务器错误
100005 Param error 用户输入参数错误
100301 Account not found 用户帐号不存在
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有误

Often With The Purchase Of Data