上海門(mén)戶網(wǎng)站制推薦友情鏈接
拼多多根據(jù)關(guān)鍵詞獲取商品接口的意義;
實(shí)現(xiàn)商品搜索:通過(guò)關(guān)鍵詞搜索商品API接口,電商平臺(tái)可以為消費(fèi)者提供一個(gè)簡(jiǎn)單、快捷的商品搜索功能。用戶只需輸入關(guān)鍵詞,就可以得到與該關(guān)鍵詞相關(guān)的商品列表。
提供便捷的商品搜索服務(wù):關(guān)鍵詞搜索商品API接口可以提供給第三方開(kāi)發(fā)者一個(gè)便捷的商品搜索服務(wù)。開(kāi)發(fā)者可以利用該接口,在自己的應(yīng)用程序中實(shí)現(xiàn)商品搜索功能,從而為用戶提供更好的購(gòu)物體驗(yàn)。
進(jìn)行數(shù)據(jù)分析:關(guān)鍵詞搜索商品API接口可以提供給電商平臺(tái)一些有用的數(shù)據(jù)分析。例如,通過(guò)分析用戶搜索的關(guān)鍵詞,電商平臺(tái)可以了解用戶的購(gòu)物偏好和需求,從而改進(jìn)自己的商品推薦系統(tǒng)。
提供精準(zhǔn)定位服務(wù):關(guān)鍵詞搜索商品API接口可以幫助廣告主實(shí)現(xiàn)精準(zhǔn)定位服務(wù)。廣告主可以利用該接口,根據(jù)用戶搜索的關(guān)鍵詞向其推送相關(guān)的廣告,從而提高廣告效果。
進(jìn)行競(jìng)價(jià)排名:關(guān)鍵詞搜索商品API接口可以實(shí)現(xiàn)競(jìng)價(jià)排名功能。電商平臺(tái)可以根據(jù)商家的競(jìng)價(jià),將搜索結(jié)果按照價(jià)格、銷量等因素進(jìn)行排序,從而提高用戶的購(gòu)物體驗(yàn)。
公共參數(shù)
請(qǐng)求地址: 注冊(cè)請(qǐng)求key
名稱 | 類型 | 必須 | 描述 |
---|---|---|---|
key | String | 是 | 調(diào)用key(必須以GET方式拼接在URL中) |
secret | String | 是 | 調(diào)用密鑰 |
api_name | String | 是 | API接口名稱(包括在請(qǐng)求地址中)[item_search,item_get,item_search_shop等] |
cache | String | 否 | [yes,no]默認(rèn)yes,將調(diào)用緩存的數(shù)據(jù),速度比較快 |
result_type | String | 否 | [json,jsonu,xml,serialize,var_export]返回?cái)?shù)據(jù)格式,默認(rèn)為json,jsonu輸出的內(nèi)容中文可以直接閱讀 |
lang | String | 否 | [cn,en,ru]翻譯語(yǔ)言,默認(rèn)cn簡(jiǎn)體中文 |
version | String | 否 | API版本 |
請(qǐng)求參數(shù)
請(qǐng)求參數(shù):q=女裝&start_price=0&end_price=0&page=1&cat=0&discount_only=&sort=&page_size=
參數(shù)說(shuō)明:q:關(guān)鍵詞, sort:排序[bid,_bid,_sale,sale] (bid:商品價(jià)格,sale:銷量,加_前綴為從大到小排序)
響應(yīng)參數(shù)
Version: Date:
名稱 | 類型 | 必須 | 示例值 | 描述 |
---|---|---|---|---|
items | items[] | 0 | 根據(jù)關(guān)鍵詞取商品列表 | |
title | String | 0 | 啄木鳥(niǎo)雙面穿棉衣女2020冬裝加厚寬松韓版棉襖小個(gè)子羽絨棉外套冬 | 商品標(biāo)題 |
pic_url | String | 0 | https://t00img.yangkeduo.com/goods/images/2020-12-08/1226cd586487b63527d86fdabb8608cc.jpeg | 寶貝圖片 |
price | Float | 0 | 198 | 價(jià)格 |
promotion_price | Float | 0 | 198 | 優(yōu)惠價(jià)格 |
sales | Int | 0 | 14830 | 銷量 |
num_iid | Bigint | 0 | 203344831134 | 寶貝ID |
sample_id | String | 0 | 商品風(fēng)格標(biāo)識(shí)ID | |
seller_nick | String | 0 | 時(shí)沫女裝專營(yíng)店 | 掌柜昵稱 |
post_fee | Float | 0 | 物流費(fèi)用 | |
area | String | 0 | 店鋪所在地 | |
detail_url | String | 0 | http://yangkeduo.com/goods.html?goods_id=203344831134 | 寶貝鏈接 |
請(qǐng)求示例
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://pinduoduo/item_search/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&q=女裝&start_price=0&end_price=0&page=1&cat=0&discount_only=&sort=&page_size=";JSONObject json = getRequestFromUrl(url);System.out.println(json.toString());}}
?響應(yīng)示例
{"items": {"keyword": "女裝","page": "1","real_total_results": 300,"total_results": 300,"list_count": 20,"item": [{"title": "【三件套】新款秋冬季女裝套裝裙皮草短外套搭打底衫毛衣配半身裙","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-06-05/b15035efb5913e1e8b647422010522c1.jpeg","price": 134,"promotion_price": 134,"sales": 18000,"num_iid": 43992967514,"sample_id": "","seller_nick": "果果家氣質(zhì)女裝","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=43992967514"},{"title": "【2件套】套裝秋冬新款仿獺兔毛釘珠皮草毛毛短外套加厚大衣女裝","pic_url": "https://omsproductionimg.yangkeduo.com/images/2018-06-06/463c0e2a5580ba3266846e41fe3e444a.jpeg","price": 169,"promotion_price": 169,"sales": 40000,"num_iid": 1620002566,"sample_id": "","seller_nick": "果果家氣質(zhì)女裝","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=1620002566"},{"title": "仿水貂毛皮草外套女冬短款韓版修身顯瘦百搭毛絨加厚新娘披肩禮服","pic_url": "https://omsproductionimg.yangkeduo.com/images/2018-01-03/1f3866498a067e00e39a38fe144ec5f3.jpeg","price": 88,"promotion_price": 88,"sales": 218,"num_iid": 410684172,"sample_id": "","seller_nick": "樂(lè)榮源淘衣坊","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=410684172"},{"title": "仿貂毛大衣女秋冬加厚仿狐貍毛領(lǐng)皮草外套女長(zhǎng)款仿水貂絨外套顯瘦","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-06-28/f6ea981d0cfe5dc096af33457328c819.jpeg","price": 298,"promotion_price": 298,"sales": 42000,"num_iid": 144592781204,"sample_id": "","seller_nick": "珞摩服裝旗艦店","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=144592781204"},{"title": "三件套裙套裝新款秋冬女韓版釘珠皮草短外套搭打底衫毛衣配半身裙","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-09-24/1fd6806d8de95adce0196294765079f1.jpeg","price": 269,"promotion_price": 269,"sales": 2525,"num_iid": 2748395485,"sample_id": "","seller_nick": "蹦蹦服飾","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=2748395485"},{"title": "三件套2020新款秋冬季皮草裙套裝女短外套搭打底衫毛衣配半身裙子","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-10-22/97440d8034ad1a319e71cd501aa6d9bc.jpeg","price": 239,"promotion_price": 239,"sales": 119,"num_iid": 4544773413,"sample_id": "","seller_nick": "自然之美服飾","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=4544773413"},{"title": "三件套裙套裝2020新款秋冬季皮草女短外套搭打底衫毛衣配半身裙子","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-10-23/0e5aa1adb63ce256664d4274d0ff0fa1.jpeg","price": 188,"promotion_price": 188,"sales": 1587,"num_iid": 3540607180,"sample_id": "","seller_nick": "自然之美服飾","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=3540607180"},{"title": "2020秋冬裝毛毛釘珠仿皮草外套新款韓版修身圓領(lǐng)學(xué)生上衣【單件】","pic_url": "https://t00img.yangkeduo.com/goods/images/2021-01-28/503c10fe716873ceaccf103c30881908.jpeg","price": 79,"promotion_price": 79,"sales": 1157,"num_iid": 35225305026,"sample_id": "","seller_nick": "夏衣伊人","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=35225305026"},{"title": "兩件套秋冬新款氣質(zhì)釘珠仿皮草外套配刺繡半身裙保暖加厚上衣女裝","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-09-17/5d57e2f0df37b13f5472d03175246d28.jpeg","price": 139,"promotion_price": 139,"sales": 2616,"num_iid": 369492636,"sample_id": "","seller_nick": "蹦蹦服飾","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=369492636"},{"title": "2020秋冬裝毛毛釘珠仿皮草外套新款韓版修身圓領(lǐng)淑女上衣【單件】","pic_url": "https://t00img.yangkeduo.com/goods/images/2021-01-28/b208cc827f66c0b5eac9d40762178d28.jpeg","price": 88,"promotion_price": 88,"sales": 232,"num_iid": 3540686169,"sample_id": "","seller_nick": "自然之美服飾","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=3540686169"},{"title": "2018秋冬裝毛毛釘珠仿皮草外套新款韓版修身圓領(lǐng)學(xué)生上衣【單件】","pic_url": "https://t00img.yangkeduo.com/goods/images/2018-09-24/22c7a21f49c4ddfe228acc5d15c1bbe0.jpeg","price": 138,"promotion_price": 138,"sales": 210,"num_iid": 3062555797,"sample_id": "","seller_nick": "果果家氣質(zhì)女裝","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=3062555797"},{"title": "三件套網(wǎng)紅裙套裝新款秋冬女釘珠皮草搭打底衫毛衣配半身裙短外套","pic_url": "https://t00img.yangkeduo.com/goods/images/images/2019-09-10/403fae6f0c281b247e305559cff71cca.jpeg","price": 269,"promotion_price": 269,"sales": 144,"num_iid": 35224334938,"sample_id": "","seller_nick": "夏衣伊人","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=35224334938"},{"title": "單件外套短款女秋冬新品海寧仿皮草韓版寬松顯瘦百搭釘珠圓領(lǐng)上衣","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-09-24/55a25e3b612a5ba2655046718a20c0ab.jpeg","price": 88,"promotion_price": 88,"sales": 2314,"num_iid": 368488818,"sample_id": "","seller_nick": "蹦蹦服飾","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=368488818"},{"title": "粗花呢套裝女2020秋冬新款小香風(fēng)時(shí)尚洋氣小西裝包臀裙休身顯瘦潮","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-07-16/84ffe1375b1d3b1a6455b9c387cd495b.jpeg","price": 139,"promotion_price": 139,"sales": 216,"num_iid": 150435444702,"sample_id": "","seller_nick": "小清新職裝","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=150435444702"},{"title": "啄木鳥(niǎo)加厚羽絨棉衣女冬季新款胖mm寬松顯瘦棉服外套女士大碼棉襖","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-11-24/a8798a380a8e64503a3b6f2df3cdc5e6.jpeg","price": 148,"promotion_price": 148,"sales": 2866,"num_iid": 203004819547,"sample_id": "","seller_nick": "啄木鳥(niǎo)清晚田專賣店","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=203004819547"},{"title": "小香風(fēng)套裝裙女秋冬兩件套裙子時(shí)尚氣質(zhì)貴夫人高檔顯瘦小西服上衣","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-09-20/11b73b78660ce240318981f36fedb20b.jpeg","price": 106.8,"promotion_price": 106.8,"sales": 3585,"num_iid": 179099550022,"sample_id": "","seller_nick": "蝶之語(yǔ)服飾","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=179099550022"},{"title": "粉色小西裝春季新款名媛小香風(fēng)套裝裙兩件套韓版時(shí)尚百搭收腰顯瘦","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-03-17/2c08521a36bae37e004a5cfe15fcddb1.jpeg","price": 119,"promotion_price": 119,"sales": 136,"num_iid": 94383041769,"sample_id": "","seller_nick": "小清新職裝","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=94383041769"},{"title": "小清新刺繡兩件套套裝裙兔毛領(lǐng)拼接短外套毛呢連衣裙秋冬甜美新款","pic_url": "https://t00img.yangkeduo.com/goods/images/2019-10-07/6f734d1717a3339a74cff707d9ec82c0.jpeg","price": 688,"promotion_price": 688,"sales": 3602,"num_iid": 50964999845,"sample_id": "","seller_nick": "木木時(shí)尚服飾","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=50964999845"},{"title": "毛呢兩件套裝裙子女2021春秋季新款中長(zhǎng)連衣裙修身媽媽裝短款外套","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-03-12/d9b47beb0f7306f132216c910640f830.jpeg","price": 89.8,"promotion_price": 89.8,"sales": 32000,"num_iid": 2713732007,"sample_id": "","seller_nick": "露雪顏旗艦店","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=2713732007"},{"title": "白鴨絨2020冬季新款網(wǎng)紅蘇蘇羽絨服女中長(zhǎng)款大毛領(lǐng)收腰加厚外套潮","pic_url": "https://t00img.yangkeduo.com/goods/images/2020-12-13/735fb9bd599594a424f3f22957aafd06.jpeg","price": 299,"promotion_price": 299,"sales": 3292,"num_iid": 45642569064,"sample_id": "","seller_nick": "晗晗羽絨廠家店","post_fee": "","area": "","detail_url": "http://yangkeduo.com/goods.html?goods_id=45642569064"}]},"error_code": "0000","reason": "ok","secache": "a8881ed5637e3c7e84f03acdc86be64f","secache_time": 1615362351,"secache_date": "2021-03-10 15:45:51","translate_status": "","translate_time": 0,"language": {"default_lang": "cn","current_lang": "cn"},"error": "","cache": 0,"api_info": "today:30 max:10000","execution_time": 0.649,"server_time": "Beijing/2021-03-10 15:45:51","client_ip": "106.6.35.144","call_args": {"q": "女裝","start_price": "0","end_price": "0","page": "1","cat": "0"},"api_type": "pinduoduo","translate_language": "zh-CN","translate_engine": "baidu","server_memory": "2.92MB","request_id": "gw-1.6048792eb5a86"
}