PHP code example of orzcc / taobao-top-client

1. Go to this page and download the library: Download orzcc/taobao-top-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

orzcc / taobao-top-client example snippets


Orzcc\TopClient\TopClientServiceProvider::class,

'TopClient' => Orzcc\TopClient\Facades\TopClient::class,

use TopClient;
use TopClient\request\TbkItemGetRequest;

$topclient = TopClient::connection();
$req = new TbkItemGetRequest;
$req->setFields("num_iid,title,pict_url,reserve_price,zk_final_price,user_type,provcity,item_url");
$req->setQ('phone');
$req->setSort("tk_total_sales");
$req->setPageNo('1');  // Note: Use string values for correct pagination
$req->setPageSize('40');
$resp = $topclient->execute($req);
dd($resp);

if (!class_exists('TopClient')) {
    class_alias('Orzcc\TopClient\Facades\TopClient', 'TopClient');
}
$app->register(Orzcc\TopClient\TopClientServiceProvider::class);

use TopClient;
use TopClient\request\TbkItemGetRequest;

$topclient = TopClient::connection();
$req = new TbkItemGetRequest;
$req->setFields("num_iid,title,pict_url,reserve_price,zk_final_price,user_type,provcity,item_url");
$req->setQ('phone');
$req->setSort("tk_total_sales");
$req->setPageNo('1');  // Note: Use string values for correct pagination
$req->setPageSize('40');
$resp = $topclient->execute($req);
dd($resp);
bash
php artisan vendor:publish --provider="Orzcc\TopClient\TopClientServiceProvider"
bash
cp vendor/orzcc/taobao-top-client/config/taobaotop.php config/taobaotop.php