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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

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

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

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

四、請求示例:(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://點擊注冊獲取/1688/item_fee/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=591734471276&area_id=2274&cookie=";JSONObject json = getRequestFromUrl(url);System.out.println(json.toString());}}

響應示例:

{"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調用示例
APISDK下載
API測試工具

如何開通API測試,點擊立即開通

總結

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

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。