pipiads-mcp-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -0
- package/dist/client.d.ts +10 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +30 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/ads.d.ts +129 -0
- package/dist/tools/ads.d.ts.map +1 -0
- package/dist/tools/ads.js +116 -0
- package/dist/tools/ads.js.map +1 -0
- package/dist/tools/products.d.ts +102 -0
- package/dist/tools/products.d.ts.map +1 -0
- package/dist/tools/products.js +101 -0
- package/dist/tools/products.js.map +1 -0
- package/dist/tools/stores.d.ts +18 -0
- package/dist/tools/stores.d.ts.map +1 -0
- package/dist/tools/stores.js +19 -0
- package/dist/tools/stores.js.map +1 -0
- package/dist/tools/tiktok.d.ts +117 -0
- package/dist/tools/tiktok.d.ts.map +1 -0
- package/dist/tools/tiktok.js +115 -0
- package/dist/tools/tiktok.js.map +1 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# PipiAds MCP Server
|
|
2
|
+
|
|
3
|
+
MCP Server for [PipiAds](https://www.pipiads.com) advertising intelligence API. Enables AI assistants like Claude to search and analyze ads, products, and stores across TikTok and Facebook.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Description |
|
|
8
|
+
|------|-------------|
|
|
9
|
+
| `search_ads` | Search ad videos across TikTok & Facebook by keyword, region, metrics |
|
|
10
|
+
| `get_ad_detail` | Get detailed info for a specific ad by video ID |
|
|
11
|
+
| `search_products` | Search e-commerce products with ad data |
|
|
12
|
+
| `get_product_detail` | Get detailed product info including Shopify data |
|
|
13
|
+
| `search_tiktok_products` | Search TikTok Shop products by sales, GMV, trends |
|
|
14
|
+
| `get_tiktok_product_detail` | Get TikTok Shop product details |
|
|
15
|
+
| `get_advertiser_detail` | Get advertiser/domain analytics |
|
|
16
|
+
| `get_store_detail` | Get e-commerce store analytics |
|
|
17
|
+
|
|
18
|
+
## Setup
|
|
19
|
+
|
|
20
|
+
### Get API Key
|
|
21
|
+
|
|
22
|
+
1. Sign up at [pipiads.com](https://www.pipiads.com)
|
|
23
|
+
2. Purchase credits
|
|
24
|
+
3. Get your API key from the dashboard
|
|
25
|
+
|
|
26
|
+
### Claude Desktop
|
|
27
|
+
|
|
28
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"pipiads": {
|
|
34
|
+
"command": "npx",
|
|
35
|
+
"args": ["-y", "pipiads-mcp-server"],
|
|
36
|
+
"env": {
|
|
37
|
+
"PIPIADS_API_KEY": "your-api-key-here"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Claude Code
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
claude mcp add pipiads -- npx -y pipiads-mcp-server
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then set the environment variable:
|
|
51
|
+
```bash
|
|
52
|
+
export PIPIADS_API_KEY="your-api-key-here"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Environment Variables
|
|
56
|
+
|
|
57
|
+
| Variable | Required | Description |
|
|
58
|
+
|----------|----------|-------------|
|
|
59
|
+
| `PIPIADS_API_KEY` | Yes | Your PipiAds API key |
|
|
60
|
+
| `PIPIADS_BASE_URL` | No | API base URL (default: `https://www.pipispy.com`) |
|
|
61
|
+
|
|
62
|
+
## Usage Examples
|
|
63
|
+
|
|
64
|
+
Once configured, just talk to Claude naturally:
|
|
65
|
+
|
|
66
|
+
- "Search for trending TikTok ads about phone cases in the US"
|
|
67
|
+
- "Find Shopify products with over 100k ad views in the last 30 days"
|
|
68
|
+
- "Get details for ad video ID 1795208137186337"
|
|
69
|
+
- "Show me TikTok Shop products with rising sales trends in beauty category"
|
|
70
|
+
- "Look up the store detail for store ID c2d5b2547218a"
|
|
71
|
+
|
|
72
|
+
## Credits
|
|
73
|
+
|
|
74
|
+
Each API call consumes credits from your PipiAds account:
|
|
75
|
+
- **List/Search**: 1 credit per result returned
|
|
76
|
+
- **Detail**: 1 credit per request (free if the same ID was queried within 3 days)
|
|
77
|
+
|
|
78
|
+
## Development
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
git clone <repo-url>
|
|
82
|
+
cd pipiads-mcp-server
|
|
83
|
+
npm install
|
|
84
|
+
npm run build
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Test with MCP Inspector:
|
|
88
|
+
```bash
|
|
89
|
+
PIPIADS_API_KEY=your-key npx @modelcontextprotocol/inspector node dist/index.js
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ApiResponse {
|
|
2
|
+
code: number;
|
|
3
|
+
message: string;
|
|
4
|
+
data: unknown;
|
|
5
|
+
version?: string;
|
|
6
|
+
success: boolean;
|
|
7
|
+
fail: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function callPipiAdsApi(uri: string, params: Record<string, unknown>): Promise<ApiResponse>;
|
|
10
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,WAAW,CAAC,CAoCtB"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const API_BASE_URL = process.env.PIPIADS_BASE_URL || "https://www.pipispy.com";
|
|
2
|
+
const API_KEY = process.env.PIPIADS_API_KEY || "";
|
|
3
|
+
export async function callPipiAdsApi(uri, params) {
|
|
4
|
+
if (!API_KEY) {
|
|
5
|
+
throw new Error("PIPIADS_API_KEY environment variable is required. " +
|
|
6
|
+
"Get your API key from https://www.pipiads.com");
|
|
7
|
+
}
|
|
8
|
+
const url = `${API_BASE_URL}/open-api/v1/data`;
|
|
9
|
+
const response = await fetch(url, {
|
|
10
|
+
method: "POST",
|
|
11
|
+
headers: {
|
|
12
|
+
"Content-Type": "application/json",
|
|
13
|
+
Accept: "application/json",
|
|
14
|
+
},
|
|
15
|
+
body: JSON.stringify({
|
|
16
|
+
key: API_KEY,
|
|
17
|
+
uri,
|
|
18
|
+
params,
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
if (!response.ok) {
|
|
22
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
23
|
+
}
|
|
24
|
+
const result = (await response.json());
|
|
25
|
+
if (result.code !== 200) {
|
|
26
|
+
throw new Error(`API Error ${result.code}: ${result.message || "Unknown error"}`);
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAChB,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,yBAAyB,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;AAWlD,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,GAAW,EACX,MAA+B;IAE/B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,oDAAoD;YAClD,+CAA+C,CAClD,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,GAAG,YAAY,mBAAmB,CAAC;IAE/C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAChC,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,MAAM,EAAE,kBAAkB;SAC3B;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,GAAG,EAAE,OAAO;YACZ,GAAG;YACH,MAAM;SACP,CAAC;KACH,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,QAAQ,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAgB,CAAC;IAEtD,IAAI,MAAM,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,aAAa,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,IAAI,eAAe,EAAE,CACjE,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { searchAdsSchema, searchAds, getAdDetailSchema, getAdDetail, } from "./tools/ads.js";
|
|
5
|
+
import { searchProductsSchema, searchProducts, getProductDetailSchema, getProductDetail, } from "./tools/products.js";
|
|
6
|
+
import { searchTiktokProductsSchema, searchTiktokProducts, getTiktokProductDetailSchema, getTiktokProductDetail, } from "./tools/tiktok.js";
|
|
7
|
+
import { getAdvertiserDetailSchema, getAdvertiserDetail, getStoreDetailSchema, getStoreDetail, } from "./tools/stores.js";
|
|
8
|
+
const server = new McpServer({
|
|
9
|
+
name: "pipiads",
|
|
10
|
+
version: "1.0.0",
|
|
11
|
+
});
|
|
12
|
+
// --- Ad Spy ---
|
|
13
|
+
server.tool("search_ads", "Search advertising videos across TikTok and Facebook. Find ads by keyword, region, platform, engagement metrics, delivery days, ad spend, and more. Each result costs 1 credit.", searchAdsSchema.shape, async (params) => {
|
|
14
|
+
try {
|
|
15
|
+
const text = await searchAds(searchAdsSchema.parse(params));
|
|
16
|
+
return { content: [{ type: "text", text }] };
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
20
|
+
return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
server.tool("get_ad_detail", "Get detailed information for a specific ad by its video ID. Returns ad copy, metrics, advertiser info, landing page, and more. Free if the ID was queried within the past 3 days, otherwise costs 1 credit.", getAdDetailSchema.shape, async (params) => {
|
|
24
|
+
try {
|
|
25
|
+
const text = await getAdDetail(getAdDetailSchema.parse(params));
|
|
26
|
+
return { content: [{ type: "text", text }] };
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
30
|
+
return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
// --- Ad Products ---
|
|
34
|
+
server.tool("search_products", "Search e-commerce products advertised on TikTok and Facebook. Filter by keyword, price, category, region, ad metrics, delivery days. Each result costs 1 credit.", searchProductsSchema.shape, async (params) => {
|
|
35
|
+
try {
|
|
36
|
+
const text = await searchProducts(searchProductsSchema.parse(params));
|
|
37
|
+
return { content: [{ type: "text", text }] };
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
41
|
+
return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
server.tool("get_product_detail", "Get detailed information for a specific advertised product. Returns images, price, landing page, ad stats, category, Shopify data, and more. Free if queried within 3 days, otherwise 1 credit.", getProductDetailSchema.shape, async (params) => {
|
|
45
|
+
try {
|
|
46
|
+
const text = await getProductDetail(getProductDetailSchema.parse(params));
|
|
47
|
+
return { content: [{ type: "text", text }] };
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
51
|
+
return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
// --- TikTok Shop ---
|
|
55
|
+
server.tool("search_tiktok_products", "Search TikTok Shop products. Filter by keyword, category, region, sales volume, GMV, price, influencer count, ad metrics, and sales trend. Requires sort, sort_type, and time parameters. Each result costs 1 credit.", searchTiktokProductsSchema.shape, async (params) => {
|
|
56
|
+
try {
|
|
57
|
+
const text = await searchTiktokProducts(searchTiktokProductsSchema.parse(params));
|
|
58
|
+
return { content: [{ type: "text", text }] };
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
62
|
+
return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
server.tool("get_tiktok_product_detail", "Get detailed info for a TikTok Shop product by ID. Returns title, images, price, sales, shop info, influencers, ad videos, and more. Free if queried within 3 days, otherwise 1 credit.", getTiktokProductDetailSchema.shape, async (params) => {
|
|
66
|
+
try {
|
|
67
|
+
const text = await getTiktokProductDetail(getTiktokProductDetailSchema.parse(params));
|
|
68
|
+
return { content: [{ type: "text", text }] };
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
72
|
+
return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
// --- Stores & Advertisers ---
|
|
76
|
+
server.tool("get_advertiser_detail", "Get detailed info for an advertiser (root path) by ID. Returns domain, ad count, product count, region distribution, platform data, and historical trends.", getAdvertiserDetailSchema.shape, async (params) => {
|
|
77
|
+
try {
|
|
78
|
+
const text = await getAdvertiserDetail(getAdvertiserDetailSchema.parse(params));
|
|
79
|
+
return { content: [{ type: "text", text }] };
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
83
|
+
return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
server.tool("get_store_detail", "Get detailed info for an e-commerce store by its 13-character store ID. Returns store name, platform, product count, ad metrics, region analysis, and more.", getStoreDetailSchema.shape, async (params) => {
|
|
87
|
+
try {
|
|
88
|
+
const text = await getStoreDetail(getStoreDetailSchema.parse(params));
|
|
89
|
+
return { content: [{ type: "text", text }] };
|
|
90
|
+
}
|
|
91
|
+
catch (e) {
|
|
92
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
93
|
+
return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
// --- Start Server ---
|
|
97
|
+
async function main() {
|
|
98
|
+
const transport = new StdioServerTransport();
|
|
99
|
+
await server.connect(transport);
|
|
100
|
+
}
|
|
101
|
+
main().catch((error) => {
|
|
102
|
+
console.error("Fatal error:", error);
|
|
103
|
+
process.exit(1);
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,iBAAiB;AAEjB,MAAM,CAAC,IAAI,CACT,YAAY,EACZ,iLAAiL,EACjL,eAAe,CAAC,KAAK,EACrB,KAAK,EAAE,MAAM,EAAE,EAAE;IACf,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAC/C,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,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EAAE,IAAI,EAAE,CAAC;IAC/E,CAAC;AACH,CAAC,CACF,CAAC;AAEF,uBAAuB;AAEvB,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const searchAdsSchema: z.ZodObject<{
|
|
3
|
+
current_page: z.ZodDefault<z.ZodNumber>;
|
|
4
|
+
page_size: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
plat_type: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
extend_keywords: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7
|
+
type: z.ZodNumber;
|
|
8
|
+
keyword: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
type: number;
|
|
11
|
+
keyword: string;
|
|
12
|
+
}, {
|
|
13
|
+
type: number;
|
|
14
|
+
keyword: string;
|
|
15
|
+
}>, "many">>;
|
|
16
|
+
search_type: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
region: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
sort: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
sort_type: z.ZodOptional<z.ZodString>;
|
|
20
|
+
play_count_min: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
play_count_max: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
digg_count_min: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
digg_count_max: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
put_day_min: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
put_day_max: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
create_time_start: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
create_time_end: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
first_time_start: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
first_time_end: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
last_time_start: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
last_time_end: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
data_type: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
33
|
+
is_product: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
is_app: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
is_url: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
shop_type: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
37
|
+
ad_cost_min: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
ad_cost_max: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
comment_count_min: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
comment_count_max: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
share_count_min: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
share_count_max: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
ad_language: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
44
|
+
formate_type: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
current_page: number;
|
|
47
|
+
page_size: number;
|
|
48
|
+
plat_type?: number | undefined;
|
|
49
|
+
sort?: number | undefined;
|
|
50
|
+
extend_keywords?: {
|
|
51
|
+
type: number;
|
|
52
|
+
keyword: string;
|
|
53
|
+
}[] | undefined;
|
|
54
|
+
search_type?: number | undefined;
|
|
55
|
+
region?: string[] | undefined;
|
|
56
|
+
sort_type?: string | undefined;
|
|
57
|
+
play_count_min?: number | undefined;
|
|
58
|
+
play_count_max?: number | undefined;
|
|
59
|
+
digg_count_min?: number | undefined;
|
|
60
|
+
digg_count_max?: number | undefined;
|
|
61
|
+
put_day_min?: number | undefined;
|
|
62
|
+
put_day_max?: number | undefined;
|
|
63
|
+
create_time_start?: number | undefined;
|
|
64
|
+
create_time_end?: number | undefined;
|
|
65
|
+
first_time_start?: number | undefined;
|
|
66
|
+
first_time_end?: number | undefined;
|
|
67
|
+
last_time_start?: number | undefined;
|
|
68
|
+
last_time_end?: number | undefined;
|
|
69
|
+
data_type?: number[] | undefined;
|
|
70
|
+
is_product?: boolean | undefined;
|
|
71
|
+
is_app?: boolean | undefined;
|
|
72
|
+
is_url?: number | undefined;
|
|
73
|
+
shop_type?: string[] | undefined;
|
|
74
|
+
ad_cost_min?: number | undefined;
|
|
75
|
+
ad_cost_max?: number | undefined;
|
|
76
|
+
comment_count_min?: number | undefined;
|
|
77
|
+
comment_count_max?: number | undefined;
|
|
78
|
+
share_count_min?: number | undefined;
|
|
79
|
+
share_count_max?: number | undefined;
|
|
80
|
+
ad_language?: string[] | undefined;
|
|
81
|
+
formate_type?: number[] | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
current_page?: number | undefined;
|
|
84
|
+
page_size?: number | undefined;
|
|
85
|
+
plat_type?: number | undefined;
|
|
86
|
+
sort?: number | undefined;
|
|
87
|
+
extend_keywords?: {
|
|
88
|
+
type: number;
|
|
89
|
+
keyword: string;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
search_type?: number | undefined;
|
|
92
|
+
region?: string[] | undefined;
|
|
93
|
+
sort_type?: string | undefined;
|
|
94
|
+
play_count_min?: number | undefined;
|
|
95
|
+
play_count_max?: number | undefined;
|
|
96
|
+
digg_count_min?: number | undefined;
|
|
97
|
+
digg_count_max?: number | undefined;
|
|
98
|
+
put_day_min?: number | undefined;
|
|
99
|
+
put_day_max?: number | undefined;
|
|
100
|
+
create_time_start?: number | undefined;
|
|
101
|
+
create_time_end?: number | undefined;
|
|
102
|
+
first_time_start?: number | undefined;
|
|
103
|
+
first_time_end?: number | undefined;
|
|
104
|
+
last_time_start?: number | undefined;
|
|
105
|
+
last_time_end?: number | undefined;
|
|
106
|
+
data_type?: number[] | undefined;
|
|
107
|
+
is_product?: boolean | undefined;
|
|
108
|
+
is_app?: boolean | undefined;
|
|
109
|
+
is_url?: number | undefined;
|
|
110
|
+
shop_type?: string[] | undefined;
|
|
111
|
+
ad_cost_min?: number | undefined;
|
|
112
|
+
ad_cost_max?: number | undefined;
|
|
113
|
+
comment_count_min?: number | undefined;
|
|
114
|
+
comment_count_max?: number | undefined;
|
|
115
|
+
share_count_min?: number | undefined;
|
|
116
|
+
share_count_max?: number | undefined;
|
|
117
|
+
ad_language?: string[] | undefined;
|
|
118
|
+
formate_type?: number[] | undefined;
|
|
119
|
+
}>;
|
|
120
|
+
export declare function searchAds(params: z.infer<typeof searchAdsSchema>): Promise<string>;
|
|
121
|
+
export declare const getAdDetailSchema: z.ZodObject<{
|
|
122
|
+
id: z.ZodString;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
id: string;
|
|
125
|
+
}, {
|
|
126
|
+
id: string;
|
|
127
|
+
}>;
|
|
128
|
+
export declare function getAdDetail(params: z.infer<typeof getAdDetailSchema>): Promise<string>;
|
|
129
|
+
//# sourceMappingURL=ads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ads.d.ts","sourceRoot":"","sources":["../../src/tools/ads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiH1B,CAAC;AAEH,wBAAsB,SAAS,CAC7B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GACtC,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED,eAAO,MAAM,iBAAiB;;;;;;EAE5B,CAAC;AAEH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,GACxC,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { callPipiAdsApi } from "../client.js";
|
|
3
|
+
export const searchAdsSchema = z.object({
|
|
4
|
+
current_page: z
|
|
5
|
+
.number()
|
|
6
|
+
.int()
|
|
7
|
+
.min(1)
|
|
8
|
+
.default(1)
|
|
9
|
+
.describe("Page number, starting from 1"),
|
|
10
|
+
page_size: z
|
|
11
|
+
.number()
|
|
12
|
+
.int()
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(50)
|
|
15
|
+
.default(20)
|
|
16
|
+
.describe("Results per page, max 50"),
|
|
17
|
+
plat_type: z
|
|
18
|
+
.number()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Platform: 1=TikTok, 2=Facebook. Omit for all platforms"),
|
|
21
|
+
extend_keywords: z
|
|
22
|
+
.array(z.object({
|
|
23
|
+
type: z
|
|
24
|
+
.number()
|
|
25
|
+
.describe("Search type: 1=Ad keyword, 2=Ad copy, 3=Advertiser, 4=Landing page URL, 5=E-commerce product, 6=TikTok Shop store, 7=APP name, 8=APP developer, 9=Social media account, 10=Creative material, 11=E-commerce store/URL, 12=TikTok Shop product"),
|
|
26
|
+
keyword: z.string().describe("Search keyword"),
|
|
27
|
+
}))
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Keyword search list. Each item has a type and keyword"),
|
|
30
|
+
search_type: z
|
|
31
|
+
.number()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Search type for simple keyword: 1=Ad keyword(default), 2=Ad copy, 3=Advertiser, 4=Landing page URL, 5=E-commerce product, 6=TikTok Shop store, 7=APP name"),
|
|
34
|
+
region: z
|
|
35
|
+
.array(z.string())
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Country/region codes, e.g. ["US","GB","DE"]'),
|
|
38
|
+
sort: z
|
|
39
|
+
.number()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("Sort by: 1=Last found time, 2=Create time(default), 3=First found time, 4=Ad plays, 5=Delivery days, 6=Engagement, 7=Like rate, 9=Like count, 21=Ad spend"),
|
|
42
|
+
sort_type: z
|
|
43
|
+
.string()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('Sort order: "desc"(default) or "asc"'),
|
|
46
|
+
play_count_min: z.number().optional().describe("Minimum play/view count"),
|
|
47
|
+
play_count_max: z.number().optional().describe("Maximum play/view count"),
|
|
48
|
+
digg_count_min: z.number().optional().describe("Minimum like count"),
|
|
49
|
+
digg_count_max: z.number().optional().describe("Maximum like count"),
|
|
50
|
+
put_day_min: z.number().optional().describe("Minimum delivery days"),
|
|
51
|
+
put_day_max: z.number().optional().describe("Maximum delivery days"),
|
|
52
|
+
create_time_start: z
|
|
53
|
+
.number()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe("Creation time range start (unix timestamp in seconds)"),
|
|
56
|
+
create_time_end: z
|
|
57
|
+
.number()
|
|
58
|
+
.optional()
|
|
59
|
+
.describe("Creation time range end (unix timestamp in seconds)"),
|
|
60
|
+
first_time_start: z
|
|
61
|
+
.number()
|
|
62
|
+
.optional()
|
|
63
|
+
.describe("First found time start (unix timestamp)"),
|
|
64
|
+
first_time_end: z
|
|
65
|
+
.number()
|
|
66
|
+
.optional()
|
|
67
|
+
.describe("First found time end (unix timestamp)"),
|
|
68
|
+
last_time_start: z
|
|
69
|
+
.number()
|
|
70
|
+
.optional()
|
|
71
|
+
.describe("Last found time start (unix timestamp)"),
|
|
72
|
+
last_time_end: z
|
|
73
|
+
.number()
|
|
74
|
+
.optional()
|
|
75
|
+
.describe("Last found time end (unix timestamp)"),
|
|
76
|
+
data_type: z
|
|
77
|
+
.array(z.number())
|
|
78
|
+
.optional()
|
|
79
|
+
.describe("Data type filter: 1=Hot Product, 2=Mini Shop Ad, 3=E-commerce, 4=Spark Ads, 5=Game, 6=App, 7=AI, 8=Short Drama"),
|
|
80
|
+
is_product: z.boolean().optional().describe("Filter: has ad product"),
|
|
81
|
+
is_app: z.boolean().optional().describe("Filter: has APP product"),
|
|
82
|
+
is_url: z
|
|
83
|
+
.number()
|
|
84
|
+
.optional()
|
|
85
|
+
.describe("URL status: 0=No landing page, 1=Has landing page"),
|
|
86
|
+
shop_type: z
|
|
87
|
+
.array(z.string())
|
|
88
|
+
.optional()
|
|
89
|
+
.describe('E-commerce platform filter, e.g. ["shopify","woocommerce","magento","wix","shoplazza","shopline","squarespace","shopyy"]'),
|
|
90
|
+
ad_cost_min: z.number().optional().describe("Minimum ad spend (USD)"),
|
|
91
|
+
ad_cost_max: z.number().optional().describe("Maximum ad spend (USD)"),
|
|
92
|
+
comment_count_min: z.number().optional().describe("Minimum comment count"),
|
|
93
|
+
comment_count_max: z.number().optional().describe("Maximum comment count"),
|
|
94
|
+
share_count_min: z.number().optional().describe("Minimum share count"),
|
|
95
|
+
share_count_max: z.number().optional().describe("Maximum share count"),
|
|
96
|
+
ad_language: z
|
|
97
|
+
.array(z.string())
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('Ad language filter, e.g. ["en","zh"]'),
|
|
100
|
+
formate_type: z
|
|
101
|
+
.array(z.number())
|
|
102
|
+
.optional()
|
|
103
|
+
.describe("Ad format: 1=Video, 2=Image, 3=Carousel"),
|
|
104
|
+
});
|
|
105
|
+
export async function searchAds(params) {
|
|
106
|
+
const result = await callPipiAdsApi("/v3/api/open/adspy/list", params);
|
|
107
|
+
return JSON.stringify(result.data, null, 2);
|
|
108
|
+
}
|
|
109
|
+
export const getAdDetailSchema = z.object({
|
|
110
|
+
id: z.string().describe("Ad video ID (video_id from search results)"),
|
|
111
|
+
});
|
|
112
|
+
export async function getAdDetail(params) {
|
|
113
|
+
const result = await callPipiAdsApi("/v3/api/open/adspy/detail", params);
|
|
114
|
+
return JSON.stringify(result.data, null, 2);
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=ads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ads.js","sourceRoot":"","sources":["../../src/tools/ads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,CAAC,CAAC;SACV,QAAQ,CAAC,8BAA8B,CAAC;IAC3C,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,0BAA0B,CAAC;IACvC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,wDAAwD,CAAC;IACrE,eAAe,EAAE,CAAC;SACf,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,QAAQ,CACP,+OAA+O,CAChP;QACH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;KAC/C,CAAC,CACH;SACA,QAAQ,EAAE;SACV,QAAQ,CAAC,uDAAuD,CAAC;IACpE,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,2JAA2J,CAC5J;IACH,MAAM,EAAE,CAAC;SAC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Q,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACtE,WAAW,EAAE,CAAC;SACX,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,sCAAsC,CAAC;IACnD,YAAY,EAAE,CAAC;SACZ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,yCAAyC,CAAC;CACvD,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,MAAuC;IAEvC,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;IACvE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;CACtE,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAyC;IAEzC,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;IACzE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const searchProductsSchema: z.ZodObject<{
|
|
3
|
+
current_page: z.ZodDefault<z.ZodNumber>;
|
|
4
|
+
page_size: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
plat_type: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
keyword: z.ZodOptional<z.ZodString>;
|
|
7
|
+
search_type: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
category: z.ZodOptional<z.ZodString>;
|
|
9
|
+
region: z.ZodOptional<z.ZodString>;
|
|
10
|
+
play_count_min: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
play_count_max: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
digg_count_min: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
digg_count_max: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
video_count_min: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
video_count_max: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
put_day_min: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
put_day_max: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
price_min: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
price_max: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
create_time_start: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
create_time_end: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
tiktok_time_start: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
tiktok_time_end: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
latest_found_time_start: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
latest_found_time_end: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
27
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
28
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
29
|
+
sort_type: z.ZodOptional<z.ZodString>;
|
|
30
|
+
store_id: z.ZodOptional<z.ZodString>;
|
|
31
|
+
time: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
current_page: number;
|
|
34
|
+
page_size: number;
|
|
35
|
+
plat_type?: number | undefined;
|
|
36
|
+
sort?: string | undefined;
|
|
37
|
+
keyword?: string | undefined;
|
|
38
|
+
search_type?: number | undefined;
|
|
39
|
+
region?: string | undefined;
|
|
40
|
+
sort_type?: string | undefined;
|
|
41
|
+
play_count_min?: number | undefined;
|
|
42
|
+
play_count_max?: number | undefined;
|
|
43
|
+
digg_count_min?: number | undefined;
|
|
44
|
+
digg_count_max?: number | undefined;
|
|
45
|
+
put_day_min?: number | undefined;
|
|
46
|
+
put_day_max?: number | undefined;
|
|
47
|
+
create_time_start?: number | undefined;
|
|
48
|
+
create_time_end?: number | undefined;
|
|
49
|
+
category?: string | undefined;
|
|
50
|
+
video_count_min?: number | undefined;
|
|
51
|
+
video_count_max?: number | undefined;
|
|
52
|
+
price_min?: number | undefined;
|
|
53
|
+
price_max?: number | undefined;
|
|
54
|
+
tiktok_time_start?: number | undefined;
|
|
55
|
+
tiktok_time_end?: number | undefined;
|
|
56
|
+
latest_found_time_start?: number | undefined;
|
|
57
|
+
latest_found_time_end?: number | undefined;
|
|
58
|
+
platform?: string | undefined;
|
|
59
|
+
currency?: string | undefined;
|
|
60
|
+
store_id?: string | undefined;
|
|
61
|
+
time?: number | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
current_page?: number | undefined;
|
|
64
|
+
page_size?: number | undefined;
|
|
65
|
+
plat_type?: number | undefined;
|
|
66
|
+
sort?: string | undefined;
|
|
67
|
+
keyword?: string | undefined;
|
|
68
|
+
search_type?: number | undefined;
|
|
69
|
+
region?: string | undefined;
|
|
70
|
+
sort_type?: string | undefined;
|
|
71
|
+
play_count_min?: number | undefined;
|
|
72
|
+
play_count_max?: number | undefined;
|
|
73
|
+
digg_count_min?: number | undefined;
|
|
74
|
+
digg_count_max?: number | undefined;
|
|
75
|
+
put_day_min?: number | undefined;
|
|
76
|
+
put_day_max?: number | undefined;
|
|
77
|
+
create_time_start?: number | undefined;
|
|
78
|
+
create_time_end?: number | undefined;
|
|
79
|
+
category?: string | undefined;
|
|
80
|
+
video_count_min?: number | undefined;
|
|
81
|
+
video_count_max?: number | undefined;
|
|
82
|
+
price_min?: number | undefined;
|
|
83
|
+
price_max?: number | undefined;
|
|
84
|
+
tiktok_time_start?: number | undefined;
|
|
85
|
+
tiktok_time_end?: number | undefined;
|
|
86
|
+
latest_found_time_start?: number | undefined;
|
|
87
|
+
latest_found_time_end?: number | undefined;
|
|
88
|
+
platform?: string | undefined;
|
|
89
|
+
currency?: string | undefined;
|
|
90
|
+
store_id?: string | undefined;
|
|
91
|
+
time?: number | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
export declare function searchProducts(params: z.infer<typeof searchProductsSchema>): Promise<string>;
|
|
94
|
+
export declare const getProductDetailSchema: z.ZodObject<{
|
|
95
|
+
id: z.ZodString;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
id: string;
|
|
98
|
+
}, {
|
|
99
|
+
id: string;
|
|
100
|
+
}>;
|
|
101
|
+
export declare function getProductDetail(params: z.infer<typeof getProductDetailSchema>): Promise<string>;
|
|
102
|
+
//# sourceMappingURL=products.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/tools/products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8F/B,CAAC;AAEH,wBAAsB,cAAc,CAClC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,GAC3C,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED,eAAO,MAAM,sBAAsB;;;;;;EAEjC,CAAC;AAEH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,GAC7C,OAAO,CAAC,MAAM,CAAC,CAMjB"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { callPipiAdsApi } from "../client.js";
|
|
3
|
+
export const searchProductsSchema = z.object({
|
|
4
|
+
current_page: z
|
|
5
|
+
.number()
|
|
6
|
+
.int()
|
|
7
|
+
.min(1)
|
|
8
|
+
.default(1)
|
|
9
|
+
.describe("Page number, starting from 1"),
|
|
10
|
+
page_size: z
|
|
11
|
+
.number()
|
|
12
|
+
.int()
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(50)
|
|
15
|
+
.default(20)
|
|
16
|
+
.describe("Results per page, max 50"),
|
|
17
|
+
plat_type: z
|
|
18
|
+
.number()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Platform: 0=All, 1=TikTok, 2=Facebook"),
|
|
21
|
+
keyword: z.string().optional().describe("Search keyword for product title"),
|
|
22
|
+
search_type: z
|
|
23
|
+
.number()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Search type: 1=Product title, 2=Product description, 3=Advertiser URL, 4=Advertiser name, 5=Product keyword"),
|
|
26
|
+
category: z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Product category, multiple separated by commas"),
|
|
30
|
+
region: z
|
|
31
|
+
.string()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Country/region, multiple separated by commas, e.g. "US,GB"'),
|
|
34
|
+
play_count_min: z.number().optional().describe("Minimum ad play count"),
|
|
35
|
+
play_count_max: z.number().optional().describe("Maximum ad play count"),
|
|
36
|
+
digg_count_min: z.number().optional().describe("Minimum like count"),
|
|
37
|
+
digg_count_max: z.number().optional().describe("Maximum like count"),
|
|
38
|
+
video_count_min: z.number().optional().describe("Minimum ad count"),
|
|
39
|
+
video_count_max: z.number().optional().describe("Maximum ad count"),
|
|
40
|
+
put_day_min: z.number().optional().describe("Minimum delivery days"),
|
|
41
|
+
put_day_max: z.number().optional().describe("Maximum delivery days"),
|
|
42
|
+
price_min: z.number().optional().describe("Minimum product price (USD)"),
|
|
43
|
+
price_max: z.number().optional().describe("Maximum product price (USD)"),
|
|
44
|
+
create_time_start: z
|
|
45
|
+
.number()
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("Product creation time start (unix timestamp)"),
|
|
48
|
+
create_time_end: z
|
|
49
|
+
.number()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("Product creation time end (unix timestamp)"),
|
|
52
|
+
tiktok_time_start: z
|
|
53
|
+
.number()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe("Ad start date / first found time start (unix timestamp)"),
|
|
56
|
+
tiktok_time_end: z
|
|
57
|
+
.number()
|
|
58
|
+
.optional()
|
|
59
|
+
.describe("Ad start date / first found time end (unix timestamp)"),
|
|
60
|
+
latest_found_time_start: z
|
|
61
|
+
.number()
|
|
62
|
+
.optional()
|
|
63
|
+
.describe("Ad end date / last found time start (unix timestamp)"),
|
|
64
|
+
latest_found_time_end: z
|
|
65
|
+
.number()
|
|
66
|
+
.optional()
|
|
67
|
+
.describe("Ad end date / last found time end (unix timestamp)"),
|
|
68
|
+
platform: z
|
|
69
|
+
.string()
|
|
70
|
+
.optional()
|
|
71
|
+
.describe('E-commerce platform, comma-separated: "shopify,woocommerce,shoplazza,magento,wix,shopline,squarespace,shopyy"'),
|
|
72
|
+
currency: z
|
|
73
|
+
.string()
|
|
74
|
+
.optional()
|
|
75
|
+
.describe('Currency filter, comma-separated, e.g. "USD,EUR"'),
|
|
76
|
+
sort: z
|
|
77
|
+
.string()
|
|
78
|
+
.optional()
|
|
79
|
+
.describe("Sort field: 0=Start Date, 1=End Date, 2=Product Creation Date, 3=Price(USD), 4=Number of ads, 5=Impressions, 6=Likes, 7=Durations"),
|
|
80
|
+
sort_type: z.string().optional().describe('Sort order: "desc" or "asc"'),
|
|
81
|
+
store_id: z
|
|
82
|
+
.string()
|
|
83
|
+
.optional()
|
|
84
|
+
.describe("Store ID (13-char string) to filter products from a store"),
|
|
85
|
+
time: z
|
|
86
|
+
.number()
|
|
87
|
+
.optional()
|
|
88
|
+
.describe("Time range shortcut: 1=yesterday, 7=last 7 days, 30=last 30 days, 90=last 90 days"),
|
|
89
|
+
});
|
|
90
|
+
export async function searchProducts(params) {
|
|
91
|
+
const result = await callPipiAdsApi("/v3/api/open/ad-product/list", params);
|
|
92
|
+
return JSON.stringify(result.data, null, 2);
|
|
93
|
+
}
|
|
94
|
+
export const getProductDetailSchema = z.object({
|
|
95
|
+
id: z.string().describe("Product ID from search results"),
|
|
96
|
+
});
|
|
97
|
+
export async function getProductDetail(params) {
|
|
98
|
+
const result = await callPipiAdsApi("/v3/api/open/ad-product/detail", params);
|
|
99
|
+
return JSON.stringify(result.data, null, 2);
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=products.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../src/tools/products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,CAAC,CAAC;SACV,QAAQ,CAAC,8BAA8B,CAAC;IAC3C,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,0BAA0B,CAAC;IACvC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,uCAAuC,CAAC;IACpD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC3E,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,6GAA6G,CAC9G;IACH,QAAQ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CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;CAC1D,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAA8C;IAE9C,MAAM,MAAM,GAAG,MAAM,cAAc,CACjC,gCAAgC,EAChC,MAAM,CACP,CAAC;IACF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const getAdvertiserDetailSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
id: string;
|
|
6
|
+
}, {
|
|
7
|
+
id: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function getAdvertiserDetail(params: z.infer<typeof getAdvertiserDetailSchema>): Promise<string>;
|
|
10
|
+
export declare const getStoreDetailSchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
id: string;
|
|
14
|
+
}, {
|
|
15
|
+
id: string;
|
|
16
|
+
}>;
|
|
17
|
+
export declare function getStoreDetail(params: z.infer<typeof getStoreDetailSchema>): Promise<string>;
|
|
18
|
+
//# sourceMappingURL=stores.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stores.d.ts","sourceRoot":"","sources":["../../src/tools/stores.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAC;AAEH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,GAChD,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED,eAAO,MAAM,oBAAoB;;;;;;EAM/B,CAAC;AAEH,wBAAsB,cAAc,CAClC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,GAC3C,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { callPipiAdsApi } from "../client.js";
|
|
3
|
+
export const getAdvertiserDetailSchema = z.object({
|
|
4
|
+
id: z.string().describe("Advertiser unique identifier ID"),
|
|
5
|
+
});
|
|
6
|
+
export async function getAdvertiserDetail(params) {
|
|
7
|
+
const result = await callPipiAdsApi("/v3/api/open/advertiser/detail", params);
|
|
8
|
+
return JSON.stringify(result.data, null, 2);
|
|
9
|
+
}
|
|
10
|
+
export const getStoreDetailSchema = z.object({
|
|
11
|
+
id: z
|
|
12
|
+
.string()
|
|
13
|
+
.describe("Store ID - a 13-character string (e.g. c2d5b2547218a), from store_id field in store ranking results"),
|
|
14
|
+
});
|
|
15
|
+
export async function getStoreDetail(params) {
|
|
16
|
+
const result = await callPipiAdsApi("/v3/api/open/store/detail", params);
|
|
17
|
+
return JSON.stringify(result.data, null, 2);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=stores.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stores.js","sourceRoot":"","sources":["../../src/tools/stores.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;CAC3D,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAiD;IAEjD,MAAM,MAAM,GAAG,MAAM,cAAc,CACjC,gCAAgC,EAChC,MAAM,CACP,CAAC;IACF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,EAAE,EAAE,CAAC;SACF,MAAM,EAAE;SACR,QAAQ,CACP,qGAAqG,CACtG;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA4C;IAE5C,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;IACzE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const searchTiktokProductsSchema: z.ZodObject<{
|
|
3
|
+
current_page: z.ZodDefault<z.ZodNumber>;
|
|
4
|
+
page_size: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
sort: z.ZodNumber;
|
|
6
|
+
sort_type: z.ZodString;
|
|
7
|
+
time: z.ZodNumber;
|
|
8
|
+
keyword: z.ZodOptional<z.ZodString>;
|
|
9
|
+
search_type: z.ZodOptional<z.ZodString>;
|
|
10
|
+
categorize: z.ZodOptional<z.ZodString>;
|
|
11
|
+
region: z.ZodOptional<z.ZodString>;
|
|
12
|
+
delivery: z.ZodOptional<z.ZodString>;
|
|
13
|
+
is_managed: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
is_in_marketplace: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
sales_volume_min: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
sales_volume_max: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
gmv_min: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
gmv_max: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
price_usd_min: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
price_usd_max: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
play_count_min: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
play_count_max: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
commission_rate_min: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
commission_rate_max: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
person_count_min: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
person_count_max: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
video_count_min: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
video_count_max: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
sales_trend: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
shop_id: z.ZodOptional<z.ZodString>;
|
|
31
|
+
found_time_start: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
found_time_end: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
last_found_time_start: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
last_found_time_end: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
cpm_min: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
cpm_max: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
current_page: number;
|
|
39
|
+
page_size: number;
|
|
40
|
+
sort: number;
|
|
41
|
+
sort_type: string;
|
|
42
|
+
time: number;
|
|
43
|
+
keyword?: string | undefined;
|
|
44
|
+
search_type?: string | undefined;
|
|
45
|
+
region?: string | undefined;
|
|
46
|
+
play_count_min?: number | undefined;
|
|
47
|
+
play_count_max?: number | undefined;
|
|
48
|
+
video_count_min?: number | undefined;
|
|
49
|
+
video_count_max?: number | undefined;
|
|
50
|
+
categorize?: string | undefined;
|
|
51
|
+
delivery?: string | undefined;
|
|
52
|
+
is_managed?: boolean | undefined;
|
|
53
|
+
is_in_marketplace?: boolean | undefined;
|
|
54
|
+
sales_volume_min?: number | undefined;
|
|
55
|
+
sales_volume_max?: number | undefined;
|
|
56
|
+
gmv_min?: number | undefined;
|
|
57
|
+
gmv_max?: number | undefined;
|
|
58
|
+
price_usd_min?: number | undefined;
|
|
59
|
+
price_usd_max?: number | undefined;
|
|
60
|
+
commission_rate_min?: number | undefined;
|
|
61
|
+
commission_rate_max?: number | undefined;
|
|
62
|
+
person_count_min?: number | undefined;
|
|
63
|
+
person_count_max?: number | undefined;
|
|
64
|
+
sales_trend?: number | undefined;
|
|
65
|
+
shop_id?: string | undefined;
|
|
66
|
+
found_time_start?: number | undefined;
|
|
67
|
+
found_time_end?: number | undefined;
|
|
68
|
+
last_found_time_start?: number | undefined;
|
|
69
|
+
last_found_time_end?: number | undefined;
|
|
70
|
+
cpm_min?: number | undefined;
|
|
71
|
+
cpm_max?: number | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
sort: number;
|
|
74
|
+
sort_type: string;
|
|
75
|
+
time: number;
|
|
76
|
+
current_page?: number | undefined;
|
|
77
|
+
page_size?: number | undefined;
|
|
78
|
+
keyword?: string | undefined;
|
|
79
|
+
search_type?: string | undefined;
|
|
80
|
+
region?: string | undefined;
|
|
81
|
+
play_count_min?: number | undefined;
|
|
82
|
+
play_count_max?: number | undefined;
|
|
83
|
+
video_count_min?: number | undefined;
|
|
84
|
+
video_count_max?: number | undefined;
|
|
85
|
+
categorize?: string | undefined;
|
|
86
|
+
delivery?: string | undefined;
|
|
87
|
+
is_managed?: boolean | undefined;
|
|
88
|
+
is_in_marketplace?: boolean | undefined;
|
|
89
|
+
sales_volume_min?: number | undefined;
|
|
90
|
+
sales_volume_max?: number | undefined;
|
|
91
|
+
gmv_min?: number | undefined;
|
|
92
|
+
gmv_max?: number | undefined;
|
|
93
|
+
price_usd_min?: number | undefined;
|
|
94
|
+
price_usd_max?: number | undefined;
|
|
95
|
+
commission_rate_min?: number | undefined;
|
|
96
|
+
commission_rate_max?: number | undefined;
|
|
97
|
+
person_count_min?: number | undefined;
|
|
98
|
+
person_count_max?: number | undefined;
|
|
99
|
+
sales_trend?: number | undefined;
|
|
100
|
+
shop_id?: string | undefined;
|
|
101
|
+
found_time_start?: number | undefined;
|
|
102
|
+
found_time_end?: number | undefined;
|
|
103
|
+
last_found_time_start?: number | undefined;
|
|
104
|
+
last_found_time_end?: number | undefined;
|
|
105
|
+
cpm_min?: number | undefined;
|
|
106
|
+
cpm_max?: number | undefined;
|
|
107
|
+
}>;
|
|
108
|
+
export declare function searchTiktokProducts(params: z.infer<typeof searchTiktokProductsSchema>): Promise<string>;
|
|
109
|
+
export declare const getTiktokProductDetailSchema: z.ZodObject<{
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
id: string;
|
|
113
|
+
}, {
|
|
114
|
+
id: string;
|
|
115
|
+
}>;
|
|
116
|
+
export declare function getTiktokProductDetail(params: z.infer<typeof getTiktokProductDetailSchema>): Promise<string>;
|
|
117
|
+
//# sourceMappingURL=tiktok.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiktok.d.ts","sourceRoot":"","sources":["../../src/tools/tiktok.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0GrC,CAAC;AAEH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,GACjD,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AAEH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,GACnD,OAAO,CAAC,MAAM,CAAC,CAMjB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { callPipiAdsApi } from "../client.js";
|
|
3
|
+
export const searchTiktokProductsSchema = z.object({
|
|
4
|
+
current_page: z
|
|
5
|
+
.number()
|
|
6
|
+
.int()
|
|
7
|
+
.min(1)
|
|
8
|
+
.default(1)
|
|
9
|
+
.describe("Page number, starting from 1"),
|
|
10
|
+
page_size: z
|
|
11
|
+
.number()
|
|
12
|
+
.int()
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(50)
|
|
15
|
+
.default(20)
|
|
16
|
+
.describe("Results per page, max 50"),
|
|
17
|
+
sort: z
|
|
18
|
+
.number()
|
|
19
|
+
.describe("Sort field (required): 1=Last time, 2=First time, 3=Sold, 4=GMV, 5=Impressions, 6=Ad Spend, 7=Ads, 8=Influencers"),
|
|
20
|
+
sort_type: z
|
|
21
|
+
.string()
|
|
22
|
+
.describe('Sort order (required): "asc" or "desc"'),
|
|
23
|
+
time: z
|
|
24
|
+
.number()
|
|
25
|
+
.describe("Time range (required): 0=All, 1=Yesterday, 30=Last 30 days, 90=Last 90 days"),
|
|
26
|
+
keyword: z.string().optional().describe("Search keyword for product title"),
|
|
27
|
+
search_type: z
|
|
28
|
+
.string()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("Search type: 1=Product name/description(default), 2=Store name, 3=Influencer name"),
|
|
31
|
+
categorize: z
|
|
32
|
+
.string()
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("Category filter, multiple separated by commas"),
|
|
35
|
+
region: z
|
|
36
|
+
.string()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe('Country/region, comma-separated, e.g. "US,GB"'),
|
|
39
|
+
delivery: z
|
|
40
|
+
.string()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe('Delivery method: "overseas"=Cross-border, "local"=Local'),
|
|
43
|
+
is_managed: z
|
|
44
|
+
.boolean()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("Filter fully managed products"),
|
|
47
|
+
is_in_marketplace: z
|
|
48
|
+
.boolean()
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Filter marketplace products"),
|
|
51
|
+
sales_volume_min: z.number().optional().describe("Minimum sales volume"),
|
|
52
|
+
sales_volume_max: z.number().optional().describe("Maximum sales volume"),
|
|
53
|
+
gmv_min: z.number().optional().describe("Minimum GMV"),
|
|
54
|
+
gmv_max: z.number().optional().describe("Maximum GMV"),
|
|
55
|
+
price_usd_min: z.number().optional().describe("Minimum price in USD"),
|
|
56
|
+
price_usd_max: z.number().optional().describe("Maximum price in USD"),
|
|
57
|
+
play_count_min: z.number().optional().describe("Minimum ad impressions"),
|
|
58
|
+
play_count_max: z.number().optional().describe("Maximum ad impressions"),
|
|
59
|
+
commission_rate_min: z
|
|
60
|
+
.number()
|
|
61
|
+
.optional()
|
|
62
|
+
.describe("Minimum commission rate"),
|
|
63
|
+
commission_rate_max: z
|
|
64
|
+
.number()
|
|
65
|
+
.optional()
|
|
66
|
+
.describe("Maximum commission rate"),
|
|
67
|
+
person_count_min: z
|
|
68
|
+
.number()
|
|
69
|
+
.optional()
|
|
70
|
+
.describe("Minimum influencer count"),
|
|
71
|
+
person_count_max: z
|
|
72
|
+
.number()
|
|
73
|
+
.optional()
|
|
74
|
+
.describe("Maximum influencer count"),
|
|
75
|
+
video_count_min: z.number().optional().describe("Minimum ad count"),
|
|
76
|
+
video_count_max: z.number().optional().describe("Maximum ad count"),
|
|
77
|
+
sales_trend: z
|
|
78
|
+
.number()
|
|
79
|
+
.optional()
|
|
80
|
+
.describe("Sales trend: 1=Increase, 0=Stable, -1=Decrease"),
|
|
81
|
+
shop_id: z
|
|
82
|
+
.string()
|
|
83
|
+
.optional()
|
|
84
|
+
.describe("Filter products from a specific shop"),
|
|
85
|
+
found_time_start: z
|
|
86
|
+
.number()
|
|
87
|
+
.optional()
|
|
88
|
+
.describe("First ad date start (unix timestamp)"),
|
|
89
|
+
found_time_end: z
|
|
90
|
+
.number()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe("First ad date end (unix timestamp)"),
|
|
93
|
+
last_found_time_start: z
|
|
94
|
+
.number()
|
|
95
|
+
.optional()
|
|
96
|
+
.describe("Last ad date start (unix timestamp)"),
|
|
97
|
+
last_found_time_end: z
|
|
98
|
+
.number()
|
|
99
|
+
.optional()
|
|
100
|
+
.describe("Last ad date end (unix timestamp)"),
|
|
101
|
+
cpm_min: z.number().optional().describe("Minimum ad spend (CPM)"),
|
|
102
|
+
cpm_max: z.number().optional().describe("Maximum ad spend (CPM)"),
|
|
103
|
+
});
|
|
104
|
+
export async function searchTiktokProducts(params) {
|
|
105
|
+
const result = await callPipiAdsApi("/v3/api/open/tiktok-shop/product/list", params);
|
|
106
|
+
return JSON.stringify(result.data, null, 2);
|
|
107
|
+
}
|
|
108
|
+
export const getTiktokProductDetailSchema = z.object({
|
|
109
|
+
id: z.string().describe("TikTok shop product ID"),
|
|
110
|
+
});
|
|
111
|
+
export async function getTiktokProductDetail(params) {
|
|
112
|
+
const result = await callPipiAdsApi("/v3/api/open/tiktok-shop/product/detail", params);
|
|
113
|
+
return JSON.stringify(result.data, null, 2);
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=tiktok.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiktok.js","sourceRoot":"","sources":["../../src/tools/tiktok.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,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M,CACP,CAAC;IACF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pipiads-mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP Server for PipiAds advertising intelligence API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"pipiads-mcp-server": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"start": "node dist/index.js",
|
|
15
|
+
"dev": "tsc --watch"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"mcp",
|
|
19
|
+
"pipiads",
|
|
20
|
+
"advertising",
|
|
21
|
+
"tiktok",
|
|
22
|
+
"facebook",
|
|
23
|
+
"adspy"
|
|
24
|
+
],
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
28
|
+
"zod": "^3.24.4"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^20.11.0",
|
|
32
|
+
"typescript": "^5.3.3"
|
|
33
|
+
}
|
|
34
|
+
}
|