为了进行电商平台 lazada 的API开发,首先我们需要做下面几件事情。
1)开发者注册一个账号
2)然后为每个 lazada 应用注册一个应用程序键(App Key) 。
3)下载 lazada API的SDK并掌握基本的API基础知识和调用
4)利用SDK接口和对象,传入AppKey或者必要的时候获取并传入SessionKey来进行程序开发。
5)利用lazada平台的文档中心和API测试工具,对接口进行测试。从而了解返回信息,方便程序获取。
以上是一般lazada API应用开发的关键流程,其中通过lazada文档中心和API测试工具,进行概念了解和接口信息查询很重要。因为这些数据就是我们需要在逐步显示出来的。lazada 的API很多,不过都分为了好几个领域,慢慢就会了解深入了。
注册链接(获取Key和secret):http://console.open.onebound.cn/console/?i=lucy
响应示例:
"items": {
"url": "https://shopee.com.my/search?keyword=dress",
"keyword": "dress",
"list_page": "1",
"real_total_results": "4269453",
"total_results": 5000,
"pagecount": 100,
"current_lang": "en",
"currency_code": "MYR",
"item": [
{
"title": "COLOUR",
"pic_url": "https://cf.shopee.com.my/file/79ec29aaa306ec1defd6bd555967702d",
"price": 38.9,
"promotion_price": 0,
"price_range": 0,
"num_iid": "277113808/4577557680",
"shop_id": "277113808",
"sales": 293,
"area": "Kelantan",
"detail_url": "https://shopee.com.my/product/277113808/4577557680"
},
{
"title": "Color ",
"pic_url": "https://cf.shopee.com.my/file/bcad44beb00c73a6e4521d6a9d9f5c27",
"price": 48,
"promotion_price": 109,
"price_range": 0,
"num_iid": "54302529/6310239196",
"shop_id": "54302529",
"sales": 439,
"area": "Selangor",
"detail_url": "https://shopee.com.my/product/54302529/6310239196"
},
{
"title": "COLOUR",
"pic_url": "https://cf.shopee.com.my/file/79ec29aaa306ec1defd6bd555967702d",
"price": 38.9,
"promotion_price": 0,
"price_range": 0,
"num_iid": "277113808/4577557680",
"shop_id": "277113808",
"sales": 293,
"area": "Kelantan",
"detail_url": "https://shopee.com.my/product/277113808/4577557680"
},
{
"title": "COLOUR",
"pic_url": "https://cf.shopee.com.my/file/f22290486f37305dbee21e25824894dc",
"price": 18.9,
"promotion_price": 50,
"price_range": 0,
"num_iid": "78566717/2019203919",
"shop_id": "78566717",
"sales": 887,
"area": "Mainland China",
"detail_url": "https://shopee.com.my/product/78566717/2019203919"
},
{
"title": "Color",
"pic_url": "https://cf.shopee.com.my/file/69ddc45fbedfb8eb054c915199cfda99",
"price": 25.26,
"promotion_price": 0,
"price_range": 0,
"num_iid": "240981936/3767955639",
"shop_id": "240981936",
"sales": 22,
"area": "Indonesia",
"detail_url": "https://shopee.com.my/product/240981936/3767955639"
},
{
"title": "Color",
"pic_url": "https://cf.shopee.com.my/file/531b217d8c9c23844a27c43e8dd4f7c0",
"price": 18.9,
"promotion_price": 21,
"price_range": 0,
"num_iid": "390574271/8216725690",
"shop_id": "390574271",
"sales": 0,
"area": "Mainland China",
"detail_url": "https://shopee.com.my/product/390574271/8216725690"
},
{
"title": "option1",
"pic_url": "https://cf.shopee.com.my/file/c7aa7707e693d01279879e2e2f042009",
"price": 32,
"promotion_price": 53.34,
"price_range": 0,
"num_iid": "26973388/5351395820",
"shop_id": "26973388",
"sales": 1271,
"area": "Mainland China",
"detail_url": "https://shopee.com.my/product/26973388/5351395820"
},
{
"title": "Color ",
"pic_url": "https://cf.shopee.com.my/file/bcad44beb00c73a6e4521d6a9d9f5c27",
"price": 48,
"promotion_price": 109,
"price_range": 0,
"num_iid": "54302529/6310239196",
"shop_id": "54302529",
"sales": 439,
"area": "Selangor",
"detail_url": "https://shopee.com.my/product/54302529/6310239196"
},
{
"title": "colour",
"pic_url": "https://cf.shopee.com.my/file/e5bc52ad097fbdfbaaaf2eae3da39880",
"price": 23.9,
"promotion_price": 48,
"price_range": 0,
"num_iid": &