@superagnt/tiktok-data 2.0.2

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 ADDED
@@ -0,0 +1,72 @@
1
+ # TikTok data for OpenClaw — superagnt plugin
2
+
3
+ Use one API key to pull TikTok data (short-form video and creator data) for agents, automations, and analytics. Structured JSON, credit-based pricing, no separate vendor accounts. Unified access to video details, creator profiles, and search across accounts and videos. Built for LLMs and automation — not one-off scraping.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ openclaw plugins install @superagnt/tiktok-data
9
+ ```
10
+
11
+ This package is the official **OpenClaw** plugin for **TikTok** social and public data via [superagnt](https://superagnt.com). Pair it with the [documentation](https://superagnt.com) and your superagnt API key.
12
+
13
+ ## Live MCP mode (recommended)
14
+
15
+ Set a workspace MCP token and the plugin upgrades itself at load: it fetches
16
+ the live tool list from the scoped MCP endpoint and proxies calls through it —
17
+ the tool surface then grows with `agnt_tools_enable`, no plugin update needed.
18
+
19
+ ```bash
20
+ export SUPERAGNT_MCP_TOKEN=... # from the MCP server card in the dashboard
21
+ ```
22
+
23
+ Without the token the plugin uses its built-in toolset with your
24
+ `SUPERAGNT_API_KEY` — no behavior change from previous versions.
25
+
26
+ ## Overview
27
+
28
+ Unified access to video details, creator profiles, and search across accounts and videos. Built for LLMs and automation — not one-off scraping.
29
+
30
+ ### Highlights
31
+
32
+ - Structured JSON responses for TikTok resources
33
+ - Single API key and unified credit balance across superagnt
34
+ - Designed for agent workflows, batch jobs, and real-time tools
35
+ - Composable with other superagnt providers in one stack
36
+ - OpenAPI-documented endpoints for codegen and testing
37
+
38
+ ### Example use cases
39
+
40
+ - Social and creator intelligence agents using TikTok
41
+ - Marketing and research teams monitoring accounts and content
42
+ - Product teams building alerts, digests, and dashboards
43
+ - Developers prototyping LLM tools that need live network data
44
+ - Data teams joining TikTok signals with CRM or warehouse data
45
+
46
+ ## Authentication
47
+
48
+ Use a single **superagnt API key** (Bearer token). Set `SUPERAGNT_API_KEY` in your environment, or complete browser login when the gateway prompts you. Create and manage keys in the [superagnt dashboard](https://app.superagnt.com/dashboard).
49
+
50
+ ## API coverage
51
+
52
+ | | |
53
+ | --- | --- |
54
+ | **Platform** | `tiktok` |
55
+ | **REST base** | `https://api.superagnt.com/v1/data/tiktok` |
56
+ | **OpenAPI operations** | 12 |
57
+ | **OpenClaw tools** | 12 |
58
+
59
+ ## Documentation
60
+
61
+ - [Documentation](https://superagnt.com) — getting started and concepts
62
+ - [API reference (TikTok)](https://superagnt.com/apis/social/tiktok) — endpoints and schemas
63
+ - [Dashboard](https://app.superagnt.com/dashboard) — API keys and usage
64
+
65
+ ## Related
66
+
67
+ - **Skill (curl-oriented):** `clawhub install tiktok-data` on [ClawHub](https://clawhub.ai/superagnt/skills/tiktok-data)
68
+ - **All platforms plugin:** `@superagnt/openclaw-agnt-data` if you need LinkedIn, YouTube, TikTok, X, Instagram, Reddit, and Facebook in one package.
69
+
70
+ ## License
71
+
72
+ MIT
package/index.js ADDED
@@ -0,0 +1,585 @@
1
+ /**
2
+ * TikTok Data — OpenClaw plugin
3
+ * Auto-generated by @superagnt/clawhub. Do not edit by hand.
4
+ */
5
+
6
+ import { homedir as _homedir } from 'node:os'
7
+ import { join as _join } from 'node:path'
8
+ import { existsSync as _existsSync, readFileSync as _readFileSync } from 'node:fs'
9
+
10
+ const BASE_URL = 'https://api.superagnt.com/v1/data/tiktok'
11
+
12
+
13
+ // ── Auth Module (inlined) ────────────────────────────────────────────────────
14
+
15
+ function getConfigPath() {
16
+ return _join(_homedir(), '.superagnt', 'config.json')
17
+ }
18
+
19
+ function readAgntConfig() {
20
+ const configFile = getConfigPath()
21
+ if (!_existsSync(configFile)) return null
22
+ try {
23
+ return JSON.parse(_readFileSync(configFile, 'utf-8'))
24
+ } catch {
25
+ return null
26
+ }
27
+ }
28
+
29
+ // ── End Auth Module ──────────────────────────────────────────────────────────
30
+
31
+
32
+ // ── CLI Module (inlined) ─────────────────────────────────────────────────────
33
+
34
+ function maskApiKey(key) {
35
+ if (!key || typeof key !== 'string') return '(none)'
36
+ const k = key.trim()
37
+ if (k.length <= 8) return k.slice(0, 2) + '…'
38
+ return k.slice(0, 6) + '…' + k.slice(-4)
39
+ }
40
+
41
+ function registerAgntCli(api) {
42
+ api.registerCli(
43
+ ({ program }) => {
44
+ const cmd = program
45
+ .command('superagnt')
46
+ .description('superagnt social data API (status, doctor)')
47
+
48
+ cmd
49
+ .command('status')
50
+ .description('Show whether an API key is configured (masked)')
51
+ .action(async () => {
52
+ const cfg = readAgntConfig()
53
+ const key = cfg?.apiKey
54
+
55
+ console.log('\nsuperagnt status\n')
56
+ if (!key) {
57
+ console.log(' API key: not configured')
58
+ console.log(' Workspace: —')
59
+ console.log('\n Get your API key at: https://app.superagnt.com/dashboard\n')
60
+ return
61
+ }
62
+ console.log(' API key: ' + maskApiKey(key) + ' (from ~/.superagnt/config.json)')
63
+ console.log(' Workspace: ' + (cfg?.workspaceId ?? '—'))
64
+ console.log('')
65
+ })
66
+
67
+ cmd
68
+ .command('doctor')
69
+ .description('Check connectivity and validate API key against api.superagnt.dev')
70
+ .action(async () => {
71
+ console.log('\nsuperagnt doctor\n')
72
+
73
+ try {
74
+ const publicRes = await fetch('https://api.superagnt.com/v1/platforms')
75
+ console.log(' Public API: ' + (publicRes.ok ? 'OK (' + publicRes.status + ')' : 'HTTP ' + publicRes.status))
76
+ } catch (err) {
77
+ const msg = err instanceof Error ? err.message : String(err)
78
+ console.log(' Public API: failed — ' + msg)
79
+ }
80
+
81
+ const cfg = readAgntConfig()
82
+ const key = cfg?.apiKey
83
+
84
+ if (!key) {
85
+ console.log('\n Authenticated: skipped (no API key)')
86
+ console.log(' Get your API key at: https://app.superagnt.com/dashboard\n')
87
+ return
88
+ }
89
+
90
+ try {
91
+ const res = await fetch('https://api.superagnt.com/v1/platforms', {
92
+ headers: { Authorization: 'Bearer ' + key },
93
+ })
94
+ const text = await res.text()
95
+ let summary = 'HTTP ' + res.status
96
+ if (res.ok) {
97
+ try {
98
+ const json = JSON.parse(text)
99
+ const n = Array.isArray(json?.data) ? json.data.length : (json?.data ? Object.keys(json.data).length : 'ok')
100
+ summary = 'OK — platforms payload received (' + (typeof n === 'number' ? n + ' entries' : String(n)) + ')'
101
+ } catch {
102
+ summary = 'OK (' + res.status + ')'
103
+ }
104
+ }
105
+ console.log(' Authenticated: ' + summary)
106
+ if (!res.ok) {
107
+ console.log(' If 401, get a new key at: https://app.superagnt.com/dashboard')
108
+ }
109
+ } catch (err) {
110
+ const msg = err instanceof Error ? err.message : String(err)
111
+ console.log(' Authenticated: failed — ' + msg)
112
+ }
113
+ console.log('')
114
+ })
115
+ },
116
+ { commands: ['superagnt'] },
117
+ )
118
+ }
119
+
120
+ // ── End CLI Module ───────────────────────────────────────────────────────────
121
+
122
+
123
+ // ── System prompt (inlined) ─────────────────────────────────────────────────
124
+
125
+ function getSystemPrompt(state) {
126
+ const scope = "Only the TikTok API (tiktok)."
127
+ if (state.ready && state.toolCount > 0) {
128
+ return (
129
+ '<superagnt>\n' +
130
+ 'Ignore pretrained knowledge about superagnt tool names — use only tools that exist in this session.\n' +
131
+ '\n' +
132
+ '## What superagnt is\n' +
133
+ 'superagnt exposes **structured social-data HTTP APIs** behind OpenClaw tools. Scope for this plugin: **' + scope + '**.\n' +
134
+ '\n' +
135
+ '## When to use superagnt tools\n' +
136
+ '- Use superagnt when the user needs **live social/network data** (profiles, posts, companies, comments, etc.) from supported platforms.\n' +
137
+ '- Prefer **discovery** when unsure which endpoint fits: call public discovery (GET /v1/platforms and GET /v1/platforms/{slug}) or read tool descriptions; do not invent endpoints or parameters.\n' +
138
+ '\n' +
139
+ '## Platform selection (high level)\n' +
140
+ '- **linkedin** — B2B enrichment, org/person research, hiring/sales workflows\n' +
141
+ '- **youtube** / **tiktok** — video/creator/channel metadata and content signals\n' +
142
+ '- **x** / **reddit** — short-form social and community threads\n' +
143
+ '- **instagram** — visual/creator discovery where Instagram is the source of truth\n' +
144
+ '- **facebook** — pages/groups/marketplace/adjacent Facebook surface areas exposed by the API\n' +
145
+ '\n' +
146
+ '## Rules\n' +
147
+ '- Do **not** fabricate tool names — pick from the registered superagnt_* tools only.\n' +
148
+ '- If authentication fails (401), tell the user to get a new key at https://app.superagnt.com/dashboard\n' +
149
+ '</superagnt>'
150
+ )
151
+ }
152
+
153
+ if (state.ready && state.toolCount === 0) {
154
+ return (
155
+ '<superagnt>\n' +
156
+ 'The superagnt plugin loaded but registered **zero** API tools. Check your OpenClaw plugin packaging and regenerate the plugin from @superagnt/clawhub.\n' +
157
+ '</superagnt>'
158
+ )
159
+ }
160
+
161
+ if (state.error) {
162
+ return (
163
+ '<superagnt>\n' +
164
+ 'superagnt plugin diagnostic: ' + state.error + '\n' +
165
+ 'Do not pretend superagnt tools exist. Ask the user to fix configuration and restart the gateway.\n' +
166
+ '</superagnt>'
167
+ )
168
+ }
169
+
170
+ return (
171
+ '<superagnt>\n' +
172
+ 'superagnt tools are still loading. If the user asks for social data right now, ask them to wait a moment and retry.\n' +
173
+ '</superagnt>'
174
+ )
175
+ }
176
+
177
+ // ── End System prompt ────────────────────────────────────────────────────────
178
+
179
+ const MCP_URL = 'https://mcp.superagnt.com/mcp/tiktok'
180
+
181
+ async function mcpRpc(token, method, params) {
182
+ const res = await fetch(MCP_URL, {
183
+ method: 'POST',
184
+ headers: {
185
+ Authorization: `Bearer ${token}`,
186
+ 'Content-Type': 'application/json',
187
+ Accept: 'application/json, text/event-stream',
188
+ },
189
+ body: JSON.stringify({ jsonrpc: '2.0', id: Date.now(), method, params }),
190
+ })
191
+ if (!res.ok) throw new Error(`MCP ${method} failed: HTTP ${res.status}`)
192
+ const data = await res.json()
193
+ if (data.error) throw new Error(`MCP ${method} error: ${data.error.message}`)
194
+ return data.result
195
+ }
196
+
197
+ async function registerLiveMcpTools(api, token) {
198
+ const result = await mcpRpc(token, 'tools/list', {})
199
+ const tools = Array.isArray(result?.tools) ? result.tools : []
200
+ if (tools.length === 0) throw new Error('MCP tools/list returned no tools')
201
+ for (const t of tools) {
202
+ api.registerTool({
203
+ name: t.name,
204
+ description: t.description,
205
+ inputSchema: t.inputSchema,
206
+ execute: async (input) => {
207
+ const args = parseToolInput(input)
208
+ const r = await mcpRpc(token, 'tools/call', { name: t.name, arguments: args })
209
+ if (r && r.structuredContent !== undefined) return r.structuredContent
210
+ const text = Array.isArray(r?.content) ? r.content.find((c) => c.type === 'text')?.text : undefined
211
+ if (text === undefined) return r
212
+ try { return JSON.parse(text) } catch { return text }
213
+ },
214
+ })
215
+ }
216
+ return tools.length
217
+ }
218
+
219
+ function parseToolInput(input) {
220
+ if (input == null) return {}
221
+ if (typeof input === 'object' && !Array.isArray(input)) return input
222
+ if (typeof input === 'string') {
223
+ const trimmed = input.trim()
224
+ if (trimmed.startsWith('{')) {
225
+ try { const parsed = JSON.parse(trimmed); if (typeof parsed === 'object' && parsed && !Array.isArray(parsed)) return parsed } catch {}
226
+ }
227
+ throw new Error('Invalid tool input: expected a JSON object with named parameters, got string: ' + trimmed.slice(0, 80))
228
+ }
229
+ throw new Error('Invalid tool input: expected a JSON object, got ' + typeof input)
230
+ }
231
+
232
+ function substitutePathParams(path, source) {
233
+ if (!source || typeof source !== 'object' || Array.isArray(source)) {
234
+ return { path, consumed: new Set() }
235
+ }
236
+ const consumed = new Set()
237
+ const next = path.replace(/\{([^/{}]+)\}/g, (_, name) => {
238
+ const v = source[name]
239
+ if (v === undefined || v === null || v === '') return `{${name}}`
240
+ consumed.add(name)
241
+ return encodeURIComponent(String(v))
242
+ })
243
+ return { path: next, consumed }
244
+ }
245
+
246
+ async function callSuperagnt(apiKey, method, path, query, body) {
247
+ const params = (query && typeof query === 'object' && !Array.isArray(query)) ? query : body
248
+ const { path: resolvedPath, consumed } = substitutePathParams(path, params)
249
+ const url = new URL(`${BASE_URL}${resolvedPath}`)
250
+ if (query && typeof query === 'object' && !Array.isArray(query)) {
251
+ for (const [k, v] of Object.entries(query)) {
252
+ if (consumed.has(k)) continue
253
+ if (v !== undefined && v !== '') url.searchParams.set(k, String(v))
254
+ }
255
+ }
256
+ const filteredBody = body && typeof body === 'object' && !Array.isArray(body)
257
+ ? Object.fromEntries(Object.entries(body).filter(([k]) => !consumed.has(k)))
258
+ : body
259
+ const res = await fetch(url.toString(), {
260
+ method,
261
+ headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json' },
262
+ body: filteredBody ? JSON.stringify(filteredBody) : undefined,
263
+ })
264
+ if (res.status === 401) {
265
+ return { error: 'Invalid or expired API key. Get a new key at https://app.superagnt.com/dashboard' }
266
+ }
267
+ return res.json()
268
+ }
269
+
270
+ export default async function register(api) {
271
+ const apiKey = api.pluginConfig.apiKey || process.env.SUPERAGNT_API_KEY || readAgntConfig()?.apiKey
272
+ const mcpToken = api.pluginConfig.mcpToken || process.env.SUPERAGNT_MCP_TOKEN
273
+
274
+ function ensureApiKey() {
275
+ if (apiKey) return apiKey
276
+ throw new Error(
277
+ '[tiktok-data] No API key configured. ' +
278
+ 'Get your key at https://app.superagnt.com/dashboard and either:\n' +
279
+ ' 1. Export it as SUPERAGNT_API_KEY, or\n' +
280
+ ' 2. Add apiKey to your plugin config'
281
+ )
282
+ }
283
+
284
+ registerAgntCli(api)
285
+
286
+ const promptState = { toolCount: 0, error: '', ready: false }
287
+ api.on('before_prompt_build', () => ({
288
+ prependSystemContext: getSystemPrompt(promptState),
289
+ }))
290
+
291
+ // Live MCP mode: a workspace MCP token upgrades this plugin to the server's
292
+ // own tool surface, fetched fresh at load — it grows with agnt_tools_enable
293
+ // and never goes stale. Any failure falls back to the baked toolset below.
294
+ if (mcpToken) {
295
+ try {
296
+ promptState.toolCount = await registerLiveMcpTools(api, mcpToken)
297
+ promptState.ready = true
298
+ return
299
+ } catch (err) {
300
+ promptState.error = 'Live MCP connect failed (' + (err && err.message ? err.message : err) + '); using the built-in toolset.'
301
+ }
302
+ }
303
+
304
+ api.registerTool({
305
+ name: 'superagnt_tiktok_Video_Details_get',
306
+ description: "Video Details",
307
+ inputSchema: {
308
+ "type": "object",
309
+ "properties": {
310
+ "video_id": {
311
+ "type": "string",
312
+ "description": "video_id"
313
+ }
314
+ },
315
+ "required": [
316
+ "video_id"
317
+ ]
318
+ },
319
+ execute: async (input) => {
320
+ const key = await ensureApiKey()
321
+ const params = parseToolInput(input)
322
+ return callSuperagnt(key, 'GET', '/video/details', params)
323
+ },
324
+ })
325
+
326
+ api.registerTool({
327
+ name: 'superagnt_tiktok_Video_Details_post',
328
+ description: "Video Details",
329
+ inputSchema: {
330
+ "type": "object",
331
+ "properties": {
332
+ "video_id": {
333
+ "type": "string",
334
+ "description": "video_id"
335
+ }
336
+ },
337
+ "required": [
338
+ "video_id"
339
+ ]
340
+ },
341
+ execute: async (input) => {
342
+ const key = await ensureApiKey()
343
+ const params = parseToolInput(input)
344
+ return callSuperagnt(key, 'POST', '/video/details', undefined, params)
345
+ },
346
+ })
347
+
348
+ api.registerTool({
349
+ name: 'superagnt_tiktok_User_s_Videos_get',
350
+ description: "User's Videos",
351
+ inputSchema: {
352
+ "type": "object",
353
+ "properties": {
354
+ "username": {
355
+ "type": "string",
356
+ "description": "username"
357
+ }
358
+ },
359
+ "required": [
360
+ "username"
361
+ ]
362
+ },
363
+ execute: async (input) => {
364
+ const key = await ensureApiKey()
365
+ const params = parseToolInput(input)
366
+ return callSuperagnt(key, 'GET', '/user/videos', params)
367
+ },
368
+ })
369
+
370
+ api.registerTool({
371
+ name: 'superagnt_tiktok_User_s_Videos_post',
372
+ description: "User's Videos",
373
+ inputSchema: {
374
+ "type": "object",
375
+ "properties": {
376
+ "username": {
377
+ "type": "string",
378
+ "description": "username"
379
+ }
380
+ },
381
+ "required": [
382
+ "username"
383
+ ]
384
+ },
385
+ execute: async (input) => {
386
+ const key = await ensureApiKey()
387
+ const params = parseToolInput(input)
388
+ return callSuperagnt(key, 'POST', '/user/videos', undefined, params)
389
+ },
390
+ })
391
+
392
+ api.registerTool({
393
+ name: 'superagnt_tiktok_Collection_Videos_Details',
394
+ description: "Collection Videos/Details",
395
+ inputSchema: {
396
+ "type": "object",
397
+ "properties": {
398
+ "collection_id": {
399
+ "type": "string",
400
+ "description": "collection_id"
401
+ },
402
+ "username": {
403
+ "type": "string",
404
+ "description": "username"
405
+ }
406
+ },
407
+ "required": [
408
+ "collection_id",
409
+ "username"
410
+ ]
411
+ },
412
+ execute: async (input) => {
413
+ const key = await ensureApiKey()
414
+ const params = parseToolInput(input)
415
+ return callSuperagnt(key, 'GET', '/collection/', params)
416
+ },
417
+ })
418
+
419
+ api.registerTool({
420
+ name: 'superagnt_tiktok_User_s_Videos_Continuation',
421
+ description: "User's Videos Continuation",
422
+ inputSchema: {
423
+ "type": "object",
424
+ "properties": {
425
+ "continuation_token": {
426
+ "type": "string",
427
+ "description": "continuation_token"
428
+ },
429
+ "username": {
430
+ "type": "string",
431
+ "description": "username"
432
+ },
433
+ "secondary_id": {
434
+ "type": "string",
435
+ "description": "secondary_id"
436
+ }
437
+ },
438
+ "required": [
439
+ "continuation_token",
440
+ "username",
441
+ "secondary_id"
442
+ ]
443
+ },
444
+ execute: async (input) => {
445
+ const key = await ensureApiKey()
446
+ const params = parseToolInput(input)
447
+ return callSuperagnt(key, 'GET', '/user/videos/continuation', params)
448
+ },
449
+ })
450
+
451
+ api.registerTool({
452
+ name: 'superagnt_tiktok_User_s_Details_get',
453
+ description: "User's Details",
454
+ inputSchema: {
455
+ "type": "object",
456
+ "properties": {
457
+ "username": {
458
+ "type": "string",
459
+ "description": "username"
460
+ }
461
+ },
462
+ "required": [
463
+ "username"
464
+ ]
465
+ },
466
+ execute: async (input) => {
467
+ const key = await ensureApiKey()
468
+ const params = parseToolInput(input)
469
+ return callSuperagnt(key, 'GET', '/user/details', params)
470
+ },
471
+ })
472
+
473
+ api.registerTool({
474
+ name: 'superagnt_tiktok_User_s_Details_post',
475
+ description: "User's Details",
476
+ inputSchema: {
477
+ "type": "object",
478
+ "properties": {
479
+ "username": {
480
+ "type": "string",
481
+ "description": "username"
482
+ }
483
+ },
484
+ "required": [
485
+ "username"
486
+ ]
487
+ },
488
+ execute: async (input) => {
489
+ const key = await ensureApiKey()
490
+ const params = parseToolInput(input)
491
+ return callSuperagnt(key, 'POST', '/user/details', undefined, params)
492
+ },
493
+ })
494
+
495
+ api.registerTool({
496
+ name: 'superagnt_tiktok_Search_Accounts_get',
497
+ description: "Search Accounts",
498
+ inputSchema: {
499
+ "type": "object",
500
+ "properties": {
501
+ "query": {
502
+ "type": "string",
503
+ "description": "query"
504
+ }
505
+ },
506
+ "required": [
507
+ "query"
508
+ ]
509
+ },
510
+ execute: async (input) => {
511
+ const key = await ensureApiKey()
512
+ const params = parseToolInput(input)
513
+ return callSuperagnt(key, 'GET', '/search/accounts/query', params)
514
+ },
515
+ })
516
+
517
+ api.registerTool({
518
+ name: 'superagnt_tiktok_Search_Accounts_post',
519
+ description: "Search Accounts",
520
+ inputSchema: {
521
+ "type": "object",
522
+ "properties": {
523
+ "query": {
524
+ "type": "string",
525
+ "description": "query"
526
+ }
527
+ },
528
+ "required": [
529
+ "query"
530
+ ]
531
+ },
532
+ execute: async (input) => {
533
+ const key = await ensureApiKey()
534
+ const params = parseToolInput(input)
535
+ return callSuperagnt(key, 'POST', '/search/accounts/query', undefined, params)
536
+ },
537
+ })
538
+
539
+ api.registerTool({
540
+ name: 'superagnt_tiktok_Search_Videos_get',
541
+ description: "Search Videos",
542
+ inputSchema: {
543
+ "type": "object",
544
+ "properties": {
545
+ "query": {
546
+ "type": "string",
547
+ "description": "query"
548
+ }
549
+ },
550
+ "required": [
551
+ "query"
552
+ ]
553
+ },
554
+ execute: async (input) => {
555
+ const key = await ensureApiKey()
556
+ const params = parseToolInput(input)
557
+ return callSuperagnt(key, 'GET', '/search/general/query', params)
558
+ },
559
+ })
560
+
561
+ api.registerTool({
562
+ name: 'superagnt_tiktok_Search_Videos_post',
563
+ description: "Search Videos",
564
+ inputSchema: {
565
+ "type": "object",
566
+ "properties": {
567
+ "query": {
568
+ "type": "string",
569
+ "description": "query"
570
+ }
571
+ },
572
+ "required": [
573
+ "query"
574
+ ]
575
+ },
576
+ execute: async (input) => {
577
+ const key = await ensureApiKey()
578
+ const params = parseToolInput(input)
579
+ return callSuperagnt(key, 'POST', '/search/general/query', undefined, params)
580
+ },
581
+ })
582
+
583
+ promptState.toolCount = 12
584
+ promptState.ready = true
585
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "tiktok-data",
3
+ "name": "TikTok Data",
4
+ "description": "Unified access to video details, creator profiles, and search across accounts and videos. Built for LLMs and automation — not one-off scraping.",
5
+ "version": "2.0.2",
6
+ "configSchema": {
7
+ "type": "object",
8
+ "properties": {
9
+ "apiKey": {
10
+ "type": "string",
11
+ "description": "Your superagnt API key. Get one at https://app.superagnt.com/dashboard or store in ~/.superagnt/config.json via CLI login."
12
+ }
13
+ },
14
+ "additionalProperties": false
15
+ }
16
+ }
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@superagnt/tiktok-data",
3
+ "version": "2.0.2",
4
+ "type": "module",
5
+ "description": "Unified access to video details, creator profiles, and search across accounts and videos. Built for LLMs and automation — not one-off scraping.",
6
+ "main": "index.js",
7
+ "license": "MIT",
8
+ "homepage": "https://superagnt.com/r/npm-tiktok-data-docs",
9
+ "keywords": [
10
+ "openclaw",
11
+ "openclaw-plugin",
12
+ "superagnt",
13
+ "mcp",
14
+ "tiktok",
15
+ "social-data",
16
+ "api",
17
+ "ai-agent",
18
+ "tiktok api",
19
+ "tiktok data api",
20
+ "tiktok for ai agents",
21
+ "unified social data api",
22
+ "agent-ready api",
23
+ "mcp data source",
24
+ "structured json api"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "files": [
30
+ "index.js",
31
+ "openclaw.plugin.json",
32
+ "README.md"
33
+ ],
34
+ "openclaw": {
35
+ "extensions": [
36
+ "./index.js"
37
+ ],
38
+ "compat": {
39
+ "pluginApi": ">=2026.3.24-beta.2",
40
+ "minGatewayVersion": "2026.3.24-beta.2"
41
+ },
42
+ "build": {
43
+ "openclawVersion": "2026.3.24-beta.2",
44
+ "pluginSdkVersion": "2026.3.24-beta.2"
45
+ }
46
+ }
47
+ }