日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

通过商品ID和区域ID及cookie插件获取商品快递费用接口,1688快递物流费用接口,1688商品物流费用API接口获取方案

發(fā)布時(shí)間:2024/1/8 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 通过商品ID和区域ID及cookie插件获取商品快递费用接口,1688快递物流费用接口,1688商品物流费用API接口获取方案 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

一、接口參數(shù)說明:
1.通過商品ID及區(qū)域ID并且安裝cookie插件得到cookie值,拿到商品物流費(fèi)用,寶貝ID,發(fā)貨地,區(qū)域ID,目的地, 數(shù)量, 快遞費(fèi)用,快遞,EMS費(fèi)用,物流費(fèi)用,價(jià)格,尺寸,詳情描述等頁(yè)面上可以看到的數(shù)據(jù)均可以拿到。
點(diǎn)擊獲取測(cè)試key和secret
二、請(qǐng)求參數(shù):
請(qǐng)求參數(shù):num_iid=591734471276&area_id=2274&cookie=

參數(shù)說明:num_iid:商品ID
area_id:區(qū)域ID(2274是新余)
num:商品數(shù)量,必須要大于最少起批量,否則默認(rèn)是最小起批量
cookie:base64加密后的cookie
三、響應(yīng)參數(shù):

四、請(qǐng)求示例:(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 {// 請(qǐng)求示例 url 默認(rèn)請(qǐng)求參數(shù)已經(jīng)URL編碼處理String url = "https://點(diǎn)擊注冊(cè)獲取/1688/item_fee/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=591734471276&area_id=2274&cookie=";JSONObject json = getRequestFromUrl(url);System.out.println(json.toString());}}

響應(yīng)示例:

{"item": {"num_iid": "591734471276","location": "浙江 金華","area_id": "2274","shipping_to": "新余","num": "1","express_fee": "10","subTemplate": "快遞","ems_fee": "","post_fee": "","price": "4.30","beginAmount": 50,"unitWeight": 0.108,"Weight": 0.108,"memberId": "b2b-4092256050664c4","url": "https://detail.1688.com/offer/591734471276.html","data_from": "1688app"},"secache": "eb3ba62314961114d851046a17279f1a","secache_time": 1614824198,"secache_date": "2021-03-04 10:16:38","error": "","reason": "","error_code": "0000","cache": 1,"api_info": "today:35 max:10000","execution_time": 0.06,"server_time": "Beijing/2021-03-05 15:49:25","client_ip": "106.6.39.197","call_args": {"num_iid": "591734471276","area_id": "2274"},"api_type": "1688","translate_language": "zh-CN","translate_engine": "google_cn","server_memory": "3.5MB","request_id": "4.6041e2852b534" }

API 工具
API SDK調(diào)用示例
APISDK下載
API測(cè)試工具

如何開通API測(cè)試,點(diǎn)擊立即開通

總結(jié)

以上是生活随笔為你收集整理的通过商品ID和区域ID及cookie插件获取商品快递费用接口,1688快递物流费用接口,1688商品物流费用API接口获取方案的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。