# 淘宝api接口开源类库 **Repository Path**: xcxopen/TaoBaoapiJieKouKaiYuanLeiKu ## Basic Information - **Project Name**: 淘宝api接口开源类库 - **Description**: 淘宝api各个接口类库文件。 - **Primary Language**: PHP - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 3 - **Created**: 2018-10-05 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 淘宝接口API开发

淘宝接口API开发

访问案例:http://taobao.flc.ren/
源码地址:https://github.com/flc1125/taobao-open-api

本次开发接口如下:

接口名称 官方接口名称
获取前台展示的店铺内卖家自定义商品类目 taobao.sellercats.list.get
获取前台展示的店铺类目 taobao.shopcats.list.get
获取卖家店铺的基本信息 taobao.shop.get
淘宝客商品查询 taobao.tbk.item.get
淘宝客商品详情(简版) taobao.tbk.item.info.get
淘宝客商品关联推荐查询 taobao.tbk.item.recommend.get
淘宝客店铺查询 taobao.tbk.shop.get
淘宝客店铺关联推荐查询 taobao.tbk.shop.recommend.get

访问案例首页主要使用taobao.tbk.item.get

文件及配置说明

实例代码

1.<?php
2./**
3. * 淘宝API接口范例
4. *
5. * @author Flc <2016-03-14 02:14:37>
6. * @link http://flc.ren
7. */

8.namespace Home\Controller;
9.
10.use Think\Controller;
11.use Com\Taobao\Client;
12.use Com\Taobao\Request\TaobaoTbkItemGet; // 淘宝客商品查询
13.use Com\Taobao\Request\TaobaoTbkItemRecommendGet; // 淘宝客商品关联推荐查询
14.use Com\Taobao\Request\TaobaoTbkItemInfoGet; // 淘宝客商品详情(简版)
15.use Com\Taobao\Request\TaobaoTbkShopGet; // 淘宝客店铺查询
16.use Com\Taobao\Request\TaobaoTbkShopRecommendGet; // 淘宝客店铺关联推荐查询
17.use Com\Taobao\Request\TaobaoShopcatsListGet; // 获取前台展示的店铺类目
18.use Com\Taobao\Request\TaobaoSellercatsListGet; // 获取前台展示的店铺内卖家自定义商品类目
19.use Com\Taobao\Request\TaobaoShopGet; // 获取前台展示的店铺内卖家自定义商品类目
20.
21.class IndexController extends Controller {
22.
23. /**
24. * DEMO
25. * @return [type] [description]
26. */

27. public function index()
28.
{
29. $req = (new TaobaoTbkItemGet)
30. ->setFields('num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url,seller_id,volume,nick')
31. ->setQ("女装")
32. ->setCat("16,18")
33. ->setSort("_des");
34. /*$req = (new TaobaoTbkItemRecommendGet)
35. ->setFields('num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url,seller_id,volume,nick')
36. ->setRelateType(1)
37. ->setCount(5)
38. ->setNumIid("6956495372");*/

39. /*$req = (new TaobaoTbkItemInfoGet)
40. ->setFields('num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url,seller_id,volume,nick')
41. ->setNumIids("6956495372");*/

42. /*$req = (new TaobaoTbkShopGet)
43. ->setFields('user_id,shop_title,shop_type,seller_nick,pict_url,shop_url')
44. ->setQ("女装")
45. ->setSort("_des");*/

46. /*$req = (new TaobaoTbkShopRecommendGet)
47. ->setFields('user_id,shop_title,shop_type,seller_nick,pict_url,shop_url')
48. ->setUserId("663336865");*/

49. /*$req = (new TaobaoShopcatsListGet)->setFields('cid,parent_cid,name,is_parent');*/
50. /*$req = (new TaobaoSellercatsListGet)->setNick('jw原单服饰店');*/
51. /*$req = (new TaobaoShopGet)
52. ->setNick('jw原单服饰店')
53. ->setFields('sid,cid,title,nick,desc,bulletin,pic_path,created,modified');*/

54.
55. $rs = (new Client)->execute($req);
56. print_r($rs);
57. }
58.}
59.?>

其他说明