电商智能化搜索是电商平台提升用户体验和转化率的关键功能之一。基于Lazada的关键字搜索API返回值,电商平台可以实现智能化搜索功能,为用户提供更精准、个性化的搜索结果。以下是如何基于Lazada关键字搜索API返回值进行解析和实现智能化搜索的步骤:
1. 理解API返回值
首先,需要仔细阅读Lazada关键字搜索API的文档,了解API的调用方式、请求参数和返回值的结构。通常,搜索API的返回值会包含搜索结果的列表,每个搜索结果可能包含商品的标题、描述、图片URL、价格、评分等信息。
2. 解析API返回值
使用编程语言(如Python、Java等)编写代码来调用Lazada的关键字搜索API,并解析返回的JSON或XML数据。解析过程通常包括以下几个步骤:
- 发起HTTP请求,传递关键字和其他必要的请求参数到Lazada的搜索API。
- 接收API返回的响应数据,通常是一个JSON或XML字符串。
- 使用JSON或XML解析库将响应数据转换为编程语言可以处理的数据结构(如字典、对象等)。
- 遍历解析后的数据结构,提取出搜索结果的相关信息。
lazada.item_search
公共参数
请求地址: https://api-gw.onebound.cn/lazada/item_search
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
key | String | 是 | 调用key(必须以GET方式拼接在URL中) |
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版本 |
请求参数
请求参数:q=shoe&start_price=&end_price=&page=1&page_size=40&nation=co.th
参数说明:q:搜索关键字(英文)
nation:国家
国家域名后缀可选值如下:co.id、com.my、com.ph、sg、co.th、vn
page:页数
响应参数
Version: Date:
名称 | 类型 | 必须 | 示例值 | 描述 |
---|---|---|---|---|
title | String | 0 | CLUB SODA LADIES FASHION CASUAL WEAR TOPS 100% COTTON TEE SHIRTS | 商品标题 |
pic_url | String | 0 | https://my-test-11.slatic.net/p/2b84c98152b4a72c8f5a07150ba9344e.jpg | 商品图片 |
promotion_price | Float | 0 | 9.90 | 参考价 |
price | Float | 0 | 9.90 | 价格 |
originalPrice | Float | 0 | 39.90 | 原价 |
sales | Int | 0 | 1 | 销量 |
num_iid | String | 0 | 467636535 | 商品ID |
seller_nick | String | 0 | Y&Y SDN BHD | 卖家昵称 |
post_fee | String | 0 | 邮费 | |
area | String | 0 | 店铺所在地 | |
detail_url | String | 0 | //www.lazada.com.my/products/club-soda-ladies-fashion-casual-wear-tops-100-cotton-tee-shirts-i467636535-s756830444.html?search=1 | 商品链接 |
响应数据示例
"items": {
"total_results": "4080",
"real_total_results": "4080",
"page": "1",
"page_size": 40,
"language": "th",
"_ddf": "ken",
"currency_code": "THB",
"item": [
{
"title": "รองเท้าแตะ สวมใส่ได้ทั้งในและนอกบ้าน กันลื่น กันน้ำ รองเท้าแตะลำลอง รองเท้าแตะผู้หญิง รองเท้าแตะผู้ชาย รองเท้าใส่สบาย",
"pic_url": "https://th-live.slatic.net/p/ec71d13ce2cf0f7fa75d290badb05bbb.jpg",
"promotion_price": "49",
"price": "49",
"originalPrice": "79",
"sales": "3473",
"num_iid": "5088698379",
"seller_nick": "WA.NG",
"post_fee": "",
"area": "Overseas",
"detail_url": "//www.lazada.co.th/products/-i5088698379.html"
},
{
"title": "luck-รองเท้าแฟชั่นผู้หญิง นุ่มนิ่ม สวยเก๋มาก เบาสบาย ใส่แล้วเหมือนไม่ได้ใส่ รองเท้าลำลอง รองเท้าใส่ในบ้าน",
"pic_url": "https://sg-test-11.slatic.net/p/6f3dfeb6178e950fa77bdba44f4ccb1a.jpg",
"promotion_price": "23",
"price": "23",
"originalPrice": "59",
"sales": "206",
"num_iid": "4825144718",
"seller_nick": "Bannshoes",
"post_fee": "",
"area": "Bangkok",
"detail_url": "//www.lazada.co.th/products/luck-i4825144718.html"
},
{
"title": "luck-รองเท้าแฟชั่นผู้หญิง นุ่มนิ่ม สวยเก๋มาก เบาสบาย ใส่แล้วเหมือนไม่ได้ใส่ รองเท้าลำลอง รองเท้าใส่ในบ้าน ในห้องน้ำ ครัว",
"pic_url": "https://th-live.slatic.net/p/19b5a522a277a6e09a0787384d899fea.jpg",
"promotion_price": "25",
"price": "25",
"originalPrice": "59",
"sales": "544",
"num_iid": "4831021193",
"seller_nick": "Pony_ShoesHL",
"post_fee": "",
"area": "Bangkok",
"detail_url": "//www.lazada.co.th/products/luck-i4831021193.html"
},
{
"title": "Tsion [best selling] BMW3 stovepipe sneakers sport customize matches matches ด้าง side sneakers fashion color soles have htc2 color🖤🤍Homely shape fashion shoes good looking dress to all Luke😎",
"pic_url": "https://th-live-01.slatic.net/p/62f475d189dcee345e3daf16e570b365.jpg",
"promotion_price": "107.49",
"price": "107.49",
"originalPrice": "400",
"sales": "3437",
"num_iid": "4409910200",
"seller_nick": "Tsion",
"post_fee": "",
"area": "Nakhon Pathom",
"detail_url": "//www.lazada.co.th/products/tsion-3-2-i4409910200.html"
},
{
"title": "Lhsunday hot sale🥬Men's fashion sneakers slip-on comfortable slip-on slip-on slip-on slip-on slip-on shoes European design ready to pass your coolness for men today order🍑",
"pic_url": "https://th-live.slatic.net/p/cfc34be9513d9ed7d98cd3333e3a0e67.jpg",
"promotion_price": "91",
"price": "91",
"originalPrice": "296",
"sales": "3649",
"num_iid": "4640813788",
"seller_nick": "LH.Sunday",
"post_fee": "",
"area": "Nakhon Pathom",
"detail_url": "//www.lazada.co.th/products/lhsunday-i4640813788.html"
},
{
"title": "Casual mesh men sneakers man sports shoes",
"pic_url": "https://th-live-01.slatic.net/p/b91303f8da11733c83d5a2565f66fc24.jpg",
"promotion_price": "100.35",
"price": "100.35",
"originalPrice": "399",
"sales": "1558",
"num_iid": "4598740608",
"seller_nick": "รองเท้าเอ็ด",
"post_fee": "",
"area": "Samut Prakan",
"detail_url": "//www.lazada.co.th/products/-i4598740608.html"
},
{
"title": "รองเท้าสปอร์ตผู้ชายมาใหม่💞 รองเท้าแตะ พื้นนิ่มไม่เจ็บเท้า (TX 23)",
"pic_url": "https://th-live-01.slatic.net/p/9755d6828bc68d6a02e4d5ac4b7cae6f.png",
"promotion_price": "50",
"price": "50",
"originalPrice": "119",
"sales": "2260",
"num_iid": "4872750019",
"seller_nick": "CBD SHOP",
"post_fee": "",
"area": "Bangkok",
"detail_url": "//www.lazada.co.th/products/tx-23-i4872750019.html"
},
{
"title": "รองเท้าผ้าใบผู้หญิงและผู้ชาย มีของพร้อมส่งสินค้าเหมือนในภาพ",
"pic_url": "https://filebroker-cdn.lazada.co.th/kf/Sf967ffb8b5e54b2cae2315cb426efe4bX.jpg",
"promotion_price": "235",
"price": "235",
"originalPrice": "755",
"sales": "139",
"num_iid": "5008866415",
"seller_nick": "Shoe Shop 9999",
"post_fee": "",
"area": "Sa Kaeo",
"detail_url": "//www.lazada.co.th/products/-i5008866415.html"
},
{
"title": "Lhmoonlight👍🏻Comfortable fashion cool screen kick Shoes sandals🎃2 colors flip flops suitable for all ages😍",
"pic_url": "https://th-live.slatic.net/p/e8efcea52634825c2b1fac0c874041ee.jpg",
"promotion_price": "65",
"price": "65",
"originalPrice": "277",
"sales": "20",
"num_iid": "4584195463",
"seller_nick": "LH.Moonlight",
"post_fee": "",
"area": "Nakhon Pathom",
"detail_url": "//www.lazada.co.th/products/lhmoonlight-2-i4584195463.html"
},
{
"title": "รองเท้าผู้ชายใส่สบาย พื้นนุ่ม มีกันลื่นอย่างดี รหัส544",
"pic_url": "https://th-live.slatic.net/p/34aad5d13d4425ce186cb710ba4c4abb.jpg",
"promotion_price": "54",
"price": "54",
"originalPrice": "139",
"sales": "352",
"num_iid": "5017529798",
"seller_nick": "Delicions food mall",
"post_fee": "",
"area": "Bangkok",
"detail_url": "//www.lazada.co.th/products/544-i5017529798.html"
},
{
"title": "รองเท้าผ้าใบสตรีพื้นหนา เพิ่มความสูง กระชับสัดส่วน กันลื่น ทนต่อการสึกหรอ รองเท้าผู้หญิงอินเทรนด์ทุกแมตช",
"pic_url": "https://th-live-01.slatic.net/p/98341bad542aa1af25b0abf5800973e1.jpg",
"promotion_price": "143.23",
"price": "143.23",
"originalPrice": "538",
"sales": "806",
"num_iid": "4326131781",
"seller_nick": "WNfiLKPM",
"post_fee": "",
"area": "Pathum Thani",
"detail_url": "//www.lazada.co.th/products/-i4326131781.html"
},
{
"title": "รองเท้าผู้หญิง รองเท้าแตะหูคีบรองเท้าแตะผู้หญิง รองเท้าแตะรองเท้าแฟชั่นผู้หญิงรองเท้าแตะผู้หญิงแฟชั่นสไตล์แบรนด์ดัง",
"pic_url": "https://th-live.slatic.net/p/8f5c5ad3a32e876b55f6dbc5d1b7fc0e.jpg",
"promotion_price": "29",
"price": "29",
"originalPrice": "100",
"sales": "434",
"num_iid": "2777247940",
"seller_nick": "shoebest-shop",
"post_fee": "",
"area": "Bangkok",
"detail_url": "//www.lazada.co.th/products/-i2777247940.html"
},
{
"title": "[Super fast delivery!] casual women shoes sneakers women casual sport denim low heel 2007",
"pic_url": "https://th-live.slatic.net/p/88def108916a2c49344127fe9b2cf230.jpg",
"promotion_price": "59",
"price": "59",
"originalPrice": "99",
"sales": "206",
"num_iid": "1893510447",
"seller_nick": "ktk418shop",
"post_fee": "",
"area": "Bangkok",
"detail_url": "//www.lazada.co.th/products/casual-women-shoes-2007-i1893510447.html"
},
{
"title": "🔥ถูก•แท้•ส่งไว💯Mashare/Leo รองเท้าทรงBuddy รองเท้า บัดดี้ รุ่นM101/109 ไซส์35-43 มีของพร้อมส่ง",
"pic_url": "https://th-live.slatic.net/p/3527a7c940b80b5cf1ca1cf9b81a15d6.jpg",
"promotion_price": "99",
"price": "99",
"originalPrice": "199",
"sales": "3257",
"num_iid": "2181588724",
"seller_nick": "Shoesland.",
"post_fee": "",
"area": "Bangkok",
"detail_url": "//www.lazada.co.th/products/mashareleo-buddy-m101109-35-43-i2181588724.html"
},
{
"title": "(5 ซม.) รองเท้าผู้หญิงแพลตฟอร์ม ทันสมัยและน้ำหนักเบา กันลื่นและทนต่อการสึกหรอ รองเท้ากีฬาสีขาวของผู้หญิงอเนกประสงค์",
"pic_url": "https://th-live.slatic.net/p/217b2d80a6c6e20ebe05a538b9bb6228.jpg",
"promotion_price": "199",
"price": "199",
"originalPrice": "478",
"sales": "335",
"num_iid": "4742238482",
"seller_nick": "WNfiLKPM",
"post_fee": "",
"area": "Pathum Thani",
"detail_url": "//www.lazada.co.th/products/5-i4742238482.html"
},
{
"title": "พร้อมส่ง🚚รองเท้าผ้าใบผู้หญิง sneaker พื้นหนา5ซม. เสริมสูง ลายอุ้งเท้าแมว น่ารักแฟชั่น กีฬาลำลอง ยืดหยุ่นB-P1",
"pic_url": "https://sg-test-11.slatic.net/p/3bc9dd9b7410e5f6027bb49f26d4275c.jpg",
"promotion_price": "59",
"price": "59",
"originalPrice": "249",
"sales": "3211",
"num_iid": "4898403794",
"seller_nick": "go fashion",
"post_fee": "",
"area": "Samut Prakan",
"detail_url": "//www.lazada.co.th/products/sneaker-5-b-p1-i4898403794.html"
},
{
"title": "New arrivals hot LHshoess ดีเทล sneakers women breathable hole well have. choose BMW3 color beautiful🎁Casual shoes slip-on wear convenient all activity with TF super cute colorl🎊",
"pic_url": "https://th-live.slatic.net/p/b9199525f674b24a02fd9c783b26d702.jpg",
"promotion_price": "88",
"price": "88",
"originalPrice": "299",
"sales": "34",
"num_iid": "4320010141",
"seller_nick": "LH.Shoess",
"post_fee": "",
"area": "Nakhon Pathom",
"detail_url": "//www.lazada.co.th/products/lhshoess-3-i4320010141.html"
},
{
"title": "888-c1a pointed toe Pu flat shoes",
"pic_url": "https://th-live.slatic.net/p/2a6422607a7a090a82304ac7aa0dd2fd.jpg",
"promotion_price": "129",
"price": "129",
"originalPrice": "249",
"sales": "444",
"num_iid": "4569141437",
"seller_nick": "Finesery",
"post_fee": "",
"area": "Samut Prakan",
"detail_url": "//www.lazada.co.th/products/888-c1a-pu-i4569141437.html"
},
{
"title": "KAIDEWEMAK ส่งเร็ว🚚🚚🚚 รองเท้าผ้าใบลำลองผู้ชายสไตล์คลาสสิก",
"pic_url": "https://th-live.slatic.net/p/17d0b00668680abba9910c2137e1330a.jpg",
"promotion_price": "65",
"price": "65",
"originalPrice": "189",
"sales": "1018",
"num_iid": "2791161722",
"seller_nick": "KAIDEWEMAK",
"post_fee": "",
"area": "Bangkok",
"detail_url": "//www.lazada.co.th/products/kaidewemak-i2791161722.html"
},
{
"title": "รองเท้าผ้าใบแฟชั่นสีดำ ทรงสลิปออน รองเท้าผ้าใบผู้หญิง รองเท้าลำลอง รองเท้าผ้าใบ M Fashion",
"pic_url": "https://th-live-01.slatic.net/p/be195e55a99f9dbab8d733095c9a2bf6.jpg",
"promotion_price": "50",
"price": "50",
"originalPrice": "89",
"sales": "348",
"num_iid": "3388564441",
"seller_nick": "I FASHION SHOE",
"post_fee": "",
"area": "Samut Prakan",
"detail_url": "//www.lazada.co.th/products/m-fashion-i3388564441.html"
},
{
"title": "รองเท้าแตะ รองเท้าแตะผู้ชาย รองเท้าผู้หญิง รองเท้าแตะกันลื่น รองเท้าฤดูร้อน",
"pic_url": "https://th-live-01.slatic.net/p/5e84974da883ce290d1092c0a52d0c6f.jpg",
"promotion_price": "67.67",
"price": "67.67",
"originalPrice": "199",
"sales": "419",
"num_iid": "4718898189",
"seller_nick": "MY.Q",
"post_fee": "",
"area": "Bangkok",
"detail_url": "//www.lazada.co.th/products/-i4718898189.html"
},
{
"title": "[ส่งเร็วพิเศษ!] Southeast ส่งเร็ว🚚🚚🚚 รองเท้าแตะรองเท้าแตะผู้หญิงหมีหมีสีลูกกวาด",
"pic_url": "https://th-live.slatic.net/p/e2d5d7f8252640f5de6226da3b63453b.jpg",
"promotion_price": "55",
"price": "55",
"originalPrice": "155",
"sales": "983",
"num_iid": "2810715012",
"seller_nick": "Southeast Stores",
"post_fee": "",
"area": "Bangkok",
"detail_url": "//www.lazada.co.th/products/southeast-i2810715012.html"
},
{
"title": "Lkshoes New, women's fashion sneakers, simple design, can wear for many occasions, fabric material is not thick, comfortable, not uncomfortable. There are three colors to choose from.",
"pic_url": "https://th-live-01.slatic.net/p/178e35b3854e3a87305a7b955638d3ad.jpg",
"promotion_price": "129",
"price": "129",
"originalPrice": "241",
"sales": "176",
"num_iid": "4876876809",
"seller_nick": "LKShoes",
"post_fee": "",
"area": "Nakhon Pathom",
"detail_url": "//www.lazada.co.th/products/lkshoes-i4876876809.html"
},
{
"title": "รองเท้าผ้าใบ มี11สี ให้เลือก ใส่ได้ทั้งผู้หญิงและผู้ชาย36-45 สินค้าพร้อมส่งค่ะ ทางร้านแนะนำให้เผื่อ1ไซร้ค่ะลูกค้า",
"pic_url": "https://filebroker-cdn.lazada.co.th/kf/Saff7fb897de745278e561be852514acfA.jpg",
"promotion_price": "289",
"price": "289",
"originalPrice": "399",
"sales": "21",
"num_iid": "4891305575",
"seller_nick": "SHOES 4U",
"post_fee": "",
"area": "Nakhon Nayok",
"detail_url": "//www.lazada.co.th/products/11-36-45-1-i4891305575.html"
},
{
"title": "BBPShop ☄️รองเท้าแตะแฟชั่น เอาใจคนสายสปอร์ตสุดๆ🏍 ลายพรางกับฟรอน์ภาษาอักฤษมาเต็ม สีสันสดจิ๊ดจ๊าด มีเอกลักษณ์เฉพาะตัวสุดๆ 😎👍",
"pic_url": "https://th-live.slatic.net/p/8b486768d356796899b8330bfda0ddea.jpg",
"promotion_price": "128",
"price": "128",
"originalPrice": "328",
"sales": "2349",
"num_iid": "3994302557",
"seller_nick": "BBPShop.",
"post_fee": "",
"area": "Nakhon Pathom",
"detail_url": "//www.lazada.co.th/products/bbpshop-i3994302557.html"
},
{
"title": "LKShoes รองเท้าแฟชั่น 🥾 ผ้าใบสุดเท่ เก๋กู้ดดด👑 สวมใส่ได้ทุกเพศ ทุกวัย🕶 ราคาสบายกระเป๋า💼 คุณภาพดีเยี่ยม",
"pic_url": "https://th-live-01.slatic.net/p/a85aff3fa858e9937dc4279028d2a2ff.jpg",
"promotion_price": "76",
"price": "76",
"originalPrice": "249",
"sales": "568",
"num_iid": "4124812264",
"seller_nick": "LKShoes",
"post_fee": "",
"area": "Nakhon Pathom",
"detail_url": "//www.lazada.co.th/products/lkshoes-i4124812264.html"
},
{
"title": "ใหม่ รองเท้ากีฬาลำลองผู้หญิงทุกคู่สไตล์เกาหลี พื้นรองเท้าทนทานต่อการสึกหรอ มีสไตล์และระบายอากาศได้ดี",
"pic_url": "https://th-live-01.slatic.net/p/470abeb644c815c4cacc858570942cdc.jpg",
"promotion_price": "189",
"price": "189",
"originalPrice": "389",
"sales": "69",
"num_iid": "5051875432",
"seller_nick": "WNfiLKPM",
"post_fee": "",
"area": "Pathum Thani",
"detail_url": "//www.lazada.co.th/products/-i5051875432.html"
},
{
"title": "Wulove รองเท้าผ้าใบรุ่นใหม่สุดเท่👟สุดคลาสสิค สำหรับ ผู้หญิง ผู้ชาย❣️คุณภาพดี ราคาเบาๆ บอดี้สวยงามคุ้มราคา",
"pic_url": "https://th-live.slatic.net/p/a85aff3fa858e9937dc4279028d2a2ff.jpg",
"promotion_price": "76",
"price": "76",
"originalPrice": "285",
"sales": "848",
"num_iid": "4128183436",
"seller_nick": "Wulove",
"post_fee": "",
"area": "Nakhon Pathom",
3. 数据清洗和预处理
从API返回值中提取的数据可能需要进行清洗和预处理,以提高后续智能化搜索的准确性和效率。数据清洗和预处理可能包括:
- 去除重复或无效的搜索结果。
- 对商品标题、描述等文本信息进行分词、去停用词、词干提取等自然语言处理操作。
- 将价格、评分等数值信息转换为统一的格式或范围。
4. 智能化搜索算法
在获取并处理完搜索数据后,可以运用各种智能化搜索算法来提高搜索结果的准确性和个性化程度。常见的智能化搜索算法包括:
- 基于关键词匹配的搜索算法:根据用户输入的关键词与商品标题、描述等信息的匹配程度进行排序。
- 基于用户行为的搜索算法:通过分析用户的历史搜索记录、购买记录等信息,为用户提供更符合其兴趣和需求的搜索结果。
- 基于机器学习的搜索算法:使用机器学习模型(如深度学习模型)对搜索数据进行训练,学习用户搜索意图和商品之间的关联关系,从而提供更精准的搜索结果。
5. 搜索结果展示
最后,将经过智能化搜索算法处理后的搜索结果展示给用户。展示方式可以根据具体需求和平台特点进行设计,如按照相关性、评分、价格等因素进行排序,或提供多种排序和筛选条件供用户选择。
6. 持续优化和迭代
智能化搜索是一个持续优化的过程。电商平台需要不断收集用户反馈和数据,分析搜索效果和用户行为,对搜索算法和策略进行调整和优化,以不断提升搜索体验和转化率。