aliexpress商品详情API接口(速卖通商品详情页面数据接口)代码对接如下:
1.公共参数
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
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版本 |
2.请求参数
请求参数:num_iid=4000926586732
参数说明:num_iid:aliexpress商品ID
3. 请求示例(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/aliexpress/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=4000926586732";
JSONObject json = getRequestFromUrl(url);
System.out.println(json.toString());
}
}
4.响应示例
{
"item": {
"num_iid": "4000926586732",
"title": "Outdoor Breathable Comfort Slip On Plus Size Open Shoes Casual Men Sandals Summer Shoes Sandal Mens Pvc Sandalias Nanlx4 - Men's Sandals - AliExpress",
"desc_short": "",
"price": "11.96",
"total_price": 0,
"suggestive_price": 0,
"orginal_price": "25.99",
"nick": "lvits Store",
"num": 179017,
"min_num": 0,
"detail_url": "https://www.aliexpress.com/item/4000926586732.html",
"pic_url": "https://ae01.alicdn.com/kf/Hb2ea8dc1d28742b980d6a91a7b0dd2f4r/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg",
"brand": "",
"brandId": "",
"rootCatId": 200132143,
"cid": 200132143,
"crumbs": [],
"created_time": "",
"modified_time": "",
"delist_time": "",
"desc": " \r\n\r\n\r\nNote: There will be 3-5mm errors in size as measured by hand. Checking the size table carefully
before you buy it. If you are still not sure which size, Just be free to contact us.
Tips :PLease choose size according your feet long (Heel to Toe),
For example:if your feet length (Heel to Toe)is 23cm,you can choose US size 36.
\r\n\r\n\r\n\r\nTips
\r\nColor difference might be caused by different monitors,lights and other factors.Please understand.
Notice
Usually,order comes without shoes box,only a pair of shoes.But if you need a box,please contact us to increase price.The shoes box values US$5.
\r\nPayment
Currently,you can pay using Visa,MasterCard,Western Union,Qiwi and bank transfer.
\r\nFeedback
1.If you are satisfied with your order, please leave us all 5 stars including Item as Described.
Communication and Shipping Speed.
2.if you think we can do better,please contact with our Customer Service first.We will give you a satisfing answer.
\r\n\n",
"desc_img": [
"//ae01.alicdn.com/kf/Hd0345fd2a600431aa08e525835913408U.jpg",
"//ae01.alicdn.com/kf/H1db073ad78554fe5ae4b2e185fc93bfcm.jpg",
"//ae01.alicdn.com/kf/H52c651dae6224571ae10adc666209a87x.png",
"//ae01.alicdn.com/kf/H369505c20b344ebfad78989757cc734fR.jpg",
"//ae01.alicdn.com/kf/Hbac3d24b6bb048638d13e4ddd56da3bf5.jpg",
"//ae01.alicdn.com/kf/H5885c3d3f1c1491f860a4ba46198279fE.jpg",
"//ae01.alicdn.com/kf/H0451ea7bd0e84a92857a42046b4b1067B.jpg",
"//ae01.alicdn.com/kf/H046ad52702f048fdbb5cc8fea8eb1154o.jpg",
"//ae01.alicdn.com/kf/Hc56aec82c86449b5b06d63bdccab6a80v.jpg",
"//ae01.alicdn.com/kf/H5303c1ec8dc740ec950c5bfbfeaf2bf9T.jpg",
"//ae01.alicdn.com/kf/H562d92141b8941b9b7f833ab546504dfQ.jpg",
"//ae01.alicdn.com/kf/H2cc6f06a87c641729fc0a7cd4def7f2er.jpg",
"//ae01.alicdn.com/kf/H3e49391586d442a98938f379d7bbc819C.jpg",
"//ae01.alicdn.com/kf/Hfb6d149b68b04436b9aac008247c6976t.jpg",
"//ae01.alicdn.com/kf/H464b3e09d35547cc9146191492c73f64A.jpg",
"//ae01.alicdn.com/kf/H8374e13c6b574ddebb2ba54fd35f396eY.jpg",
"//ae01.alicdn.com/kf/H800379e0a9044ea3b9be5113d6ff537fu.jpg",
"//ae01.alicdn.com/kf/H380d2ed0dbd447f585075927f9627bfft.jpg",
"//ae01.alicdn.com/kf/H6a7cecd66a09410daf428a37a2e0d1b2a.jpg",
"//ae01.alicdn.com/kf/Hb9df3dac53804026a6054463a189b29bX.jpg",
"//ae01.alicdn.com/kf/Ha4e0cc1a1b41440283113e8be893484ab.jpg",
"//ae01.alicdn.com/kf/H520d5e5e2b9b46dcbe5d825793450012n.jpg",
"//ae01.alicdn.com/kf/H7cef447217d944668485532cfdf11c06E.jpg",
"//ae01.alicdn.com/kf/Ha4cc78189fec466cbb8dbdc52eef182dj.jpg",
"//ae01.alicdn.com/kf/Hd68f8ff2972a4d718d4b57b1c7894b4am.jpg",
"//ae01.alicdn.com/kf/H1b849f4b823244e3a92d5ad8817a788e2.jpg",
"//ae01.alicdn.com/kf/H5f20555373fc4a4087dfb79a185372d6U.jpg",
"//ae01.alicdn.com/kf/H817e0d2acd8341608621f1322a2935fcB.jpg",
"//ae01.alicdn.com/kf/H2e0a893d2f8e402ea66d81880f48a2867.jpg",
"//ae01.alicdn.com/kf/Hfd2b171fcd1d4bb3bf8cb837d8cbad89Y.jpg"
],
"item_imgs": [
{
"url": "https://ae01.alicdn.com/kf/Hb2ea8dc1d28742b980d6a91a7b0dd2f4r/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg"
},
{
"url": "https://ae01.alicdn.com/kf/H98ffcf349d21491a9d477a21b5f31d75s/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg"
},
{
"url": "https://ae01.alicdn.com/kf/Hffdcad9f8e4d4463a20f837030a51721E/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg"
},
{
"url": "https://ae01.alicdn.com/kf/Ha3a93a04a8f4454eb2142803300ff38el/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg"
},
{
"url": "https://ae01.alicdn.com/kf/H71e73abee8e64db88d9e0f70e0c5ffe8q/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg"
},
{
"url": "https://ae01.alicdn.com/kf/H94f55e43a0f447a1a850b67ffd6b073dj/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg"
}
],
"item_weight": null,
"item_size": null,
"location": "",
"post_fee": "",
"express_fee": "",
"ems_fee": "",
"shipping_to": "",
"has_discount": "",
"video": [],
"is_virtual": "",
"sample_id": "",
"is_promotion": "",
"props_name": "14:771:Color:1;14:193:Color:2;14:173:Color:3;200000124:200000364:Shoe Size:39;200000124:100013888:Shoe Size:40;200000124:100010483:Shoe Size:41;200000124:200000337:Shoe Size:42;200000124:200000338:Shoe Size:43;200000124:100010487:Shoe Size:44",
"prop_imgs": {
"prop_img": [
{
"properties": "14:771",
"url": "https://ae01.alicdn.com/kf/H85be4589a8424536baa46c3935da3998h/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg"
},
{
"properties": "14:193",
"url": "https://ae01.alicdn.com/kf/H00701196df1e408a98cbc0b478ce4043w/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg"
},
{
"properties": "14:173",
"url": "https://ae01.alicdn.com/kf/H67fc5e29dfb04f7c9032f30059e2329em/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg"
}
]
},
"property_alias": "14:771:1;14:193:2;14:173:3;200000124:200000364:39;200000124:100013888:40;200000124:100010483:41;200000124:200000337:42;200000124:200000338:43;200000124:100010487:44",
"props": [
{
"name": "Brand Name",
"value": "CINESSD",
"name_id": null,
"value_id": null
},
{
"name": "Upper Material",
"value": "Mesh (Air mesh)",
"name_id": null,
"value_id": null
},
{
"name": "Sandal Type",
"value": "EVA Injection Shoes",
"name_id": null,
"value_id": null
},
{
"name": "Lining Material",
"value": "Mesh",
"name_id": null,
"value_id": null
},
{
"name": "Style",
"value": "Fashion",
"name_id": null,
"value_id": null
},
{
"name": "Item Type",
"value": "Sandals",
"name_id": null,
"value_id": null
},
{
"name": "Outsole Material",
"value": "PVC",
"name_id": null,
"value_id": null
},
{
"name": "Closure Type",
"value": "Hook & Loop",
"name_id": null,
"value_id": null
},
{
"name": "Heel Height",
"value": "Flat (≤1cm)",
"name_id": null,
"value_id": null
},
{
"name": "Insole Material",
"value": "EVA",
"name_id": null,
"value_id": null
},
{
"name": "Fit",
"value": "Fits true to size, take your normal size",
"name_id": null,
"value_id": null
},
{
"name": "Occasion",
"value": "Casual",
"name_id": null,
"value_id": null
},
{
"name": "Model Number",
"value": "NANLX8",
"name_id": null,
"value_id": null
},
{
"name": "Fashion Element",
"value": "Shallow",
"name_id": null,
"value_id": null
},
{
"name": "Pattern Type",
"value": "Solid",
"name_id": null,
"value_id": null
},
{
"name": "Department Name",
"value": "Adult",
"name_id": null,
"value_id": null
}
],
"total_sold": "",
"skus": {
"sku": [
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:771;200000124:100010487",
"properties_name": "14:771:Color:1;200000124:100010487:Shoe Size:44",
"quantity": 9974,
"sku_id": 10000011258536462
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:771;200000124:200000337",
"properties_name": "14:771:Color:1;200000124:200000337:Shoe Size:42",
"quantity": 9972,
"sku_id": 10000011258536460
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:771;200000124:200000338",
"properties_name": "14:771:Color:1;200000124:200000338:Shoe Size:43",
"quantity": 9970,
"sku_id": 10000011258536460
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:771;200000124:100013888",
"properties_name": "14:771:Color:1;200000124:100013888:Shoe Size:40",
"quantity": 9984,
"sku_id": 10000011258536458
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:771;200000124:100010483",
"properties_name": "14:771:Color:1;200000124:100010483:Shoe Size:41",
"quantity": 9974,
"sku_id": 10000011258536460
},
{
"price": 11.96,
"orginal_price": "25.99",
"properties": "14:771;200000124:200000364",
"properties_name": "14:771:Color:1;200000124:200000364:Shoe Size:39",
"quantity": 9976,
"sku_id": 10000011258536456
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:173;200000124:200000364",
"properties_name": "14:173:Color:3;200000124:200000364:Shoe Size:39",
"quantity": 9950,
"sku_id": 10000011258536472
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:193;200000124:200000338",
"properties_name": "14:193:Color:2;200000124:200000338:Shoe Size:43",
"quantity": 9948,
"sku_id": 10000011258536468
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:193;200000124:100010487",
"properties_name": "14:193:Color:2;200000124:100010487:Shoe Size:44",
"quantity": 9952,
"sku_id": 10000011258536468
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:193;200000124:100010483",
"properties_name": "14:193:Color:2;200000124:100010483:Shoe Size:41",
"quantity": 9963,
"sku_id": 10000011258536466
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:193;200000124:200000337",
"properties_name": "14:193:Color:2;200000124:200000337:Shoe Size:42",
"quantity": 9949,
"sku_id": 10000011258536468
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:193;200000124:200000364",
"properties_name": "14:193:Color:2;200000124:200000364:Shoe Size:39",
"quantity": 9988,
"sku_id": 10000011258536464
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:193;200000124:100013888",
"properties_name": "14:193:Color:2;200000124:100013888:Shoe Size:40",
"quantity": 9976,
"sku_id": 10000011258536464
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:173;200000124:100010487",
"properties_name": "14:173:Color:3;200000124:100010487:Shoe Size:44",
"quantity": 9883,
"sku_id": 10000011258536476
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:173;200000124:200000337",
"properties_name": "14:173:Color:3;200000124:200000337:Shoe Size:42",
"quantity": 9861,
"sku_id": 10000011258536474
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:173;200000124:200000338",
"properties_name": "14:173:Color:3;200000124:200000338:Shoe Size:43",
"quantity": 9861,
"sku_id": 10000011258536476
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:173;200000124:100013888",
"properties_name": "14:173:Color:3;200000124:100013888:Shoe Size:40",
"quantity": 9936,
"sku_id": 10000011258536472
},
{
"price": 13.8,
"orginal_price": "29.99",
"properties": "14:173;200000124:100010483",
"properties_name": "14:173:Color:3;200000124:100010483:Shoe Size:41",
"quantity": 9900,
"sku_id": 10000011258536472
}
]
},
"seller_id": "",
"sales": 195,
"shop_id": "",
"props_list": {
"14:771": "Color:1",
"200000124:100010487": "Shoe Size:44",
"200000124:200000337": "Shoe Size:42",
"200000124:200000338": "Shoe Size:43",
"200000124:100013888": "Shoe Size:40",
"200000124:100010483": "Shoe Size:41",
"200000124:200000364": "Shoe Size:39",
"14:173": "Color:3",
"14:193": "Color:2"
},
"seller_info": {
"nick": "lvits Store",
"city": "China",
"level": "",
"rate": "93.4%",
"score": 0,
"delivery_score": 0,
"item_score": 0,
"shop_type": "",
"user_num_id": 248271972,
"sid": 5778098,
"title": "lvits Store",
"zhuy": "//www.aliexpress.com/store/5778098",
"menu": []
},
"tmall": "",
"error": "",
"warning": "",
"url_log": "",
"score": "",
"votes": "",
"stuff_status": "",
"shopinfo": {
"shop_name": ""
},
"promo_type": "",
"shop_item": [],
"relate_items": [],
"packaging": [],
"current_lang": "en",
"currency_code": "USD",
"props_img": {
"14:771": "https://ae01.alicdn.com/kf/H85be4589a8424536baa46c3935da3998h/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg",
"14:193": "https://ae01.alicdn.com/kf/H00701196df1e408a98cbc0b478ce4043w/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg",
"14:173": "https://ae01.alicdn.com/kf/H67fc5e29dfb04f7c9032f30059e2329em/Outdoor-Breathable-Comfort-Slip-on-Plus-Size-Open-Shoes-Casual-Men-Sandals-Summer-Shoes-Sandal-Mens.jpg"
},
"format_check": "ok"
},
"error": "",
"secache": "3e4d6e3163ea405fffe5690ad6b8de24",
"secache_time": 1657766738,
"secache_date": "2022-07-14 10:45:38",
"reason": "",
"error_code": "0000",
"cache": 0,
"api_info": "today:186 max:10100 all[290=186+75+29];expires:2030-12-31",
"execution_time": "10.677",
"server_time": "Beijing/2022-07-14 10:45:38",
"client_ip": "106.6.38.1",
"call_args": {
"num_iid": "4000926586732"
},
"api_type": "aliexpress",
"translate_language": "zh-CN",
"translate_engine": "google_cn",
"server_memory": "0.95MB",
"request_id": "gw-4.62cf83478f228",
"last_id": "1077129030"
}