PHPackages                             cloudycity/kuaishou-marketing-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. cloudycity/kuaishou-marketing-sdk

ActiveLibrary[API Development](/categories/api)

cloudycity/kuaishou-marketing-sdk
=================================

Kuaishou MarketingAPI SDK

v0.1.6(4y ago)14313↓100%9MITPHPPHP &gt;=5.6

Since Nov 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/CloudyCity/kuaishou-marketing-sdk)[ Packagist](https://packagist.org/packages/cloudycity/kuaishou-marketing-sdk)[ RSS](/packages/cloudycity-kuaishou-marketing-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (9)Used By (0)

Kuaishou Marketing Sdk
======================

[](#kuaishou-marketing-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bcba3e4504a590abbd2bcd6bb19ab0e11c5abb81310665fd69ec450f1e3f7487/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c6f756479636974792f6b75616973686f752d6d61726b6574696e672d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cloudycity/kuaishou-marketing-sdk)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/8bca06a0eabadc285e1a9e20e275eb29e1f633a3834a7d411543792cc9bba739/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636c6f756479636974792f6b75616973686f752d6d61726b6574696e672d73646b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/cloudycity/kuaishou-marketing-sdk)[![StyleCI](https://camo.githubusercontent.com/1fbe3d8d2d84330401d199178c91e025cdd597f22dfd8d609b526be340182222/68747470733a2f2f7374796c6563692e696f2f7265706f732f3232323335373835392f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/222357859)[![Quality Score](https://camo.githubusercontent.com/080e4beb1081d5b05032739383eb0a266b420895631b8f3de11ea64885b9a5cd/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f636c6f756479636974792f6b75616973686f752d6d61726b6574696e672d73646b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/cloudycity/kuaishou-marketing-sdk)[![Total Downloads](https://camo.githubusercontent.com/e4d229aab04e391445c5171b975b653c3056f742358f3ec5538001c3c1cc21f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c6f756479636974792f6b75616973686f752d6d61726b6574696e672d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/cloudycity/kuaishou-marketing-sdk)[![standard-readme compliant](https://camo.githubusercontent.com/4d148b38f9c13f71b15b80f0bd583698fd5a5ab9bd7dfe61d40e1e30aec35399/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f726561646d652532307374796c652d7374616e646172642d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/RichardLitt/standard-readme)[![All Contributors](https://camo.githubusercontent.com/4e96de37ea680371089642c8762ee051f42043eb64b50c4119a4e48970a2d434/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f616c6c5f636f6e7472696275746f72732d312d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](#contributors-)

内容列表
----

[](#内容列表)

- [安装](#%E5%AE%89%E8%A3%85)
- [使用说明](#%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E)
    - [授权](#%E6%8E%88%E6%9D%83)
    - [基础调用](#%E5%9F%BA%E7%A1%80%E8%B0%83%E7%94%A8)
    - [参照示例](#%E5%8F%82%E7%85%A7%E7%A4%BA%E4%BE%8B)
- [所有方法](#%E6%89%80%E6%9C%89%E6%96%B9%E6%B3%95)
- [维护者](#%E7%BB%B4%E6%8A%A4%E8%80%85)
- [贡献者](#%E8%B4%A1%E7%8C%AE%E8%80%85)
- [如何贡献](#%E5%A6%82%E4%BD%95%E8%B4%A1%E7%8C%AE)
- [使用许可](#%E4%BD%BF%E7%94%A8%E8%AE%B8%E5%8F%AF)

安装
--

[](#安装)

```
composer require cloudycity/kuaishou-marketing-sdk:*
```

使用说明
----

[](#使用说明)

### 授权

[](#授权)

```
use CloudyCity\KuaishouMarketingSDK\Auth;

// 获取token
$auth = new Auth(APPID, SECRET);
var_dump($auth->getTokens(AUTH_CODE));

// 刷新token
var_dump($auth->refreshTokens(REFRESH_TOKEN));
```

### 基础调用

[](#基础调用)

参照[所有方法](#%E6%89%80%E6%9C%89%E6%96%B9%E6%B3%95)

```
$client = new Client(ADVERTISE_ID, TOKEN);
var_dump($client->advertiser->getInfo());
```

### 参照示例

[](#参照示例)

组件提供了一个Interface [`CloudyCity\KuaishouMarketingSDK\Kernel\Contracts\KuaishouService`](src/Kernel/Contracts/KuaishouService.php)

这里以一个实现了Integerface的Service为例：

```
use CloudyCity\KuaishouMarketingSDK\Client;
use App\Services\KuaishouService;

$apps = KuaishouService::getApps();

// 遍历开发者应用
foreach ($apps as $app) {

    $service = new KuaishouService($app['id'], $app['secret']);
    $advertiserIds = $service->getAdvertiserIds();

    // 遍历应用下授权的广告主
    foreach ($advertiserIds as $advertiserId) {
        $tokens = $service->getTokenByCache($advertiserId);
        $client = new Client($tokens['advertiser_id'], $tokens['access_token']);

        // 处理业务逻辑
        try {
            $result = $client->advertiser->getFunds();
        } catch(\Exception $e) {
            //
        }
    }
}
```

所有方法
----

[](#所有方法)

广告主模块执行方式获取广告主信息$client-&gt;advertiser-&gt;getInfo()创建广告主余额$client-&gt;advertiser-&gt;getFunds()修改广告主流水$client-&gt;advertiser-&gt;getFlows($params)广告计划模块执行方式获取广告计划$client-&gt;campaign-&gt;get($params)创建广告计划$client-&gt;campaign-&gt;create($params)修改广告计划$client-&gt;campaign-&gt;update($params)更新计划状态$client-&gt;campaign-&gt;updateStatus($campaignId, $status)广告组执行方式获取广告组$client-&gt;unit-&gt;get($params)创建广告组$client-&gt;unit-&gt;create($params)修改广告组$client-&gt;unit-&gt;update($params)更新组出价$client-&gt;unit-&gt;updateBid($unitId, $bid)更新组预算$client-&gt;unit-&gt;updateBudget($unitId, $budget)更新组状态$client-&gt;unit-&gt;updateStatus($unitId, $status)获取深度转化类型$client-&gt;unit-&gt;getConversionInfo()广告创意执行方式获取创意列表$client-&gt;creative-&gt;get($params)创建广告创意$client-&gt;creative-&gt;create($params)修改创意信息$client-&gt;creative-&gt;update($params)更新创意状态$client-&gt;creative-&gt;updateStatus($creativeId, $status)数据报表执行方式广告主数据$client-&gt;report-&gt;getAdvertiserReports($params)广告计划数据$client-&gt;report-&gt;getCampaignReports($params)广告组数据$client-&gt;report-&gt;getUnitReports($params)广告创意数据$client-&gt;report-&gt;getCreativeReports($params)DMP 人群管理执行方式上传人群$client-&gt;dmp-&gt;population-&gt;upload($params)人群列表查询$client-&gt;dmp-&gt;population-&gt;get($params)删除人群包$client-&gt;dmp-&gt;population-&gt;delete($id)推送人群包$client-&gt;dmp-&gt;population-&gt;push($id)工具（文件管理）执行方式上传视频$client-&gt;tool-&gt;file-&gt;uploadVideo($params)获取视频列表$client-&gt;tool-&gt;file-&gt;getVideos($params)广告图片$client-&gt;tool-&gt;file-&gt;uploadImage($params)获取图片信息client-&gt;tool-&gt;file-&gt;getImage($params)获取图片列表client-&gt;tool-&gt;file-&gt;getImages($params)工具（动态词包）执行方式获取动态词包$client-&gt;tool-&gt;creativeWord-&gt;get()获取贴纸样式$client-&gt;tool-&gt;creativeWord-&gt;getStyles()工具（定向标签）执行方式获取定向标签$client-&gt;tool-&gt;interestTag-&gt;get($type)工具（应用定向）执行方式获取应用列表$client-&gt;tool-&gt;app-&gt;get($params)创建应用$client-&gt;tool-&gt;app-&gt;create($params)更新应用$client-&gt;tool-&gt;app-&gt;update($params)获取应用定向列表$client-&gt;tool-&gt;app-&gt;search($appName)工具（应用定向）执行方式获取地域信息$client-&gt;tool-&gt;region-&gt;get()工具（建站工具）执行方式获取落地页列表$client-&gt;tool-&gt;landingPage-&gt;getPages($params)获取组件列表$client-&gt;tool-&gt;landingPage-&gt;getComponents($params)获取线索列表$client-&gt;tool-&gt;landingPage-&gt;getLeads($params)更新线索$client-&gt;tool-&gt;landingPage-&gt;updateLeads($params)维护者
---

[](#维护者)

- @CloudyCity

贡献者 ✨
-----

[](#贡献者-)

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

  [![](https://avatars.githubusercontent.com/u/49985266?v=4?s=100)
**husanjun**](https://github.com/husanjun)
[💻](https://github.com/CloudyCity/kuaishou-marketing-sdk/commits?author=husanjun "Code") 项目遵循 [all-contributors](https://github.com/all-contributors/all-contributors) 规范。 欢迎任何形式的贡献!

如何贡献
----

[](#如何贡献)

非常欢迎你的加入！[提一个 Issue](https://github.com/CloudyCity/kuaishou-marketing-sdk/issues/new) 或者提交一个 Pull Request。

标准 Readme 遵循 [Contributor Covenant](http://contributor-covenant.org/version/1/3/0/) 行为规范。

使用许可
----

[](#使用许可)

[MIT](LICENSE)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~93 days

Recently: every ~136 days

Total

7

Last Release

1806d ago

PHP version history (2 changes)v0.1PHP &gt;=5.6.0

v0.1.6PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/a30bac408d56202227d7d978a5befaf1ec37f9c971beaed3145854226f150d24?d=identicon)[CloudyCity](/maintainers/CloudyCity)

---

Top Contributors

[![CloudyCity](https://avatars.githubusercontent.com/u/17662451?v=4)](https://github.com/CloudyCity "CloudyCity (18 commits)")[![allcontributors[bot]](https://avatars.githubusercontent.com/in/23186?v=4)](https://github.com/allcontributors[bot] "allcontributors[bot] (2 commits)")[![husanjun](https://avatars.githubusercontent.com/u/49985266?v=4)](https://github.com/husanjun "husanjun (1 commits)")

---

Tags

kuaishoumarketingsdksdkmarketingkuaishou

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/cloudycity-kuaishou-marketing-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/cloudycity-kuaishou-marketing-sdk/health.svg)](https://phpackages.com/packages/cloudycity-kuaishou-marketing-sdk)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M468](/packages/saloonphp-saloon)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[crowdin/crowdin-api-client

PHP client library for Crowdin API v2

611.5M5](/packages/crowdin-crowdin-api-client)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
