trendsagi 0.0.0-stage → 0.19.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/LICENSE +21 -0
- package/README.md +71 -2
- package/bin/trendsagi.js +4 -0
- package/cli_spec.json +799 -0
- package/package.json +47 -4
- package/src/cli.js +783 -0
package/cli_spec.json
ADDED
|
@@ -0,0 +1,799 @@
|
|
|
1
|
+
{
|
|
2
|
+
"spec_version": 1,
|
|
3
|
+
"description": "TrendsAGI command line: trending topics with measured volume, velocity and growth, AI insights, recommendations, crisis events, your watchlist, read-only SQL, webhooks, exports and ads integrations.",
|
|
4
|
+
"api_keys_url": "https://app.trendsagi.com/profile?tab=api",
|
|
5
|
+
"docs_url": "https://trendsagi.com/api-docs/integrations/cli",
|
|
6
|
+
"commands": [
|
|
7
|
+
{
|
|
8
|
+
"name": "login",
|
|
9
|
+
"handler": "login",
|
|
10
|
+
"help": "Save an API key for later commands.",
|
|
11
|
+
"options": [
|
|
12
|
+
{"flag": "with-token", "type": "flag", "help": "Read the API key from standard input instead of prompting."}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "logout",
|
|
17
|
+
"handler": "logout",
|
|
18
|
+
"help": "Forget the saved API key. The key itself keeps working until you delete it in the app."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "whoami",
|
|
22
|
+
"handler": "whoami",
|
|
23
|
+
"help": "Show the account and plan the API key belongs to, and today's API usage."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "trends",
|
|
27
|
+
"help": "Trending topics with measured volume, velocity and growth.",
|
|
28
|
+
"commands": [
|
|
29
|
+
{
|
|
30
|
+
"name": "list",
|
|
31
|
+
"aliases": ["ls"],
|
|
32
|
+
"help": "List trending topics.",
|
|
33
|
+
"method": "GET",
|
|
34
|
+
"path": "/api/trends",
|
|
35
|
+
"options": [
|
|
36
|
+
{"flag": "search", "help": "Only trends whose name matches this phrase."},
|
|
37
|
+
{"flag": "category", "help": "Only trends in this category (see 'trends categories')."},
|
|
38
|
+
{"flag": "sort", "param": "sort_by", "default": "volume", "choices": ["volume", "velocity", "growth", "timestamp", "category", "name"], "help": "Sort field."},
|
|
39
|
+
{"flag": "order", "param": "sort_dir", "choices": ["desc", "asc"], "help": "Sort direction (default desc)."},
|
|
40
|
+
{"flag": "period", "choices": ["1h", "4h", "24h", "7d", "30d", "90d", "all"], "help": "Only trends seen in this window."},
|
|
41
|
+
{"flag": "min-snapshots", "type": "int", "help": "Only trends with at least this many readings."},
|
|
42
|
+
{"flag": "has-volume", "type": "flag", "help": "Only trends with a measured volume."},
|
|
43
|
+
{"flag": "watchlist", "param": "for_user_interests", "type": "flag", "help": "Only trends that match your watchlist."},
|
|
44
|
+
{"flag": "limit", "type": "int", "default": 20, "help": "Rows to return, 1-1000."},
|
|
45
|
+
{"flag": "offset", "type": "int", "help": "Rows to skip."}
|
|
46
|
+
],
|
|
47
|
+
"table": {"rows": "trends", "columns": ["id", "name", "category", "volume", "growth", "average_velocity", "overall_trend"]}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "get",
|
|
51
|
+
"help": "Show one trend.",
|
|
52
|
+
"method": "GET",
|
|
53
|
+
"path": "/api/trends/{trend_id}",
|
|
54
|
+
"args": [{"name": "trend_id", "type": "int", "help": "Trend ID."}],
|
|
55
|
+
"table": {"kind": "object"}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "analytics",
|
|
59
|
+
"help": "Show a trend's readings over time.",
|
|
60
|
+
"method": "GET",
|
|
61
|
+
"path": "/api/trends/{trend_id}/analytics",
|
|
62
|
+
"args": [{"name": "trend_id", "type": "int", "help": "Trend ID."}],
|
|
63
|
+
"options": [
|
|
64
|
+
{"flag": "period", "help": "History window, e.g. 24h, 7d, 30d, 90d (plan dependent; default 7d)."}
|
|
65
|
+
],
|
|
66
|
+
"table": {"rows": "data", "columns": ["timestamp", "volume", "velocity"]}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "categories",
|
|
70
|
+
"help": "List trend categories.",
|
|
71
|
+
"method": "GET",
|
|
72
|
+
"path": "/api/trends/categories",
|
|
73
|
+
"table": {"rows": "categories", "columns": ["name", "trend_count"]}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "autocomplete",
|
|
77
|
+
"help": "Suggest trend names that start with a phrase.",
|
|
78
|
+
"method": "GET",
|
|
79
|
+
"path": "/api/trends/autocomplete",
|
|
80
|
+
"args": [{"name": "query", "param": "q", "in": "query", "help": "Phrase to complete."}]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "dossier",
|
|
84
|
+
"help": "Show the source-backed dossier for a trend.",
|
|
85
|
+
"method": "GET",
|
|
86
|
+
"path": "/api/trends/{trend_id}/dossier",
|
|
87
|
+
"args": [{"name": "trend_id", "type": "int", "help": "Trend ID."}],
|
|
88
|
+
"table": {"kind": "object"}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "discoveries",
|
|
92
|
+
"help": "List labels found in an external trend list (discovery evidence, not measurements).",
|
|
93
|
+
"method": "GET",
|
|
94
|
+
"path": "/api/trends/discoveries",
|
|
95
|
+
"options": [
|
|
96
|
+
{"flag": "limit", "type": "int", "default": 50, "help": "Rows to return, 1-200."}
|
|
97
|
+
],
|
|
98
|
+
"table": {"rows": "discoveries", "columns": ["label", "rank", "source", "region", "matched_trend_id"]}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "enrich",
|
|
102
|
+
"help": "Run an on-demand Deep Dive (search demand, ads or creators). Can reserve credits.",
|
|
103
|
+
"method": "POST",
|
|
104
|
+
"path": "/api/trends/{trend_id}/enrich",
|
|
105
|
+
"args": [{"name": "trend_id", "type": "int", "help": "Trend ID."}],
|
|
106
|
+
"options": [
|
|
107
|
+
{"flag": "module", "param": "modules", "type": "list", "metavar": "A,B", "help": "Modules to build: search_demand,ads,creators."},
|
|
108
|
+
{"flag": "region", "default": "US", "help": "Two-letter market code."},
|
|
109
|
+
{"flag": "force", "type": "flag", "help": "Rebuild a cached module."},
|
|
110
|
+
{"flag": "request-id", "param": "request_id", "help": "Idempotency key for the credit reservation."}
|
|
111
|
+
],
|
|
112
|
+
"confirm": "Run a Deep Dive for trend {trend_id}? It can reserve credits.",
|
|
113
|
+
"table": {"kind": "object"}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "search-demand",
|
|
117
|
+
"help": "Show the stored relative search-interest series and related queries.",
|
|
118
|
+
"method": "GET",
|
|
119
|
+
"path": "/api/trends/{trend_id}/search-demand",
|
|
120
|
+
"args": [{"name": "trend_id", "type": "int", "help": "Trend ID."}],
|
|
121
|
+
"options": [{"flag": "geo", "default": "US", "help": "Two-letter market code."}],
|
|
122
|
+
"table": {"rows": "series", "columns": ["captured_at", "interest"]}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "brand-momentum",
|
|
126
|
+
"help": "Show the brands visible in a trend's coverage and their movement.",
|
|
127
|
+
"method": "GET",
|
|
128
|
+
"path": "/api/trends/{trend_id}/brand-momentum",
|
|
129
|
+
"args": [{"name": "trend_id", "type": "int", "help": "Trend ID."}],
|
|
130
|
+
"options": [{"flag": "window", "choices": ["24h", "7d", "30d"], "default": "7d", "help": "Comparison window."}],
|
|
131
|
+
"table": {"rows": "brands", "columns": ["name", "mentions", "share", "sentiment", "delta"]}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "creators",
|
|
135
|
+
"help": "List the accounts posting most about a trend.",
|
|
136
|
+
"method": "GET",
|
|
137
|
+
"path": "/api/trends/{trend_id}/creators",
|
|
138
|
+
"args": [{"name": "trend_id", "type": "int", "help": "Trend ID."}],
|
|
139
|
+
"table": {"rows": "creators", "columns": ["screen_name", "followers_count", "posts", "profile_url"]}
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "ask",
|
|
143
|
+
"help": "Ask a grounded question about one trend.",
|
|
144
|
+
"method": "POST",
|
|
145
|
+
"path": "/api/trends/{trend_id}/ask",
|
|
146
|
+
"args": [
|
|
147
|
+
{"name": "trend_id", "type": "int", "help": "Trend ID."},
|
|
148
|
+
{"name": "question", "in": "body", "help": "Question about the trend."}
|
|
149
|
+
],
|
|
150
|
+
"table": {"kind": "object"}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "social-evidence",
|
|
154
|
+
"help": "Read or run Social Evidence for a trend.",
|
|
155
|
+
"commands": [
|
|
156
|
+
{
|
|
157
|
+
"name": "get",
|
|
158
|
+
"help": "Show the stored Social Evidence report (free).",
|
|
159
|
+
"method": "GET",
|
|
160
|
+
"path": "/api/trends/{trend_id}/social-evidence",
|
|
161
|
+
"args": [{"name": "trend_id", "type": "int", "help": "Trend ID."}],
|
|
162
|
+
"table": {"kind": "object"}
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "run",
|
|
166
|
+
"help": "Run or refresh Social Evidence (reserves one credit).",
|
|
167
|
+
"method": "POST",
|
|
168
|
+
"path": "/api/trends/{trend_id}/social-evidence",
|
|
169
|
+
"args": [{"name": "trend_id", "type": "int", "help": "Trend ID."}],
|
|
170
|
+
"options": [
|
|
171
|
+
{"flag": "module", "param": "modules", "type": "list", "metavar": "A,B", "help": "Modules: posts,transcripts,creators,comments,ads,sponsors,hashtags,mentions."},
|
|
172
|
+
{"flag": "region", "default": "US", "help": "Two-letter market code."},
|
|
173
|
+
{"flag": "force", "type": "flag", "help": "Rebuild the report."},
|
|
174
|
+
{"flag": "request-id", "param": "request_id", "help": "Idempotency key for the credit reservation."}
|
|
175
|
+
],
|
|
176
|
+
"confirm": "Run Social Evidence for trend {trend_id}? It reserves one credit.",
|
|
177
|
+
"table": {"kind": "object"}
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "credits",
|
|
185
|
+
"help": "Credit balances and one-time packs.",
|
|
186
|
+
"commands": [
|
|
187
|
+
{
|
|
188
|
+
"name": "social-evidence",
|
|
189
|
+
"help": "Show the Social Evidence credit balance.",
|
|
190
|
+
"method": "GET",
|
|
191
|
+
"path": "/api/user/social-evidence-credits",
|
|
192
|
+
"table": {"kind": "object"}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "buy-social-evidence",
|
|
196
|
+
"help": "Create a Stripe Checkout session for a Social Evidence pack.",
|
|
197
|
+
"method": "POST",
|
|
198
|
+
"path": "/api/billing/social-evidence/checkout",
|
|
199
|
+
"args": [{"name": "pack_id", "in": "body", "help": "Pack ID from 'credits social-evidence'."}],
|
|
200
|
+
"options": [
|
|
201
|
+
{"flag": "success-url", "param": "success_url", "help": "Return URL after payment."},
|
|
202
|
+
{"flag": "cancel-url", "param": "cancel_url", "help": "Return URL after cancellation."}
|
|
203
|
+
],
|
|
204
|
+
"confirm": "Create a checkout session for pack {pack_id}?",
|
|
205
|
+
"table": {"kind": "object"}
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"name": "insights",
|
|
211
|
+
"help": "AI insights: audience, sentiment and marketing angles for a trend.",
|
|
212
|
+
"commands": [
|
|
213
|
+
{
|
|
214
|
+
"name": "get",
|
|
215
|
+
"help": "Show the cached AI insights for a trend.",
|
|
216
|
+
"method": "GET",
|
|
217
|
+
"path": "/api/trends/{trend_id}/ai-insights",
|
|
218
|
+
"args": [{"name": "trend_id", "type": "int", "help": "Trend ID."}]
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "generate",
|
|
222
|
+
"help": "Queue AI insight generation for a trend (counts against your daily generation limit).",
|
|
223
|
+
"method": "POST",
|
|
224
|
+
"path": "/api/trends/{trend_id}/ai-insights/generate",
|
|
225
|
+
"handler": "insights_generate",
|
|
226
|
+
"args": [{"name": "trend_id", "type": "int", "help": "Trend ID."}],
|
|
227
|
+
"options": [
|
|
228
|
+
{"flag": "force-refresh", "type": "flag", "help": "Rebuild insights that are already cached."},
|
|
229
|
+
{"flag": "wait", "type": "flag", "local": true, "help": "Wait for the task to finish, then print the insights."},
|
|
230
|
+
{"flag": "timeout", "type": "int", "local": true, "default": 180, "help": "Seconds to wait with --wait."}
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "status",
|
|
235
|
+
"help": "Show the status of an insight generation task.",
|
|
236
|
+
"method": "GET",
|
|
237
|
+
"path": "/api/trends/ai-insights/status/{task_id}",
|
|
238
|
+
"args": [{"name": "task_id", "help": "Task ID returned by 'insights generate'."}]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "search",
|
|
242
|
+
"help": "Search trends by the content of their AI insights.",
|
|
243
|
+
"method": "GET",
|
|
244
|
+
"path": "/api/insights/search",
|
|
245
|
+
"args": [{"name": "query", "param": "q", "in": "query", "optional": true, "help": "Free text across names, categories and insight content."}],
|
|
246
|
+
"options": [
|
|
247
|
+
{"flag": "theme", "param": "keyThemeContains", "help": "Key theme contains this phrase."},
|
|
248
|
+
{"flag": "sentiment", "param": "sentimentCategory", "help": "Sentiment, e.g. positive or negative."},
|
|
249
|
+
{"flag": "audience", "param": "audienceKeyword", "help": "Target audience contains this phrase."},
|
|
250
|
+
{"flag": "limit", "type": "int", "help": "Rows to return, 1-100 (default 20)."}
|
|
251
|
+
],
|
|
252
|
+
"table": {"rows": "results", "columns": ["trend_id", "id", "name", "trend_name", "category", "sentiment_category", "key_theme"]}
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"name": "recommendations",
|
|
258
|
+
"aliases": ["recs"],
|
|
259
|
+
"help": "Prioritised, evidence-backed recommendations.",
|
|
260
|
+
"commands": [
|
|
261
|
+
{
|
|
262
|
+
"name": "list",
|
|
263
|
+
"aliases": ["ls"],
|
|
264
|
+
"help": "List recommendations. Confidence measures how complete the evidence is, not the chance an action succeeds.",
|
|
265
|
+
"method": "GET",
|
|
266
|
+
"path": "/api/intelligence/recommendations",
|
|
267
|
+
"options": [
|
|
268
|
+
{"flag": "status", "choices": ["new", "viewed", "actioned", "dismissed", "all"], "help": "Workflow status (default new)."},
|
|
269
|
+
{"flag": "priority", "choices": ["critical", "high", "medium", "low", "all"], "help": "Priority."},
|
|
270
|
+
{"flag": "type", "choices": ["pr_response", "content_idea", "marketing_angle", "seo_optimization", "influencer_collab", "product_improvement", "crm_strategy", "monitoring", "other", "all"], "help": "Recommendation type."},
|
|
271
|
+
{"flag": "trend", "param": "sourceTrendQ", "help": "Source trend name contains this phrase."},
|
|
272
|
+
{"flag": "watchlist", "param": "match_user_interests", "type": "flag", "help": "Only recommendations that match your watchlist."},
|
|
273
|
+
{"flag": "sort", "choices": ["priority", "newest"], "help": "Sort order (default priority)."},
|
|
274
|
+
{"flag": "limit", "type": "int", "help": "Rows to return, 1-100 (default 10)."},
|
|
275
|
+
{"flag": "offset", "type": "int", "help": "Rows to skip."}
|
|
276
|
+
],
|
|
277
|
+
"table": {"rows": "recommendations", "columns": ["id", "priority", "status", "type", "title", "source_trend_name"]}
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "action",
|
|
281
|
+
"help": "Move a recommendation to a workflow status.",
|
|
282
|
+
"method": "POST",
|
|
283
|
+
"path": "/api/intelligence/recommendations/{recommendation_id}/action",
|
|
284
|
+
"args": [
|
|
285
|
+
{"name": "recommendation_id", "type": "int", "help": "Recommendation ID."},
|
|
286
|
+
{"name": "action", "in": "body", "choices": ["new", "viewed", "actioned", "dismissed"], "help": "New status."}
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"name": "feedback",
|
|
291
|
+
"help": "Send feedback on a recommendation (500 characters at most).",
|
|
292
|
+
"method": "POST",
|
|
293
|
+
"path": "/api/intelligence/recommendations/{recommendation_id}/action",
|
|
294
|
+
"args": [
|
|
295
|
+
{"name": "recommendation_id", "type": "int", "help": "Recommendation ID."},
|
|
296
|
+
{"name": "feedback", "in": "body", "help": "Your feedback."}
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"name": "crisis",
|
|
303
|
+
"help": "Crisis events detected for your brand and watchlist.",
|
|
304
|
+
"commands": [
|
|
305
|
+
{
|
|
306
|
+
"name": "list",
|
|
307
|
+
"aliases": ["ls"],
|
|
308
|
+
"help": "List crisis events.",
|
|
309
|
+
"method": "GET",
|
|
310
|
+
"path": "/api/intelligence/crisis-events",
|
|
311
|
+
"options": [
|
|
312
|
+
{"flag": "status", "help": "Event status, e.g. active, acknowledged or archived."},
|
|
313
|
+
{"flag": "severity", "help": "Severity, e.g. low, medium, high or critical."},
|
|
314
|
+
{"flag": "keyword", "help": "Title or keyword contains this phrase."},
|
|
315
|
+
{"flag": "range", "param": "timeRange", "help": "Time window, e.g. 24h (default), 7d, 30d."},
|
|
316
|
+
{"flag": "start", "param": "startDate", "metavar": "DATE", "help": "Start date (YYYY-MM-DD)."},
|
|
317
|
+
{"flag": "end", "param": "endDate", "metavar": "DATE", "help": "End date (YYYY-MM-DD)."},
|
|
318
|
+
{"flag": "limit", "type": "int", "help": "Rows to return (default 10)."},
|
|
319
|
+
{"flag": "offset", "type": "int", "help": "Rows to skip."}
|
|
320
|
+
],
|
|
321
|
+
"table": {"rows": "events", "columns": ["id", "severity", "status", "title", "detected_at"]}
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"name": "action",
|
|
325
|
+
"help": "Acknowledge, archive or reopen a crisis event.",
|
|
326
|
+
"method": "POST",
|
|
327
|
+
"path": "/api/intelligence/crisis-events/{event_id}/action",
|
|
328
|
+
"args": [
|
|
329
|
+
{"name": "event_id", "type": "int", "help": "Crisis event ID."},
|
|
330
|
+
{"name": "action", "in": "body", "choices": ["acknowledge", "archive", "reopen"], "help": "What to do."}
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"name": "watchlist",
|
|
337
|
+
"help": "Topics you track, with optional alerts.",
|
|
338
|
+
"commands": [
|
|
339
|
+
{
|
|
340
|
+
"name": "list",
|
|
341
|
+
"aliases": ["ls"],
|
|
342
|
+
"help": "List your watchlist.",
|
|
343
|
+
"method": "GET",
|
|
344
|
+
"path": "/api/user/interests",
|
|
345
|
+
"table": {"rows": "", "columns": ["id", "keyword", "category", "alert_condition_type", "volume_threshold_value", "percentage_growth_value", "status"]}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"name": "add",
|
|
349
|
+
"help": "Track a keyword or a category.",
|
|
350
|
+
"method": "POST",
|
|
351
|
+
"path": "/api/user/interests",
|
|
352
|
+
"args": [{"name": "keyword", "in": "body", "optional": true, "help": "Keyword to track. Omit it and pass --category to track a category."}],
|
|
353
|
+
"options": [
|
|
354
|
+
{"flag": "category", "help": "Track a whole category instead of a keyword."},
|
|
355
|
+
{"flag": "alert", "param": "alert_condition_type", "choices": ["volume_threshold", "percentage_growth"], "help": "Alert condition (default volume_threshold)."},
|
|
356
|
+
{"flag": "threshold", "param": "volume_threshold_value", "type": "int", "help": "Alert when volume reaches this value."},
|
|
357
|
+
{"flag": "growth", "param": "percentage_growth_value", "type": "float", "help": "Alert when growth reaches this percentage."},
|
|
358
|
+
{"flag": "min-volume", "param": "min_volume_for_growth_alert", "type": "int", "help": "Minimum volume before a growth alert fires."},
|
|
359
|
+
{"flag": "repeat", "param": "alert_behavior", "type": "flag", "value": "notify_repeating", "help": "Alert every time the condition holds, not just once."},
|
|
360
|
+
{"flag": "email", "param": "send_email_alerts", "type": "flag", "help": "Send alerts by email."},
|
|
361
|
+
{"flag": "slack", "param": "send_slack_alerts", "type": "flag", "help": "Send alerts to Slack."}
|
|
362
|
+
],
|
|
363
|
+
"require_one_of": ["keyword", "category"]
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "remove",
|
|
367
|
+
"aliases": ["rm"],
|
|
368
|
+
"help": "Stop tracking a watchlist item.",
|
|
369
|
+
"method": "DELETE",
|
|
370
|
+
"path": "/api/user/interests/{interest_id}",
|
|
371
|
+
"args": [{"name": "interest_id", "type": "int", "help": "Watchlist item ID (see 'watchlist list')."}]
|
|
372
|
+
}
|
|
373
|
+
]
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"name": "sql",
|
|
377
|
+
"help": "Run one read-only PostgreSQL SELECT over your TrendsAGI data (see 'schema').",
|
|
378
|
+
"method": "POST",
|
|
379
|
+
"path": "/api/agent/sql",
|
|
380
|
+
"handler": "sql",
|
|
381
|
+
"args": [{"name": "query", "in": "body", "stdin": true, "help": "The SELECT to run, or - to read it from standard input."}],
|
|
382
|
+
"options": [
|
|
383
|
+
{"flag": "max-rows", "param": "max_rows", "type": "int", "help": "Rows to return, 1-1000 (default 100)."}
|
|
384
|
+
]
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"name": "schema",
|
|
388
|
+
"help": "Describe the tables 'sql' can query, with example questions.",
|
|
389
|
+
"method": "GET",
|
|
390
|
+
"path": "/api/agent/schema",
|
|
391
|
+
"table": {"rows": "tables", "columns": ["name", "description", "requires"]}
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "find",
|
|
395
|
+
"help": "Ask whether TrendsAGI can do a task, and where.",
|
|
396
|
+
"method": "GET",
|
|
397
|
+
"path": "/api/agent/capabilities",
|
|
398
|
+
"args": [{"name": "goal", "in": "query", "help": "The task in a few words, e.g. \"alert me when a topic spikes\"."}],
|
|
399
|
+
"table": {"rows": "matches", "columns": ["capability", "summary", "url"]}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "tools",
|
|
403
|
+
"help": "The agent tools the TrendsAGI MCP server exposes.",
|
|
404
|
+
"commands": [
|
|
405
|
+
{
|
|
406
|
+
"name": "list",
|
|
407
|
+
"aliases": ["ls"],
|
|
408
|
+
"help": "List the agent tools.",
|
|
409
|
+
"method": "GET",
|
|
410
|
+
"path": "/api/agent/tools",
|
|
411
|
+
"auth": false,
|
|
412
|
+
"table": {"rows": "tools", "columns": ["name", "description"]}
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"name": "call",
|
|
416
|
+
"help": "Call an agent tool and print its result.",
|
|
417
|
+
"method": "POST",
|
|
418
|
+
"path": "/api/agent/tools/{name}",
|
|
419
|
+
"handler": "tools_call",
|
|
420
|
+
"args": [{"name": "name", "help": "Tool name from 'tools list', e.g. list_trends."}],
|
|
421
|
+
"options": [
|
|
422
|
+
{"flag": "args", "type": "json", "local": true, "metavar": "JSON", "help": "Tool arguments as a JSON object."},
|
|
423
|
+
{"flag": "arg", "short": "a", "type": "pairs", "local": true, "metavar": "KEY=VALUE", "help": "One tool argument; repeat for more. Values are parsed as JSON when they can be."}
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"name": "usage",
|
|
430
|
+
"help": "Show your API usage for the last 30 days.",
|
|
431
|
+
"method": "GET",
|
|
432
|
+
"path": "/api/user/api-usage",
|
|
433
|
+
"table": {"summary": "summary", "rows": "daily_data", "columns": ["date", "request_count"]}
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"name": "status",
|
|
437
|
+
"help": "Show the operational status of the TrendsAGI API.",
|
|
438
|
+
"method": "GET",
|
|
439
|
+
"path": "/status",
|
|
440
|
+
"auth": false
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"name": "webhooks",
|
|
444
|
+
"help": "Webhooks that POST trend events to your URL.",
|
|
445
|
+
"commands": [
|
|
446
|
+
{
|
|
447
|
+
"name": "list",
|
|
448
|
+
"aliases": ["ls"],
|
|
449
|
+
"help": "List webhooks.",
|
|
450
|
+
"method": "GET",
|
|
451
|
+
"path": "/api/integrations/webhooks",
|
|
452
|
+
"table": {"rows": "", "columns": ["id", "url", "trigger_type", "delivery_mode", "threshold_value", "is_active"]}
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"name": "create",
|
|
456
|
+
"help": "Create a webhook.",
|
|
457
|
+
"method": "POST",
|
|
458
|
+
"path": "/api/integrations/webhooks",
|
|
459
|
+
"data": true,
|
|
460
|
+
"options": [
|
|
461
|
+
{"flag": "url", "required": true, "help": "Destination URL."},
|
|
462
|
+
{"flag": "trigger", "param": "trigger_type", "required": true, "choices": ["trend_velocity", "trend_category"], "help": "What fires the webhook."},
|
|
463
|
+
{"flag": "mode", "param": "delivery_mode", "choices": ["threshold", "instant_stream"], "help": "Delivery mode; trend_category needs instant_stream."},
|
|
464
|
+
{"flag": "threshold", "param": "threshold_value", "type": "float", "help": "Threshold for threshold delivery."},
|
|
465
|
+
{"flag": "keywords", "type": "list", "metavar": "A,B", "help": "Comma-separated keywords (category names for trend_category)."},
|
|
466
|
+
{"flag": "cooldown", "param": "cooldown_seconds", "type": "int", "help": "Seconds between deliveries (default 60)."}
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "update",
|
|
471
|
+
"help": "Change a webhook.",
|
|
472
|
+
"method": "PATCH",
|
|
473
|
+
"path": "/api/integrations/webhooks/{id}",
|
|
474
|
+
"data": true,
|
|
475
|
+
"args": [{"name": "id", "type": "int", "help": "Webhook ID."}],
|
|
476
|
+
"options": [
|
|
477
|
+
{"flag": "url", "help": "Destination URL."},
|
|
478
|
+
{"flag": "trigger", "param": "trigger_type", "choices": ["trend_velocity", "trend_category"], "help": "What fires the webhook."},
|
|
479
|
+
{"flag": "mode", "param": "delivery_mode", "choices": ["threshold", "instant_stream"], "help": "Delivery mode."},
|
|
480
|
+
{"flag": "threshold", "param": "threshold_value", "type": "float", "help": "Threshold for threshold delivery."},
|
|
481
|
+
{"flag": "keywords", "type": "list", "metavar": "A,B", "help": "Comma-separated keywords."},
|
|
482
|
+
{"flag": "cooldown", "param": "cooldown_seconds", "type": "int", "help": "Seconds between deliveries."},
|
|
483
|
+
{"flag": "active", "param": "is_active", "type": "bool", "help": "true to enable, false to pause."}
|
|
484
|
+
]
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"name": "delete",
|
|
488
|
+
"aliases": ["rm"],
|
|
489
|
+
"help": "Delete a webhook.",
|
|
490
|
+
"method": "DELETE",
|
|
491
|
+
"path": "/api/integrations/webhooks/{id}",
|
|
492
|
+
"args": [{"name": "id", "type": "int", "help": "Webhook ID."}],
|
|
493
|
+
"confirm": "Delete webhook {id}?"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"name": "test",
|
|
497
|
+
"help": "Send a test delivery to a webhook.",
|
|
498
|
+
"method": "POST",
|
|
499
|
+
"path": "/api/integrations/webhooks/{id}/test",
|
|
500
|
+
"args": [{"name": "id", "type": "int", "help": "Webhook ID."}]
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"name": "rotate-secret",
|
|
504
|
+
"help": "Issue a new signing secret. Receivers that verify the old secret fail until updated.",
|
|
505
|
+
"method": "POST",
|
|
506
|
+
"path": "/api/integrations/webhooks/{id}/rotate-secret",
|
|
507
|
+
"args": [{"name": "id", "type": "int", "help": "Webhook ID."}],
|
|
508
|
+
"confirm": "Rotate the signing secret of webhook {id}? Receivers using the old secret will reject deliveries."
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"name": "executions",
|
|
512
|
+
"help": "Show recent deliveries of a webhook.",
|
|
513
|
+
"method": "GET",
|
|
514
|
+
"path": "/api/integrations/webhooks/{id}/executions",
|
|
515
|
+
"args": [{"name": "id", "type": "int", "help": "Webhook ID."}],
|
|
516
|
+
"options": [{"flag": "limit", "type": "int", "help": "Rows to return, 1-200 (default 50)."}],
|
|
517
|
+
"table": {"rows": "", "columns": ["id", "success", "status_code", "duration_ms", "executed_at", "error_message"]}
|
|
518
|
+
}
|
|
519
|
+
]
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"name": "exports",
|
|
523
|
+
"help": "Exports of TrendsAGI data to your cloud storage or warehouse.",
|
|
524
|
+
"commands": [
|
|
525
|
+
{
|
|
526
|
+
"name": "list",
|
|
527
|
+
"aliases": ["ls"],
|
|
528
|
+
"help": "List export configurations.",
|
|
529
|
+
"method": "GET",
|
|
530
|
+
"path": "/api/user/export/settings",
|
|
531
|
+
"table": {"rows": "", "columns": ["id", "destination", "schedule", "is_active", "report_kind"]}
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"name": "get",
|
|
535
|
+
"help": "Show one export configuration.",
|
|
536
|
+
"method": "GET",
|
|
537
|
+
"path": "/api/user/export/configurations/{config_id}",
|
|
538
|
+
"args": [{"name": "config_id", "type": "int", "help": "Export configuration ID."}]
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"name": "create",
|
|
542
|
+
"help": "Create an export configuration.",
|
|
543
|
+
"method": "POST",
|
|
544
|
+
"path": "/api/user/export/settings",
|
|
545
|
+
"data": true,
|
|
546
|
+
"options": [
|
|
547
|
+
{"flag": "destination", "help": "Destination, e.g. aws, azure, gcp or snowflake."},
|
|
548
|
+
{"flag": "config", "type": "json", "metavar": "JSON", "help": "Destination settings as JSON (or @file.json)."},
|
|
549
|
+
{"flag": "fields", "param": "selected_fields", "type": "list", "metavar": "A,B", "help": "Comma-separated field IDs to export."},
|
|
550
|
+
{"flag": "schedule", "help": "manual (exports run with 'exports run')."}
|
|
551
|
+
]
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"name": "update",
|
|
555
|
+
"help": "Replace an export configuration's settings.",
|
|
556
|
+
"method": "PUT",
|
|
557
|
+
"path": "/api/user/export/configurations/{config_id}",
|
|
558
|
+
"data": true,
|
|
559
|
+
"args": [{"name": "config_id", "type": "int", "help": "Export configuration ID."}],
|
|
560
|
+
"options": [
|
|
561
|
+
{"flag": "destination", "help": "Destination."},
|
|
562
|
+
{"flag": "config", "type": "json", "metavar": "JSON", "help": "Destination settings as JSON; unchanged secrets may be omitted."},
|
|
563
|
+
{"flag": "fields", "param": "selected_fields", "type": "list", "metavar": "A,B", "help": "Comma-separated field IDs."},
|
|
564
|
+
{"flag": "schedule", "help": "manual"},
|
|
565
|
+
{"flag": "active", "param": "is_active", "type": "bool", "help": "true or false."}
|
|
566
|
+
]
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"name": "delete",
|
|
570
|
+
"aliases": ["rm"],
|
|
571
|
+
"help": "Delete an export configuration.",
|
|
572
|
+
"method": "DELETE",
|
|
573
|
+
"path": "/api/user/export/settings/{config_id}",
|
|
574
|
+
"args": [{"name": "config_id", "type": "int", "help": "Export configuration ID."}],
|
|
575
|
+
"confirm": "Delete export configuration {config_id}?"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"name": "run",
|
|
579
|
+
"help": "Run an export now.",
|
|
580
|
+
"method": "POST",
|
|
581
|
+
"path": "/api/user/export/configurations/{config_id}/run-now",
|
|
582
|
+
"args": [{"name": "config_id", "type": "int", "help": "Export configuration ID."}]
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"name": "history",
|
|
586
|
+
"help": "Show past export runs.",
|
|
587
|
+
"method": "GET",
|
|
588
|
+
"path": "/api/user/export/history",
|
|
589
|
+
"options": [
|
|
590
|
+
{"flag": "limit", "type": "int", "help": "Rows to return, 1-100 (default 20)."},
|
|
591
|
+
{"flag": "offset", "type": "int", "help": "Rows to skip."}
|
|
592
|
+
],
|
|
593
|
+
"table": {"rows": "history", "columns": ["id", "execution_time", "destination", "status", "records_exported", "message"]}
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
"name": "usage",
|
|
597
|
+
"help": "Show export usage against your plan.",
|
|
598
|
+
"method": "GET",
|
|
599
|
+
"path": "/api/user/export/usage"
|
|
600
|
+
}
|
|
601
|
+
]
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"name": "ads",
|
|
605
|
+
"help": "Connected ad accounts: resources, trend-based previews and changes, and reports.",
|
|
606
|
+
"commands": [
|
|
607
|
+
{
|
|
608
|
+
"name": "providers",
|
|
609
|
+
"help": "List ad platforms and their connection status.",
|
|
610
|
+
"method": "GET",
|
|
611
|
+
"path": "/api/integrations/ads/providers",
|
|
612
|
+
"table": {"rows": "providers", "columns": ["platform", "display_name", "configured", "is_connected", "last_synced_at"]}
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
"name": "resources",
|
|
616
|
+
"help": "List accounts, campaigns, ad groups and ads on a connected platform.",
|
|
617
|
+
"method": "GET",
|
|
618
|
+
"path": "/api/integrations/ads/{platform}/resources",
|
|
619
|
+
"args": [{"name": "platform", "choices": ["google_ads", "meta_ads", "tiktok_ads", "linkedin_ads", "microsoft_ads", "snapchat_ads", "pinterest_ads"], "help": "Ad platform."}],
|
|
620
|
+
"options": [
|
|
621
|
+
{"flag": "account", "param": "account_id", "help": "Scope to an account."},
|
|
622
|
+
{"flag": "campaign", "param": "campaign_id", "help": "Scope to a campaign."},
|
|
623
|
+
{"flag": "ad-group", "param": "ad_group_id", "help": "Scope to an ad group or ad set."},
|
|
624
|
+
{"flag": "client", "param": "client_id", "help": "Scope to a client mapping."}
|
|
625
|
+
]
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"name": "preview",
|
|
629
|
+
"help": "Preview trend-based changes to a campaign, ad group or ad. Changes nothing.",
|
|
630
|
+
"method": "POST",
|
|
631
|
+
"path": "/api/integrations/ads/{platform}/preview",
|
|
632
|
+
"data": true,
|
|
633
|
+
"args": [{"name": "platform", "choices": ["google_ads", "meta_ads", "tiktok_ads", "linkedin_ads", "microsoft_ads", "snapchat_ads", "pinterest_ads"], "help": "Ad platform."}],
|
|
634
|
+
"options": [
|
|
635
|
+
{"flag": "trend", "param": "trend_id", "type": "int", "required": true, "help": "Trend ID to build the change from."},
|
|
636
|
+
{"flag": "level", "param": "apply_level", "choices": ["campaign", "ad_group", "ad"], "help": "Level to change."},
|
|
637
|
+
{"flag": "account", "param": "account_id", "help": "Account ID."},
|
|
638
|
+
{"flag": "campaign", "param": "campaign_id", "help": "Campaign ID."},
|
|
639
|
+
{"flag": "ad-group", "param": "ad_group_id", "help": "Ad group or ad set ID."},
|
|
640
|
+
{"flag": "ad", "param": "ad_id", "help": "Ad ID."},
|
|
641
|
+
{"flag": "strict-safety", "param": "strict_safety", "type": "bool", "help": "Guardrails (default true)."}
|
|
642
|
+
]
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"name": "apply",
|
|
646
|
+
"help": "Apply trend-based changes to live ads. Run 'ads preview' with the same options first.",
|
|
647
|
+
"method": "POST",
|
|
648
|
+
"path": "/api/integrations/ads/{platform}/apply",
|
|
649
|
+
"data": true,
|
|
650
|
+
"args": [{"name": "platform", "choices": ["google_ads", "meta_ads", "tiktok_ads", "linkedin_ads", "microsoft_ads", "snapchat_ads", "pinterest_ads"], "help": "Ad platform."}],
|
|
651
|
+
"options": [
|
|
652
|
+
{"flag": "trend", "param": "trend_id", "type": "int", "required": true, "help": "Trend ID to build the change from."},
|
|
653
|
+
{"flag": "level", "param": "apply_level", "choices": ["campaign", "ad_group", "ad"], "help": "Level to change."},
|
|
654
|
+
{"flag": "account", "param": "account_id", "help": "Account ID."},
|
|
655
|
+
{"flag": "campaign", "param": "campaign_id", "help": "Campaign ID."},
|
|
656
|
+
{"flag": "ad-group", "param": "ad_group_id", "help": "Ad group or ad set ID."},
|
|
657
|
+
{"flag": "ad", "param": "ad_id", "help": "Ad ID."},
|
|
658
|
+
{"flag": "strict-safety", "param": "strict_safety", "type": "bool", "help": "Guardrails (default true)."}
|
|
659
|
+
],
|
|
660
|
+
"confirm": "Apply changes to live ads in your {platform} account?"
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"name": "streams",
|
|
664
|
+
"help": "List the trend-to-ads stream configurations for a platform.",
|
|
665
|
+
"method": "GET",
|
|
666
|
+
"path": "/api/integrations/ads/{platform}/stream-configs",
|
|
667
|
+
"args": [{"name": "platform", "choices": ["google_ads", "meta_ads", "tiktok_ads", "linkedin_ads", "microsoft_ads", "snapchat_ads", "pinterest_ads"], "help": "Ad platform."}],
|
|
668
|
+
"options": [{"flag": "client", "param": "client_id", "help": "Scope to a client mapping."}]
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"name": "update-stream",
|
|
672
|
+
"help": "Change a trend-to-ads stream configuration.",
|
|
673
|
+
"method": "PUT",
|
|
674
|
+
"path": "/api/integrations/ads/{platform}/stream-configs/{stream_id}",
|
|
675
|
+
"data": true,
|
|
676
|
+
"args": [
|
|
677
|
+
{"name": "platform", "choices": ["google_ads", "meta_ads", "tiktok_ads", "linkedin_ads", "microsoft_ads", "snapchat_ads", "pinterest_ads"], "help": "Ad platform."},
|
|
678
|
+
{"name": "stream_id", "type": "int", "help": "Stream ID (see 'ads streams')."}
|
|
679
|
+
],
|
|
680
|
+
"options": [
|
|
681
|
+
{"flag": "mode", "choices": ["preview", "apply"], "help": "preview proposes changes; apply makes them."},
|
|
682
|
+
{"flag": "level", "param": "apply_level", "choices": ["campaign", "ad_group", "ad"], "help": "Level to change."},
|
|
683
|
+
{"flag": "account", "param": "account_id", "help": "Account ID."},
|
|
684
|
+
{"flag": "campaign", "param": "campaign_id", "help": "Campaign ID."},
|
|
685
|
+
{"flag": "ad-group", "param": "ad_group_id", "help": "Ad group or ad set ID."},
|
|
686
|
+
{"flag": "category", "param": "trend_category", "help": "Trend category that feeds the stream."},
|
|
687
|
+
{"flag": "client", "param": "client_id", "help": "Client mapping."},
|
|
688
|
+
{"flag": "strict-safety", "param": "strict_safety", "type": "bool", "help": "Guardrails (recommended true)."}
|
|
689
|
+
]
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
"name": "report-catalog",
|
|
693
|
+
"help": "List report templates and fields for a platform.",
|
|
694
|
+
"method": "GET",
|
|
695
|
+
"path": "/api/integrations/ads/reporting/catalog",
|
|
696
|
+
"args": [{"name": "platform", "in": "query", "choices": ["google_ads", "meta_ads", "tiktok_ads", "linkedin_ads", "microsoft_ads", "snapchat_ads", "pinterest_ads"], "help": "Ad platform."}],
|
|
697
|
+
"options": [{"flag": "client", "param": "client_id", "help": "Client mapping."}]
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
"name": "report",
|
|
701
|
+
"help": "Preview a performance report.",
|
|
702
|
+
"method": "POST",
|
|
703
|
+
"path": "/api/integrations/ads/reporting/preview",
|
|
704
|
+
"data": true,
|
|
705
|
+
"args": [{"name": "platform", "in": "body", "choices": ["google_ads", "meta_ads", "tiktok_ads", "linkedin_ads", "microsoft_ads", "snapchat_ads", "pinterest_ads"], "help": "Ad platform."}],
|
|
706
|
+
"options": [
|
|
707
|
+
{"flag": "level", "required": true, "choices": ["campaign", "ad_group", "ad"], "help": "Report level."},
|
|
708
|
+
{"flag": "start", "param": "date_range.start_date", "required": true, "metavar": "DATE", "help": "Start date (YYYY-MM-DD)."},
|
|
709
|
+
{"flag": "end", "param": "date_range.end_date", "required": true, "metavar": "DATE", "help": "End date (YYYY-MM-DD)."},
|
|
710
|
+
{"flag": "account", "param": "scope.account_id", "required": true, "help": "Account ID."},
|
|
711
|
+
{"flag": "client", "param": "scope.client_id", "help": "Client mapping."},
|
|
712
|
+
{"flag": "template", "param": "template_id", "help": "Template (default performance_overview)."},
|
|
713
|
+
{"flag": "fields", "type": "list", "metavar": "A,B", "help": "Comma-separated fields instead of the template's."}
|
|
714
|
+
]
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
"name": "report-export",
|
|
718
|
+
"help": "Download a performance report as CSV.",
|
|
719
|
+
"method": "POST",
|
|
720
|
+
"path": "/api/integrations/ads/reporting/export",
|
|
721
|
+
"data": true,
|
|
722
|
+
"output": "raw",
|
|
723
|
+
"args": [{"name": "platform", "in": "body", "choices": ["google_ads", "meta_ads", "tiktok_ads", "linkedin_ads", "microsoft_ads", "snapchat_ads", "pinterest_ads"], "help": "Ad platform."}],
|
|
724
|
+
"options": [
|
|
725
|
+
{"flag": "level", "required": true, "choices": ["campaign", "ad_group", "ad"], "help": "Report level."},
|
|
726
|
+
{"flag": "start", "param": "date_range.start_date", "required": true, "metavar": "DATE", "help": "Start date (YYYY-MM-DD)."},
|
|
727
|
+
{"flag": "end", "param": "date_range.end_date", "required": true, "metavar": "DATE", "help": "End date (YYYY-MM-DD)."},
|
|
728
|
+
{"flag": "account", "param": "scope.account_id", "required": true, "help": "Account ID."},
|
|
729
|
+
{"flag": "client", "param": "scope.client_id", "help": "Client mapping."},
|
|
730
|
+
{"flag": "template", "param": "template_id", "help": "Template (default performance_overview)."},
|
|
731
|
+
{"flag": "fields", "type": "list", "metavar": "A,B", "help": "Comma-separated fields instead of the template's."},
|
|
732
|
+
{"flag": "out", "short": "o", "local": true, "metavar": "FILE", "help": "Write the CSV to this file instead of standard output."}
|
|
733
|
+
]
|
|
734
|
+
}
|
|
735
|
+
]
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
"name": "integrations",
|
|
739
|
+
"help": "Connected integrations: availability, status and delivery health.",
|
|
740
|
+
"commands": [
|
|
741
|
+
{
|
|
742
|
+
"name": "availability",
|
|
743
|
+
"help": "Show which integrations your plan includes.",
|
|
744
|
+
"method": "GET",
|
|
745
|
+
"path": "/api/integrations/availability"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"name": "status",
|
|
749
|
+
"help": "Show the connection status of an integration.",
|
|
750
|
+
"method": "GET",
|
|
751
|
+
"path": "/api/integrations/{provider}/status",
|
|
752
|
+
"args": [{"name": "provider", "choices": ["slack", "shopify", "meta-capi", "reddit-ads", "bigquery", "google-sheets", "n8n"], "help": "Integration."}]
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
"name": "health",
|
|
756
|
+
"help": "Show delivery health across integrations.",
|
|
757
|
+
"method": "GET",
|
|
758
|
+
"path": "/api/integrations/delivery/health",
|
|
759
|
+
"options": [
|
|
760
|
+
{"flag": "hours", "param": "lookback_hours", "type": "int", "help": "Lookback window in hours (default 168)."},
|
|
761
|
+
{"flag": "provider", "help": "One provider, e.g. meta_capi, shopify or n8n."}
|
|
762
|
+
]
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"name": "value",
|
|
766
|
+
"help": "Summarise what integrations delivered.",
|
|
767
|
+
"method": "GET",
|
|
768
|
+
"path": "/api/integrations/value/summary",
|
|
769
|
+
"options": [
|
|
770
|
+
{"flag": "hours", "param": "lookback_hours", "type": "int", "help": "Lookback window in hours (default 168)."},
|
|
771
|
+
{"flag": "provider", "help": "One provider."}
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
]
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
"name": "stream",
|
|
778
|
+
"handler": "stream",
|
|
779
|
+
"help": "Print live trend updates as JSON lines until interrupted.",
|
|
780
|
+
"options": [
|
|
781
|
+
{"flag": "follow", "type": "list", "metavar": "A,B", "help": "Only these trend names."},
|
|
782
|
+
{"flag": "category", "help": "Only trends in this category."}
|
|
783
|
+
]
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
"name": "api",
|
|
787
|
+
"handler": "api",
|
|
788
|
+
"help": "Call any API endpoint, like 'trendsagi api /api/trends -q limit=5'.",
|
|
789
|
+
"args": [{"name": "path", "help": "Endpoint path, e.g. /api/trends."}],
|
|
790
|
+
"options": [
|
|
791
|
+
{"flag": "method", "short": "X", "metavar": "METHOD", "help": "HTTP method (default GET, or POST when a body is given)."},
|
|
792
|
+
{"flag": "query", "short": "q", "type": "pairs", "metavar": "KEY=VALUE", "help": "Query parameter; repeat for more."},
|
|
793
|
+
{"flag": "field", "short": "f", "type": "pairs", "metavar": "KEY=VALUE", "help": "JSON body field; repeat for more. Values are parsed as JSON when they can be."},
|
|
794
|
+
{"flag": "data", "short": "d", "type": "json", "metavar": "JSON", "help": "JSON body, @file.json, or - for standard input."},
|
|
795
|
+
{"flag": "no-auth", "type": "flag", "help": "Send the request without the API key."}
|
|
796
|
+
]
|
|
797
|
+
}
|
|
798
|
+
]
|
|
799
|
+
}
|