creatorriver 0.6.2 → 0.8.1
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 +17 -4
- package/dist/creatorriver.js +464 -41
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# creatorriver
|
|
2
2
|
|
|
3
|
-
Search 10M+ YouTube, TikTok and
|
|
3
|
+
Search 10M+ YouTube, TikTok, Instagram and X creators in plain language, every one with a contact email, and run outreach from your terminal or AI agent, using [Creator River](https://www.creatorriver.com). Searching is free; you spend credits when you open a creator, reveal an email (refunded if it bounces) or send more than the free daily emails. 100 credits cost $1, and new accounts get 30 free.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npx creatorriver --help
|
|
@@ -22,23 +22,36 @@ Behind a proxy, set `HTTPS_PROXY` (and `NO_PROXY` for hosts to reach directly).
|
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
creatorriver account
|
|
25
|
+
creatorriver pricing --charged-only
|
|
26
|
+
creatorriver credits --days 30
|
|
25
27
|
creatorriver campaigns create --brief "Skincare brand looking for US beauty creators" --status active
|
|
26
28
|
creatorriver creators search --query "US beauty creators reviewing skincare" --platforms youtube,tiktok --campaign-id <campaign-id>
|
|
29
|
+
creatorriver creators search --query "AI and SaaS founders sharing product launches" --platforms x
|
|
27
30
|
creatorriver searches expand --search-id <search-id> --limit 40
|
|
28
31
|
creatorriver creators browse --platforms youtube --markets us --offset 20 --limit 20
|
|
29
32
|
creatorriver creators browse --campaign-id <campaign-id> --limit 20
|
|
30
33
|
creatorriver creators find --reference "Marques Brownlee"
|
|
31
34
|
creatorriver trends videos --platform tiktok --window 24h
|
|
32
35
|
creatorriver trends hashtags --platform tiktok
|
|
36
|
+
creatorriver lists create --name "Q4 Skincare Shortlist"
|
|
37
|
+
creatorriver lists add --list-id <list-id> --creator-ids <first-id>,<second-id>
|
|
38
|
+
creatorriver exports preview --list-id <list-id>
|
|
39
|
+
creatorriver exports prepare --creator-ids <first-id>,<second-id>
|
|
40
|
+
creatorriver lists export --list-id <list-id>
|
|
41
|
+
creatorriver campaigns export --campaign-id <campaign-id> --no-include-email
|
|
33
42
|
creatorriver contacts reveal --campaign-id <campaign-id> --creator-id <creator-id>
|
|
34
|
-
creatorriver contacts reveal-batch --campaign-id <campaign-id> --creator-ids <first-id>,<second-id>
|
|
43
|
+
creatorriver contacts reveal-batch --campaign-id <campaign-id> --creator-ids <first-id>,<second-id> --dry-run
|
|
35
44
|
creatorriver emails send --campaign-id <campaign-id> --creator-id <creator-id> --subject "Partnership" --body "Hi! ..."
|
|
36
45
|
creatorriver conversations get --campaign-id <campaign-id> --creator-id <creator-id>
|
|
37
46
|
creatorriver campaigns status --campaign-id <campaign-id>
|
|
38
47
|
```
|
|
39
48
|
|
|
40
|
-
|
|
49
|
+
Call `creatorriver pricing` to inspect unit credit prices, plans, daily limits and the structured cost of every operation before spending; call `creatorriver credits` to review recent spend and bounce refunds. Every credit-spending command (`creators unlock`, `campaigns add`, `contacts reveal`, `contacts reveal-batch`, `exports prepare`, `emails send`) returns a `credits` receipt (`charged`, `balance`, `breakdown`) and supports `--dry-run` to preview the request and estimated maximum credit cost without calling the API.
|
|
41
50
|
|
|
42
|
-
|
|
51
|
+
Saving creators to custom lists (`lists create`, `lists add`, `creators save`) is free; handles, profile links and emails stay hidden until unlocked or revealed. Use `exports preview` to inspect exact unlock and email costs, `exports prepare` (up to 10 creators per call) to unlock profiles and optionally reveal emails, and `searches export`, `lists export` or `campaigns export` to download CSV (pass `--no-include-email` on any export or prepare command to omit emails and unlock profiles only).
|
|
52
|
+
|
|
53
|
+
To find new prospects, pass `--exclude-contacted` to `creators search`, `creators browse` or `creators similar`. Use `--exclude-exported` or `--exclude-uploaded` to also omit past exports or the list uploaded on the website, and `--has-recent-viral` to narrow `creators search` or `creators browse` to creators with a 10x+ breakout video in the last 30 days. Filtered browsing counts toward the search allowance shown by `account` (paging the same filtered list that day with `--offset`, or expanding a same-day search with `searches expand`, uses no extra allowance). Unpaid accounts with less than 0.5 credits drop to 5 searches a day until any purchase. Free and one-time credit-pack accounts can send up to 100 free outreach emails/day; active Pro subscriptions allow up to 200/day (emails 101-200 cost 0.1 credits each). For a follow-up in an existing conversation you can omit `--subject`. Boolean flags also accept `--no-<flag>` (e.g. `--no-include-email`, `--no-archived`).
|
|
54
|
+
|
|
55
|
+
Every command prints one line of JSON: `{"ok":true,"data":...}` on stdout, or `{"ok":false,"error":{"code","message","requestId"}}` on stderr with an exit code per error: 1 internal, 2 invalid_input, 3 unauthorized, 4 not_found, 5 conflict, 6 insufficient_credits, 7 rate_limited, 8 network_error, 9 login_pending. Each command's `--help` lists its flags, what it costs and what it needs first. `--input-json '{...}'` passes the whole input as JSON, and `--dry-run` previews the request and upper-bound credit cost locally.
|
|
43
56
|
|
|
44
57
|
The same operations are available as an MCP server at `https://www.creatorriver.com/api/mcp` and as a REST API at `https://www.creatorriver.com/api/v1`, both with `Authorization: Bearer <key>`.
|
package/dist/creatorriver.js
CHANGED
|
@@ -78,6 +78,21 @@ import { z as z2 } from "zod";
|
|
|
78
78
|
function defineOperation(spec) {
|
|
79
79
|
return spec;
|
|
80
80
|
}
|
|
81
|
+
function estimateMaxOperationCredits(operation, input = {}) {
|
|
82
|
+
const { cost } = operation;
|
|
83
|
+
if (cost.model === "free" || cost.model === "quota") {
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
const perUnit = operation.name === "prepare_export" && input.includeEmail === false ? 0.5 : cost.maxCreditsPerUnit ?? 0;
|
|
87
|
+
if (perUnit <= 0) {
|
|
88
|
+
return 0;
|
|
89
|
+
}
|
|
90
|
+
const count2 = Array.isArray(input.creatorIds) ? new Set(
|
|
91
|
+
input.creatorIds.filter((item) => typeof item === "string").map((item) => item.trim()).filter(Boolean)
|
|
92
|
+
).size : 1;
|
|
93
|
+
const boundedCount = cost.maxUnitsPerCall ? Math.min(count2, cost.maxUnitsPerCall) : count2;
|
|
94
|
+
return Math.round(perUnit * boundedCount * 10) / 10;
|
|
95
|
+
}
|
|
81
96
|
|
|
82
97
|
// ../contract/src/path.ts
|
|
83
98
|
var PARAM = /^\{(\w+)\}$/;
|
|
@@ -102,14 +117,102 @@ function fillPath(template, input) {
|
|
|
102
117
|
|
|
103
118
|
// ../contract/src/operations.ts
|
|
104
119
|
import { z as z3 } from "zod";
|
|
120
|
+
var FREE_COST = {
|
|
121
|
+
model: "free",
|
|
122
|
+
label: "Free"
|
|
123
|
+
};
|
|
124
|
+
var SEARCH_QUOTA_COST = {
|
|
125
|
+
model: "quota",
|
|
126
|
+
label: "Free (daily search quota)",
|
|
127
|
+
quota: "daily_search",
|
|
128
|
+
note: "0 credits; counts toward the daily search allowance (20/day unpaid, 5/day unpaid with < 0.5 credits, 500/day after any purchase). Same-day repeat queries use no extra allowance."
|
|
129
|
+
};
|
|
130
|
+
var BROWSE_QUOTA_COST = {
|
|
131
|
+
model: "quota",
|
|
132
|
+
label: "Free (filtered lists use daily search quota)",
|
|
133
|
+
quota: "daily_search",
|
|
134
|
+
note: "0 credits; default unfiltered browse and same-day paging use no allowance. Filtered lists count once per day against the daily search allowance."
|
|
135
|
+
};
|
|
136
|
+
var EXPAND_QUOTA_COST = {
|
|
137
|
+
model: "quota",
|
|
138
|
+
label: "Free (older searches use daily search quota)",
|
|
139
|
+
quota: "daily_search",
|
|
140
|
+
note: "0 credits; expanding a search from today uses no extra allowance, while expanding an older search counts as one daily search."
|
|
141
|
+
};
|
|
142
|
+
var UNLOCK_COST = {
|
|
143
|
+
model: "per_item",
|
|
144
|
+
label: "0.5 credits (first time)",
|
|
145
|
+
actions: ["creator_unlock"],
|
|
146
|
+
unit: "creator",
|
|
147
|
+
maxCreditsPerUnit: 0.5,
|
|
148
|
+
maxUnitsPerCall: 1,
|
|
149
|
+
idempotent: true,
|
|
150
|
+
note: "Charged once per account and creator; repeat unlocks are free."
|
|
151
|
+
};
|
|
152
|
+
var ADD_CREATOR_COST = {
|
|
153
|
+
model: "per_item",
|
|
154
|
+
label: "0.5 credits (first unlock)",
|
|
155
|
+
actions: ["creator_unlock"],
|
|
156
|
+
unit: "creator",
|
|
157
|
+
maxCreditsPerUnit: 0.5,
|
|
158
|
+
maxUnitsPerCall: 1,
|
|
159
|
+
idempotent: true,
|
|
160
|
+
note: "Unlocks the creator if not yet unlocked (0 credits if already unlocked). Use add_to_list to shortlist for free."
|
|
161
|
+
};
|
|
162
|
+
var REVEAL_CONTACT_COST = {
|
|
163
|
+
model: "per_item",
|
|
164
|
+
label: "Up to 0.7 credits (0.5 unlock + 0.2 email)",
|
|
165
|
+
actions: ["creator_unlock", "contact_reveal"],
|
|
166
|
+
unit: "creator",
|
|
167
|
+
maxCreditsPerUnit: 0.7,
|
|
168
|
+
maxUnitsPerCall: 1,
|
|
169
|
+
idempotent: true,
|
|
170
|
+
note: "0.5 first unlock + 0.2 first email reveal (0 if already paid; skipped with 0 charge when no email exists). Bounced or dropped emails refund 0.2 credits."
|
|
171
|
+
};
|
|
172
|
+
var REVEAL_CONTACTS_COST = {
|
|
173
|
+
model: "per_item",
|
|
174
|
+
label: "Up to 0.7 credits/creator (max 10)",
|
|
175
|
+
actions: ["creator_unlock", "contact_reveal"],
|
|
176
|
+
unit: "creator",
|
|
177
|
+
maxCreditsPerUnit: 0.7,
|
|
178
|
+
maxUnitsPerCall: 10,
|
|
179
|
+
idempotent: true,
|
|
180
|
+
note: "Per available creator: 0.5 first unlock + 0.2 first email reveal. Creators with no email are skipped before charging. Call preview_export with creatorIds first for an exact quote."
|
|
181
|
+
};
|
|
182
|
+
var PREPARE_EXPORT_COST = {
|
|
183
|
+
model: "per_item",
|
|
184
|
+
label: "Up to 0.7 credits/creator (0.5 without email; max 10)",
|
|
185
|
+
actions: ["creator_unlock", "contact_reveal"],
|
|
186
|
+
unit: "creator",
|
|
187
|
+
maxCreditsPerUnit: 0.7,
|
|
188
|
+
maxUnitsPerCall: 10,
|
|
189
|
+
idempotent: true,
|
|
190
|
+
note: "0.5 first unlock + optional 0.2 first email reveal when includeEmail is true (default). Call preview_export first for an exact quote."
|
|
191
|
+
};
|
|
192
|
+
var SEND_EMAIL_COST = {
|
|
193
|
+
model: "overage",
|
|
194
|
+
label: "First 100/day free, then 0.1 credits/email",
|
|
195
|
+
actions: ["outreach_email"],
|
|
196
|
+
unit: "email",
|
|
197
|
+
maxCreditsPerUnit: 0.1,
|
|
198
|
+
maxUnitsPerCall: 1,
|
|
199
|
+
idempotent: true,
|
|
200
|
+
quota: "daily_outreach",
|
|
201
|
+
note: "First 100 emails/day free (free and credit-pack accounts cap at 100/day; active Pro subscriptions allow up to 200/day at 0.1 credits each past 100). Failed or bounced emails refund usage and credits."
|
|
202
|
+
};
|
|
105
203
|
var searchId = z3.string().trim().min(1).describe(
|
|
106
204
|
"Search id, from search_creators, find_similar_creators or list_searches"
|
|
107
205
|
);
|
|
108
206
|
var creatorId = z3.string().trim().min(1).describe("Creator id, from search_creators results");
|
|
109
207
|
var campaignId = z3.string().trim().min(1).describe("Campaign id, from list_campaigns or create_campaign");
|
|
208
|
+
var listId = z3.string().trim().min(1).describe("List id, from list_lists or create_list");
|
|
209
|
+
var includeEmailColumn = z3.boolean().optional().describe(
|
|
210
|
+
"Include the Email column (default true). Pass false to omit emails"
|
|
211
|
+
);
|
|
110
212
|
var limit = (max, fallback) => z3.number().int().min(1).max(max).optional().describe(`How many to return, 1-${max} (default ${fallback})`);
|
|
111
213
|
var count = (what) => z3.number().int().min(0).optional().describe(what);
|
|
112
|
-
var PLATFORMS = ["youtube", "instagram", "tiktok"];
|
|
214
|
+
var PLATFORMS = ["youtube", "instagram", "tiktok", "x"];
|
|
215
|
+
var TREND_PLATFORMS = ["youtube", "instagram", "tiktok"];
|
|
113
216
|
var LAST_POST_WITHIN_DAYS = [7, 14, 30, 90, 180];
|
|
114
217
|
var CREATOR_NICHES = [
|
|
115
218
|
"music",
|
|
@@ -149,10 +252,44 @@ var getAccount = defineOperation({
|
|
|
149
252
|
method: "GET",
|
|
150
253
|
path: "/account",
|
|
151
254
|
kind: "read",
|
|
255
|
+
cost: FREE_COST,
|
|
152
256
|
summary: "Show the credit balance, prices and today\u2019s usage",
|
|
153
|
-
description: "Returns the credit balance,
|
|
257
|
+
description: "Returns the credit balance, unit prices, a summary of all credit-spending and quota-limited operations, the plan, paid status, the maximum results per search, and today\u2019s usage against daily limits (unpaid accounts with less than 0.5 credits drop to 5 searches a day until any purchase; free and one-time credit-pack accounts cap at 100 outreach emails/day while active Pro subscriptions allow up to 200/day). Free. Call it first to confirm the API key works, and call get_pricing for the full per-operation catalog and plans.",
|
|
154
258
|
input: z3.object({})
|
|
155
259
|
});
|
|
260
|
+
var getPricing = defineOperation({
|
|
261
|
+
name: "get_pricing",
|
|
262
|
+
command: ["pricing"],
|
|
263
|
+
method: "GET",
|
|
264
|
+
path: "/pricing",
|
|
265
|
+
kind: "read",
|
|
266
|
+
cost: FREE_COST,
|
|
267
|
+
summary: "List prices, plans, limits and per-operation costs",
|
|
268
|
+
description: "Returns the complete Creator River pricing catalog so an agent can plan strategy and budget without trial calls: unit credit prices, credit packs and subscriptions (matching the SaaS pricing page), daily limits by tier (free, one-time credit pack, active Pro subscription), refund policies, and the structured cost of every operation across REST, MCP and CLI. Free. Pass chargedOnly: true to list only credit-spending or quota-limited operations, or group to narrow to one command group.",
|
|
269
|
+
input: z3.object({
|
|
270
|
+
chargedOnly: z3.boolean().optional().describe(
|
|
271
|
+
"Only include operations that charge credits or consume a daily quota (default false, returns all operations)"
|
|
272
|
+
),
|
|
273
|
+
group: z3.string().trim().min(1).max(40).optional().describe(
|
|
274
|
+
"Only include operations in this command group, e.g. creators, contacts, exports, emails, campaigns, lists, searches, trends"
|
|
275
|
+
)
|
|
276
|
+
})
|
|
277
|
+
});
|
|
278
|
+
var getCreditHistory = defineOperation({
|
|
279
|
+
name: "get_credit_history",
|
|
280
|
+
command: ["credits"],
|
|
281
|
+
method: "GET",
|
|
282
|
+
path: "/account/credits",
|
|
283
|
+
kind: "read",
|
|
284
|
+
cost: FREE_COST,
|
|
285
|
+
summary: "Show credit spending summary and transaction history",
|
|
286
|
+
description: "Returns the current credit balance, an aggregated spending and refund summary by action over the requested day window, and recent credit transactions (unlocks, email reveals, outreach overages, bounce refunds, signup gift and purchases). Free.",
|
|
287
|
+
input: z3.object({
|
|
288
|
+
days: z3.number().int().min(1).max(90).optional().describe("Recent UTC days to summarize and list, 1-90 (default 30)"),
|
|
289
|
+
limit: limit(100, 50),
|
|
290
|
+
offset: z3.number().int().min(0).optional().describe("Skip this many transactions for paging (default 0)")
|
|
291
|
+
})
|
|
292
|
+
});
|
|
156
293
|
var accountExclusionFilters = {
|
|
157
294
|
excludeContacted: z3.boolean().optional().describe(
|
|
158
295
|
"Exclude this account\u2019s contacted or do-not-contact creators across all campaigns"
|
|
@@ -203,6 +340,7 @@ var searchCreators = defineOperation({
|
|
|
203
340
|
method: "POST",
|
|
204
341
|
path: "/searches",
|
|
205
342
|
kind: "read",
|
|
343
|
+
cost: SEARCH_QUOTA_COST,
|
|
206
344
|
summary: "Find creators by description and filters",
|
|
207
345
|
description: "Searches the creator database by meaning: describe the creators you want in plain words (niche, content, audience), and optionally narrow by platform, niche, creator country, audience country, language, size, engagement rate and how recently they posted. To find creators like ones the user already knows, pass their handles or profile links as exampleCreators. A new search counts toward the daily search allowance and costs no credits. Repeating the same successful search that day uses no extra allowance (see get_account). Results show each creator\u2019s name and account state (identityUnlocked, emailUnlocked, isSaved, campaignMemberships), but no handle or profile link, plus pagination; call expand_search to load more unseen results into the same search. Pass campaignId to rank against that campaign\u2019s brief and record the search in it.",
|
|
208
346
|
input: z3.object({
|
|
@@ -223,6 +361,7 @@ var browseCreators = defineOperation({
|
|
|
223
361
|
method: "GET",
|
|
224
362
|
path: "/creators/browse",
|
|
225
363
|
kind: "read",
|
|
364
|
+
cost: BROWSE_QUOTA_COST,
|
|
226
365
|
summary: "List creators by filters or campaign taste",
|
|
227
366
|
description: "Lists the creators that match the filters with no description to match, as the dashboard\u2019s Discover list does before a search. Without campaignId, results are ordered most followed first; with campaignId, results are ranked by that campaign\u2019s taste profile (brief, saved, added, revealed and excluded creators) and fall back to most-followed when no signals exist yet, indicated by ranking (campaign_taste or top_followed). An offset already at the account limit returns an empty page with ranking set to null. Browsing costs no credits and respects maxSearchResults (50 unpaid, 100 paid). Pass offset (from pagination.nextOffset) to read further pages. A filtered list uses the daily search allowance; paging through the same filtered list that day, or reading the default unfiltered list, uses no extra allowance. Browse lists stay out of search history. Use it for asks like the biggest beauty creators in the US or fresh picks for an active campaign; use search_creators when the user describes what the content should be about. Results show names and account state (identityUnlocked, emailUnlocked, isSaved, campaignMemberships), but no handles.",
|
|
228
367
|
input: z3.object({
|
|
@@ -242,6 +381,7 @@ var findCreator = defineOperation({
|
|
|
242
381
|
method: "GET",
|
|
243
382
|
path: "/creators/lookup",
|
|
244
383
|
kind: "read",
|
|
384
|
+
cost: FREE_COST,
|
|
245
385
|
summary: "Find a creator by handle, profile link or name",
|
|
246
386
|
description: "Looks up a creator the user names by @handle, profile link or display name. An explicit @handle or profile link returns exact matches across platforms ordered by followers descending; a plain name returns up to 8 matching candidates. Returns creatorId, followers and account state (isSaved, identityUnlocked, emailUnlocked, campaignMemberships) for get_creator, find_similar_creators, add_creator or reveal_contact. Free. An empty list means no creator matched that reference.",
|
|
247
387
|
input: z3.object({
|
|
@@ -256,6 +396,7 @@ var findSimilarCreators = defineOperation({
|
|
|
256
396
|
method: "POST",
|
|
257
397
|
path: "/creators/{creatorId}/similar",
|
|
258
398
|
kind: "read",
|
|
399
|
+
cost: SEARCH_QUOTA_COST,
|
|
259
400
|
summary: "Find creators like one or more you already have",
|
|
260
401
|
description: "Finds creators whose content and audience are closest to one seed creator \u2014 or up to five fused seeds via additionalCreatorIds \u2014 defaulting to the seed platform(s) unless platforms is set. Pass the creatorId of a search or find_creator result, no handle or unlock needed. A new similar search counts toward the daily search allowance and costs no credits (see get_account); paging the same seeds and filters that day uses no extra allowance. With campaignId, creators already in that campaign or excluded from it are left out. Results include seeds, pagination, names and account state (isSaved, identityUnlocked, emailUnlocked, campaignMemberships) but no handles, each with a matchScore from 0 to 1; the search is kept, so expand_search can load more unseen matches and list_searches or get_search can read it again.",
|
|
261
402
|
input: z3.object({
|
|
@@ -276,6 +417,7 @@ var listSearches = defineOperation({
|
|
|
276
417
|
method: "GET",
|
|
277
418
|
path: "/searches",
|
|
278
419
|
kind: "read",
|
|
420
|
+
cost: FREE_COST,
|
|
279
421
|
summary: "List past searches",
|
|
280
422
|
description: "Lists the searches run before, newest first, with their query, filters and how many results they had, including find_similar_creators ones. Free, and does not count against the daily search limit. To see a search\u2019s results again, call get_search instead of searching again.",
|
|
281
423
|
input: z3.object({
|
|
@@ -291,6 +433,7 @@ var getSearch = defineOperation({
|
|
|
291
433
|
method: "GET",
|
|
292
434
|
path: "/searches/{searchId}",
|
|
293
435
|
kind: "read",
|
|
436
|
+
cost: FREE_COST,
|
|
294
437
|
summary: "Read a past search\u2019s results again",
|
|
295
438
|
description: "Returns a past search, its results in rank order with account state (identityUnlocked, emailUnlocked, isSaved, campaignMemberships), and pagination. Free, and does not count against the daily search limit. Call expand_search to append more unseen results.",
|
|
296
439
|
input: z3.object({ searchId })
|
|
@@ -301,6 +444,7 @@ var expandSearch = defineOperation({
|
|
|
301
444
|
method: "POST",
|
|
302
445
|
path: "/searches/{searchId}/more",
|
|
303
446
|
kind: "write",
|
|
447
|
+
cost: EXPAND_QUOTA_COST,
|
|
304
448
|
summary: "Load more results for a past search",
|
|
305
449
|
description: "Appends unseen creators to a saved search_creators or find_similar_creators search in its original history entry and keeps existing rows in order. Pass limit as the desired total result count, up to maxSearchResults from get_account (50 unpaid, 100 paid). Returns only the newly added results with account state, totalCount and pagination. Expanding a search from today uses no extra daily allowance; expanding an older search counts as one search. Free (no credits). Similar searches saved before reference creators were recorded can be reopened with get_search. Start a new similar search to load more matches for those older searches.",
|
|
306
450
|
input: z3.object({
|
|
@@ -316,6 +460,7 @@ var getSearchFilters = defineOperation({
|
|
|
316
460
|
method: "GET",
|
|
317
461
|
path: "/searches/filters",
|
|
318
462
|
kind: "read",
|
|
463
|
+
cost: FREE_COST,
|
|
319
464
|
summary: "List the values the search filters take",
|
|
320
465
|
description: "Returns the values the search and browse filters accept: platforms, creator countries and languages present in the database, niches and activity windows. Free.",
|
|
321
466
|
input: z3.object({})
|
|
@@ -326,6 +471,7 @@ var updateSearch = defineOperation({
|
|
|
326
471
|
method: "PATCH",
|
|
327
472
|
path: "/searches/{searchId}",
|
|
328
473
|
kind: "write",
|
|
474
|
+
cost: FREE_COST,
|
|
329
475
|
summary: "Rename or archive a past search",
|
|
330
476
|
description: "Names a past search, or archives it so list_searches leaves it out (archived: false brings it back). Free.",
|
|
331
477
|
input: z3.object({
|
|
@@ -340,11 +486,13 @@ var exportSearch = defineOperation({
|
|
|
340
486
|
method: "GET",
|
|
341
487
|
path: "/searches/{searchId}/export",
|
|
342
488
|
kind: "write",
|
|
489
|
+
cost: FREE_COST,
|
|
343
490
|
summary: "Export a search\u2019s results as CSV",
|
|
344
|
-
description: "Returns a search\u2019s results as CSV text, one row per creator in rank order, as the dashboard\u2019s export does: handles and profile links only for unlocked creators, and
|
|
491
|
+
description: "Returns a search\u2019s results as CSV text, one row per creator in rank order, as the dashboard\u2019s export does: handles and profile links only for unlocked creators, and the Email column (unless includeEmail is false) only for ones already revealed. Exporting costs no credits; call preview_export and prepare_export first if you want to unlock missing profiles or reveal emails before downloading. Records the returned creators as exported for this account so later searches can omit them with excludeExported. Save csv to a file named filename.",
|
|
345
492
|
input: z3.object({
|
|
346
493
|
searchId,
|
|
347
|
-
scope: z3.enum(["all", "added"]).optional().describe("all results (default), or only the ones added to a campaign")
|
|
494
|
+
scope: z3.enum(["all", "added"]).optional().describe("all results (default), or only the ones added to a campaign"),
|
|
495
|
+
includeEmail: includeEmailColumn
|
|
348
496
|
})
|
|
349
497
|
});
|
|
350
498
|
var getCreator = defineOperation({
|
|
@@ -353,8 +501,9 @@ var getCreator = defineOperation({
|
|
|
353
501
|
method: "GET",
|
|
354
502
|
path: "/creators/{creatorId}",
|
|
355
503
|
kind: "read",
|
|
504
|
+
cost: FREE_COST,
|
|
356
505
|
summary: "Show a creator\u2019s profile",
|
|
357
|
-
description: "Returns a creator\u2019s profile: platform, country, language, followers, views, engagement, topics, weighted hashtags, audience, recent content, estimated price, active campaign memberships, whether an email is available, and detailUrl (their Creator River web page). Free. Until you unlock the creator, the handle, profile link and recent video titles and links are hidden. Pass campaignId to also see where the creator stands in that campaign.",
|
|
506
|
+
description: "Returns a creator\u2019s profile: platform, country, language, followers, views, engagement, topics, weighted hashtags, audience, recent content, estimated price, active campaign memberships, saved listIds, whether an email is available, and detailUrl (their Creator River web page). Free. Until you unlock the creator, the handle, profile link and recent video titles and links are hidden. Pass campaignId to also see where the creator stands in that campaign.",
|
|
358
507
|
input: z3.object({
|
|
359
508
|
creatorId,
|
|
360
509
|
campaignId: campaignId.optional().describe("Also show this campaign\u2019s progress with the creator")
|
|
@@ -366,8 +515,9 @@ var unlockCreator = defineOperation({
|
|
|
366
515
|
method: "POST",
|
|
367
516
|
path: "/creators/{creatorId}/unlock",
|
|
368
517
|
kind: "spend",
|
|
518
|
+
cost: UNLOCK_COST,
|
|
369
519
|
summary: "Unlock a creator\u2019s handle and profile link",
|
|
370
|
-
description: "Unlocks the creator and returns the full profile with handle, profile link, recent video titles and links,
|
|
520
|
+
description: "Unlocks the creator and returns the full profile with handle, profile link, recent video titles and links, saved listIds, detailUrl (their Creator River web page) and a credits receipt (charged and remaining balance). Costs 0.5 credits the first time for each creator; unlocking again is free. It does not reveal the email address; use reveal_contact or prepare_export for that.",
|
|
371
521
|
input: z3.object({ creatorId })
|
|
372
522
|
});
|
|
373
523
|
var saveCreator = defineOperation({
|
|
@@ -376,10 +526,12 @@ var saveCreator = defineOperation({
|
|
|
376
526
|
method: "POST",
|
|
377
527
|
path: "/creators/{creatorId}/save",
|
|
378
528
|
kind: "write",
|
|
379
|
-
|
|
380
|
-
|
|
529
|
+
cost: FREE_COST,
|
|
530
|
+
summary: "Save a creator to a list",
|
|
531
|
+
description: "Saves a creator to a creator list (the account\u2019s default \u201CMy Favorites\u201D list when listId is omitted). Free; handles, profile links and emails remain locked until unlocked or revealed. Pass searchId to remember where they were found. Use add_to_list to add up to 100 creators at once.",
|
|
381
532
|
input: z3.object({
|
|
382
533
|
creatorId,
|
|
534
|
+
listId: listId.optional().describe("Target list id (defaults to the account\u2019s default list)"),
|
|
383
535
|
searchId: z3.string().trim().min(1).optional().describe("The search the creator was found in")
|
|
384
536
|
})
|
|
385
537
|
});
|
|
@@ -389,8 +541,9 @@ var unsaveCreator = defineOperation({
|
|
|
389
541
|
method: "DELETE",
|
|
390
542
|
path: "/creators/{creatorId}/save",
|
|
391
543
|
kind: "write",
|
|
392
|
-
|
|
393
|
-
|
|
544
|
+
cost: FREE_COST,
|
|
545
|
+
summary: "Remove a creator from all saved lists",
|
|
546
|
+
description: "Removes a creator from every creator list on this account. Free; the creator stays unlocked and in any campaign. Use remove_from_list to remove from a single list instead.",
|
|
394
547
|
input: z3.object({ creatorId })
|
|
395
548
|
});
|
|
396
549
|
var listSavedCreators = defineOperation({
|
|
@@ -399,19 +552,176 @@ var listSavedCreators = defineOperation({
|
|
|
399
552
|
method: "GET",
|
|
400
553
|
path: "/creators/saved",
|
|
401
554
|
kind: "read",
|
|
402
|
-
|
|
403
|
-
|
|
555
|
+
cost: FREE_COST,
|
|
556
|
+
summary: "List saved creators across all lists",
|
|
557
|
+
description: "Lists all creators saved to any list on this account, most recently saved first. Free. Use list_lists and get_list to inspect individual lists.",
|
|
558
|
+
input: z3.object({
|
|
559
|
+
page: z3.number().int().min(1).optional().describe("Page number, from 1"),
|
|
560
|
+
limit: limit(100, 20)
|
|
561
|
+
})
|
|
562
|
+
});
|
|
563
|
+
var listLists = defineOperation({
|
|
564
|
+
name: "list_lists",
|
|
565
|
+
command: ["lists", "list"],
|
|
566
|
+
method: "GET",
|
|
567
|
+
path: "/lists",
|
|
568
|
+
kind: "read",
|
|
569
|
+
cost: FREE_COST,
|
|
570
|
+
summary: "List creator lists",
|
|
571
|
+
description: "Lists your creator lists (including the default \u201CMy Favorites\u201D list) with each list\u2019s id, name, isDefault flag and creator count. Free.",
|
|
572
|
+
input: z3.object({})
|
|
573
|
+
});
|
|
574
|
+
var createList = defineOperation({
|
|
575
|
+
name: "create_list",
|
|
576
|
+
command: ["lists", "create"],
|
|
577
|
+
method: "POST",
|
|
578
|
+
path: "/lists",
|
|
579
|
+
kind: "write",
|
|
580
|
+
cost: FREE_COST,
|
|
581
|
+
summary: "Create a creator list",
|
|
582
|
+
description: "Creates a custom creator list (up to 50 lists per account) to organize prospects outside or before campaigns. Free.",
|
|
583
|
+
input: z3.object({
|
|
584
|
+
name: z3.string().trim().min(1).max(80).describe("List name, up to 80 characters")
|
|
585
|
+
})
|
|
586
|
+
});
|
|
587
|
+
var updateList = defineOperation({
|
|
588
|
+
name: "update_list",
|
|
589
|
+
command: ["lists", "update"],
|
|
590
|
+
method: "PATCH",
|
|
591
|
+
path: "/lists/{listId}",
|
|
592
|
+
kind: "write",
|
|
593
|
+
cost: FREE_COST,
|
|
594
|
+
summary: "Rename a creator list",
|
|
595
|
+
description: "Renames one of your creator lists. Free.",
|
|
404
596
|
input: z3.object({
|
|
597
|
+
listId,
|
|
598
|
+
name: z3.string().trim().min(1).max(80).describe("New list name, up to 80 characters")
|
|
599
|
+
})
|
|
600
|
+
});
|
|
601
|
+
var deleteList = defineOperation({
|
|
602
|
+
name: "delete_list",
|
|
603
|
+
command: ["lists", "delete"],
|
|
604
|
+
method: "DELETE",
|
|
605
|
+
path: "/lists/{listId}",
|
|
606
|
+
kind: "write",
|
|
607
|
+
cost: FREE_COST,
|
|
608
|
+
summary: "Delete a custom creator list",
|
|
609
|
+
description: "Deletes a custom creator list. Free. The default list cannot be deleted. Creators saved in other lists stay saved there, and unlocked creators or campaigns are unchanged.",
|
|
610
|
+
input: z3.object({ listId })
|
|
611
|
+
});
|
|
612
|
+
var getList = defineOperation({
|
|
613
|
+
name: "get_list",
|
|
614
|
+
command: ["lists", "get"],
|
|
615
|
+
method: "GET",
|
|
616
|
+
path: "/lists/{listId}",
|
|
617
|
+
kind: "read",
|
|
618
|
+
cost: FREE_COST,
|
|
619
|
+
summary: "List creators in a creator list",
|
|
620
|
+
description: "Lists the creators in one creator list, most recently added first, with platform counts and account state (identityUnlocked, emailUnlocked, campaignMemberships). Free; handles, profile links and emails remain hidden until unlocked or revealed.",
|
|
621
|
+
input: z3.object({
|
|
622
|
+
listId,
|
|
623
|
+
platform: z3.enum(PLATFORMS).optional().describe("Only creators on this platform"),
|
|
405
624
|
page: z3.number().int().min(1).optional().describe("Page number, from 1"),
|
|
406
625
|
limit: limit(100, 20)
|
|
407
626
|
})
|
|
408
627
|
});
|
|
628
|
+
var addToList = defineOperation({
|
|
629
|
+
name: "add_to_list",
|
|
630
|
+
command: ["lists", "add"],
|
|
631
|
+
method: "POST",
|
|
632
|
+
path: "/lists/{listId}/creators",
|
|
633
|
+
kind: "write",
|
|
634
|
+
cost: FREE_COST,
|
|
635
|
+
summary: "Add creators to a creator list",
|
|
636
|
+
description: "Adds 1 to 100 creators to a creator list in one call. Free; handles, profile links and emails remain locked until unlocked or revealed. Pass searchId to record which search they came from.",
|
|
637
|
+
input: z3.object({
|
|
638
|
+
listId,
|
|
639
|
+
creatorIds: z3.array(creatorId).min(1).max(100).describe("1 to 100 creator IDs to add"),
|
|
640
|
+
searchId: searchId.optional().describe("The search the creators were found in")
|
|
641
|
+
})
|
|
642
|
+
});
|
|
643
|
+
var removeFromList = defineOperation({
|
|
644
|
+
name: "remove_from_list",
|
|
645
|
+
command: ["lists", "remove"],
|
|
646
|
+
method: "DELETE",
|
|
647
|
+
path: "/lists/{listId}/creators/{creatorId}",
|
|
648
|
+
kind: "write",
|
|
649
|
+
cost: FREE_COST,
|
|
650
|
+
summary: "Remove a creator from a creator list",
|
|
651
|
+
description: "Removes one creator from a specific creator list. Free; memberships in other lists, unlocked state and campaigns are unchanged.",
|
|
652
|
+
input: z3.object({ listId, creatorId })
|
|
653
|
+
});
|
|
654
|
+
var exportList = defineOperation({
|
|
655
|
+
name: "export_list",
|
|
656
|
+
command: ["lists", "export"],
|
|
657
|
+
method: "GET",
|
|
658
|
+
path: "/lists/{listId}/export",
|
|
659
|
+
kind: "write",
|
|
660
|
+
cost: FREE_COST,
|
|
661
|
+
summary: "Export a creator list as CSV",
|
|
662
|
+
description: "Returns a creator list (optionally filtered by platform or creatorIds) as CSV text: handles and profile links only for unlocked creators, and the Email column (unless includeEmail is false) only for ones already revealed. Exporting costs no credits; call preview_export and prepare_export first if you want to unlock missing profiles or reveal emails before downloading. Records the returned creators as exported for excludeExported. Save csv to a file named filename.",
|
|
663
|
+
input: z3.object({
|
|
664
|
+
listId,
|
|
665
|
+
platform: z3.enum(PLATFORMS).optional().describe("Only creators on this platform"),
|
|
666
|
+
creatorIds: z3.array(creatorId).min(1).max(100).optional().describe(
|
|
667
|
+
"Optional subset of 1 to 100 creator IDs in this list, in desired order"
|
|
668
|
+
),
|
|
669
|
+
includeEmail: includeEmailColumn
|
|
670
|
+
})
|
|
671
|
+
});
|
|
672
|
+
var previewExport = defineOperation({
|
|
673
|
+
name: "preview_export",
|
|
674
|
+
command: ["exports", "preview"],
|
|
675
|
+
method: "POST",
|
|
676
|
+
path: "/exports/preview",
|
|
677
|
+
kind: "read",
|
|
678
|
+
cost: FREE_COST,
|
|
679
|
+
summary: "Preview credit cost before exporting CSV",
|
|
680
|
+
description: "Computes the exact credit cost to unlock missing profiles (0.5 credits each) and, when includeEmail is true, reveal missing business emails (0.2 credits each) before exporting a search, campaign, creator list or explicit list of creatorIds. Free and read-only. Returns counts, unlockCostCredits, emailCostCredits, totalCostCredits, balanceCredits, canAfford and pendingCreatorIds to pass to prepare_export in chunks of up to 10.",
|
|
681
|
+
input: z3.object({
|
|
682
|
+
searchId: searchId.optional().describe("Preview exporting this search"),
|
|
683
|
+
campaignId: campaignId.optional().describe("Preview exporting this campaign"),
|
|
684
|
+
listId: listId.optional().describe("Preview exporting this creator list"),
|
|
685
|
+
creatorIds: z3.array(creatorId).min(1).max(100).optional().describe(
|
|
686
|
+
"1 to 100 creator IDs directly, or a subset of campaignId or listId"
|
|
687
|
+
),
|
|
688
|
+
scope: z3.enum(["all", "added"]).optional().describe(
|
|
689
|
+
"With searchId: all results (default), or only ones added to a campaign"
|
|
690
|
+
),
|
|
691
|
+
platform: z3.enum(PLATFORMS).optional().describe("With listId: only creators on this platform"),
|
|
692
|
+
includeEmail: z3.boolean().optional().describe(
|
|
693
|
+
"Include email reveal charges in the cost preview (default true). Pass false to preview profile unlock costs only"
|
|
694
|
+
)
|
|
695
|
+
})
|
|
696
|
+
});
|
|
697
|
+
var prepareExport = defineOperation({
|
|
698
|
+
name: "prepare_export",
|
|
699
|
+
command: ["exports", "prepare"],
|
|
700
|
+
method: "POST",
|
|
701
|
+
path: "/exports/prepare",
|
|
702
|
+
kind: "spend",
|
|
703
|
+
cost: PREPARE_EXPORT_COST,
|
|
704
|
+
summary: "Unlock profiles and emails for CSV export",
|
|
705
|
+
description: "Unlocks up to 10 selected creators (0.5 credits each, first time only) and, when includeEmail is true (default), reveals their business emails (0.2 credits each, first time only) without adding them to a campaign, returning per-item results and a credits receipt (charged and remaining balance). Call preview_export first to quote the total cost and get approval, then pass pendingCreatorIds here in chunks of up to 10 before calling export_search, export_campaign or export_list. Safe to retry: already unlocked creators and revealed emails are never charged again.",
|
|
706
|
+
input: z3.object({
|
|
707
|
+
creatorIds: z3.array(creatorId).min(1).max(10).describe(
|
|
708
|
+
"1 to 10 creator IDs to unlock and optionally reveal emails for"
|
|
709
|
+
),
|
|
710
|
+
includeEmail: z3.boolean().optional().describe(
|
|
711
|
+
"Also reveal business emails at 0.2 credits each (default true). Pass false to unlock handles and profile links at 0.5 credits only"
|
|
712
|
+
),
|
|
713
|
+
campaignId: campaignId.optional().describe(
|
|
714
|
+
"For a campaign export, prepare only creators in this campaign and associate newly revealed emails with it"
|
|
715
|
+
)
|
|
716
|
+
})
|
|
717
|
+
});
|
|
409
718
|
var listCampaigns = defineOperation({
|
|
410
719
|
name: "list_campaigns",
|
|
411
720
|
command: ["campaigns", "list"],
|
|
412
721
|
method: "GET",
|
|
413
722
|
path: "/campaigns",
|
|
414
723
|
kind: "read",
|
|
724
|
+
cost: FREE_COST,
|
|
415
725
|
summary: "List campaigns",
|
|
416
726
|
description: "Lists your campaigns with their brief, status and how many creators are at each stage. Free. Every account has a default \u201CGeneral Outreach\u201D campaign you can use when no specific campaign fits.",
|
|
417
727
|
input: z3.object({
|
|
@@ -426,6 +736,7 @@ var createCampaign = defineOperation({
|
|
|
426
736
|
method: "POST",
|
|
427
737
|
path: "/campaigns",
|
|
428
738
|
kind: "write",
|
|
739
|
+
cost: FREE_COST,
|
|
429
740
|
summary: "Create a campaign",
|
|
430
741
|
description: "Creates a campaign from a brief: the product, the goal and the creators you want. Free. Campaigns group the creators you contact; pass the campaign id to search_creators to rank results for the brief.",
|
|
431
742
|
input: z3.object({
|
|
@@ -440,6 +751,7 @@ var updateCampaign = defineOperation({
|
|
|
440
751
|
method: "PATCH",
|
|
441
752
|
path: "/campaigns/{campaignId}",
|
|
442
753
|
kind: "write",
|
|
754
|
+
cost: FREE_COST,
|
|
443
755
|
summary: "Change a campaign\u2019s name, brief or status",
|
|
444
756
|
description: "Changes a campaign: its name, its brief, its status, or whether it is archived. Pass only what changes. Free. A new brief is kept as the next revision, and searches with this campaignId rank against it from then on; creators already in the campaign stay.",
|
|
445
757
|
input: z3.object({
|
|
@@ -456,6 +768,7 @@ var getCampaignStatus = defineOperation({
|
|
|
456
768
|
method: "GET",
|
|
457
769
|
path: "/campaigns/{campaignId}/status",
|
|
458
770
|
kind: "read",
|
|
771
|
+
cost: FREE_COST,
|
|
459
772
|
summary: "Show a campaign\u2019s pipeline",
|
|
460
773
|
description: "Shows where a campaign stands: the searches run for it, and its creators by stage (outreach, negotiation, collaboration), each with the next action and who the conversation is waiting on. Free. Counts cover the whole campaign; each stage lists its most recently active items first. To go through every creator at one stage, pass stage and read page 1, 2, \u2026 until you have count items. Use it to decide what to do next across a campaign.",
|
|
461
774
|
input: z3.object({
|
|
@@ -475,8 +788,9 @@ var revealContact = defineOperation({
|
|
|
475
788
|
method: "POST",
|
|
476
789
|
path: "/campaigns/{campaignId}/creators/{creatorId}/contact",
|
|
477
790
|
kind: "spend",
|
|
791
|
+
cost: REVEAL_CONTACT_COST,
|
|
478
792
|
summary: "Reveal a creator\u2019s email for a campaign",
|
|
479
|
-
description: "Returns the creator\u2019s email address so you can contact them in this campaign, adding the creator to the campaign first if needed. Adding unlocks the creator, which costs 0.5 credits the first time for each creator. Revealing costs 0.2 credits the first time for each creator; revealing again, in any campaign, is free. Use this or reveal_contacts before send_email.",
|
|
793
|
+
description: "Returns the creator\u2019s email address and a credits receipt (charged and remaining balance) so you can contact them in this campaign, adding the creator to the campaign first if needed. Adding unlocks the creator, which costs 0.5 credits the first time for each creator. Revealing costs 0.2 credits the first time for each creator; revealing again, in any campaign, is free. Creators without a revealable email fail before unlocking and cost 0 credits. Bounced or dropped emails refund 0.2 credits automatically. Use this or reveal_contacts before send_email.",
|
|
480
794
|
input: z3.object({ campaignId, creatorId })
|
|
481
795
|
});
|
|
482
796
|
var revealContacts = defineOperation({
|
|
@@ -485,8 +799,9 @@ var revealContacts = defineOperation({
|
|
|
485
799
|
method: "POST",
|
|
486
800
|
path: "/campaigns/{campaignId}/contacts/reveal",
|
|
487
801
|
kind: "spend",
|
|
802
|
+
cost: REVEAL_CONTACTS_COST,
|
|
488
803
|
summary: "Reveal selected creators\u2019 emails for a campaign",
|
|
489
|
-
description: "Reveals emails for up to 10 selected creators in this campaign. Each available contact is added to the campaign. The first unlock costs 0.5 credits and the first email reveal costs 0.2 credits per creator across the account.
|
|
804
|
+
description: "Reveals emails for up to 10 selected creators in this campaign and returns a credits receipt (charged and remaining balance). Each available contact is added to the campaign; creators without an email are skipped before charging. The first unlock costs 0.5 credits and the first email reveal costs 0.2 credits per creator across the account. Call preview_export with creatorIds first to get an exact account-scoped quote before spending. Read items for each unique creator in input order: successful items include revealedContact, and other items report why the reveal failed. Earlier successes are kept. Retrying reuses previous charges.",
|
|
490
805
|
input: z3.object({
|
|
491
806
|
campaignId,
|
|
492
807
|
creatorIds: z3.array(creatorId).min(1).max(10).describe("1 to 10 selected creator IDs"),
|
|
@@ -499,8 +814,9 @@ var sendEmail = defineOperation({
|
|
|
499
814
|
method: "POST",
|
|
500
815
|
path: "/campaigns/{campaignId}/creators/{creatorId}/emails",
|
|
501
816
|
kind: "send",
|
|
817
|
+
cost: SEND_EMAIL_COST,
|
|
502
818
|
summary: "Email a creator",
|
|
503
|
-
description: 'Sends a plain-text email to the creator\u2019s revealed address (call reveal_contact first). Replies arrive in the conversation (see get_conversation). A later email to the same creator in the same campaign is a follow-up: it joins the creator\u2019s existing email thread, keeps the conversation\u2019s stage, and copies whoever last replied for the creator (a manager, say); leave subject out to reply as "Re: <subject>". Subject and body can carry variables, filled in for this creator when it is sent, so one draft fits every creator: {name} (how to address them, cleaned from the channel name), {handle} (@handle), {platform}, {followers} (e.g. 75K) and {country}. A misspelled variable, or one this creator has no value for, fails the send with a message naming it. The first 100 emails each day are free
|
|
819
|
+
description: 'Sends a plain-text email to the creator\u2019s revealed address (call reveal_contact first) and returns a credits receipt (charged, remaining balance and remaining free daily emails). Replies arrive in the conversation (see get_conversation). A later email to the same creator in the same campaign is a follow-up: it joins the creator\u2019s existing email thread, keeps the conversation\u2019s stage, and copies whoever last replied for the creator (a manager, say); leave subject out to reply as "Re: <subject>". Subject and body can carry variables, filled in for this creator when it is sent, so one draft fits every creator: {name} (how to address them, cleaned from the channel name), {handle} (@handle), {platform}, {followers} (e.g. 75K) and {country}. A misspelled variable, or one this creator has no value for, fails the send with a message naming it. The first 100 emails each day are free: free and one-time credit-pack accounts cap at 100/day, while active Pro subscriptions allow up to 200/day with emails 101-200 costing 0.1 credits each (see get_account or get_pricing). Failed, bounced or dropped emails refund daily quota and any overage charge. Sending the same subject and body to the same creator in the same campaign again returns the first send instead of emailing twice; pass a new idempotencyKey to send it again on purpose, for example after a send that failed.',
|
|
504
820
|
input: z3.object({
|
|
505
821
|
campaignId,
|
|
506
822
|
creatorId,
|
|
@@ -519,6 +835,7 @@ var getConversation = defineOperation({
|
|
|
519
835
|
method: "GET",
|
|
520
836
|
path: "/campaigns/{campaignId}/creators/{creatorId}/conversation",
|
|
521
837
|
kind: "read",
|
|
838
|
+
cost: FREE_COST,
|
|
522
839
|
summary: "Read the email conversation with a creator",
|
|
523
840
|
description: "Returns the email thread with a creator in a campaign: its stage, who it is waiting on, the next action and agreed facts, plus every message and event, oldest first. Free. Check it for replies after send_email. An out-of-office or other automatic answer appears as an auto_reply event and leaves the thread waiting on the creator. The thread is null until the first email is sent.",
|
|
524
841
|
input: z3.object({ campaignId, creatorId })
|
|
@@ -531,6 +848,7 @@ var recordReply = defineOperation({
|
|
|
531
848
|
method: "POST",
|
|
532
849
|
path: "/campaigns/{campaignId}/creators/{creatorId}/replies",
|
|
533
850
|
kind: "write",
|
|
851
|
+
cost: FREE_COST,
|
|
534
852
|
summary: "Record a reply the creator sent outside Creator River",
|
|
535
853
|
description: "Records a reply that reached the user some other way (a DM, another inbox, a call) and how it went. positive or neutral moves the creator to negotiation (a confirmed collaboration stays), waiting on the user; negative records that they declined and closes the conversation. Free. Replies to emails sent with send_email arrive on their own (see get_conversation), so never record those. Needs an email sent first. Recording the same reply again changes nothing.",
|
|
536
854
|
input: z3.object({
|
|
@@ -550,6 +868,7 @@ var confirmCollaboration = defineOperation({
|
|
|
550
868
|
method: "POST",
|
|
551
869
|
path: "/campaigns/{campaignId}/creators/{creatorId}/collaboration",
|
|
552
870
|
kind: "write",
|
|
871
|
+
cost: FREE_COST,
|
|
553
872
|
summary: "Record that a creator agreed to collaborate",
|
|
554
873
|
description: "Records that the creator agreed to work with the user, with the agreed terms, and moves them to the collaboration stage, waiting on the user to prepare it. Free. Call it only once the creator has clearly said yes to the terms; it sends nothing to the creator. Needs an email sent first. Confirming the same terms again changes nothing.",
|
|
555
874
|
input: z3.object({
|
|
@@ -567,8 +886,9 @@ var addCreator = defineOperation({
|
|
|
567
886
|
method: "POST",
|
|
568
887
|
path: "/campaigns/{campaignId}/creators/{creatorId}",
|
|
569
888
|
kind: "spend",
|
|
570
|
-
|
|
571
|
-
|
|
889
|
+
cost: ADD_CREATOR_COST,
|
|
890
|
+
summary: "Add and unlock a creator in a campaign",
|
|
891
|
+
description: "Adds a creator to a campaign, at the outreach stage, without revealing the email, and returns a credits receipt (charged and remaining balance). Adding unlocks the creator, which costs 0.5 credits the first time for each creator; adding again or adding an already unlocked creator is free. Use add_to_list instead if you only want to shortlist creators for free without unlocking (reveal_contact adds the creator too). Pass searchId to mark the creator as added in that search.",
|
|
572
892
|
input: z3.object({
|
|
573
893
|
campaignId,
|
|
574
894
|
creatorId,
|
|
@@ -581,6 +901,7 @@ var excludeCreator = defineOperation({
|
|
|
581
901
|
method: "POST",
|
|
582
902
|
path: "/campaigns/{campaignId}/creators/{creatorId}/exclusion",
|
|
583
903
|
kind: "write",
|
|
904
|
+
cost: FREE_COST,
|
|
584
905
|
summary: "Hide a creator from discovery for a campaign",
|
|
585
906
|
description: "Marks a creator as Not Fit for discovery in this campaign. Searches, recommendations and similar-creator results omit them. Pass searchId to hide them in that search as well. Free.",
|
|
586
907
|
input: z3.object({
|
|
@@ -589,16 +910,34 @@ var excludeCreator = defineOperation({
|
|
|
589
910
|
searchId: z3.string().trim().min(1).optional().describe("A search to drop the creator from as well")
|
|
590
911
|
})
|
|
591
912
|
});
|
|
913
|
+
var exportCampaign = defineOperation({
|
|
914
|
+
name: "export_campaign",
|
|
915
|
+
command: ["campaigns", "export"],
|
|
916
|
+
method: "GET",
|
|
917
|
+
path: "/campaigns/{campaignId}/export",
|
|
918
|
+
kind: "write",
|
|
919
|
+
cost: FREE_COST,
|
|
920
|
+
summary: "Export a campaign\u2019s creators as CSV",
|
|
921
|
+
description: "Returns a campaign\u2019s active creators (or a selected subset via creatorIds) as CSV text: handles and profile links only for unlocked creators, and the Email column (unless includeEmail is false) only for ones already revealed. Exporting costs no credits; call preview_export and prepare_export first if you want to unlock missing profiles or reveal emails before downloading. Records the returned creators as exported for excludeExported. Save csv to a file named filename.",
|
|
922
|
+
input: z3.object({
|
|
923
|
+
campaignId,
|
|
924
|
+
creatorIds: z3.array(creatorId).min(1).max(100).optional().describe(
|
|
925
|
+
"Optional subset of 1 to 100 creator IDs in this campaign, in desired order"
|
|
926
|
+
),
|
|
927
|
+
includeEmail: includeEmailColumn
|
|
928
|
+
})
|
|
929
|
+
});
|
|
592
930
|
var listTrendingVideos = defineOperation({
|
|
593
931
|
name: "list_trending_videos",
|
|
594
932
|
command: ["trends", "videos"],
|
|
595
933
|
method: "GET",
|
|
596
934
|
path: "/trends/videos",
|
|
597
935
|
kind: "read",
|
|
936
|
+
cost: FREE_COST,
|
|
598
937
|
summary: "List recent viral videos across platforms",
|
|
599
938
|
description: "Lists quality-gated viral videos (10x+ above each creator\u2019s baseline views) across YouTube, Instagram and TikTok, deduplicated to one top video per creator by default. Free. Returns video metrics, hashtags, creatorId, creatorName, hasEmail and account access states (identityUnlocked, emailUnlocked, isSaved, campaignMemberships). Source video IDs, creator handles and playback links stay hidden until the creator is unlocked (unlock_creator, add_creator or reveal_contact).",
|
|
600
939
|
input: z3.object({
|
|
601
|
-
platform: z3.enum(
|
|
940
|
+
platform: z3.enum(TREND_PLATFORMS).optional().describe("Limit to youtube, instagram or tiktok"),
|
|
602
941
|
niche: z3.enum(CREATOR_NICHES).optional().describe("Limit to creators in this niche"),
|
|
603
942
|
country: z3.string().trim().length(2).optional().describe("Two-letter creator country code, e.g. US, GB, JP"),
|
|
604
943
|
window: z3.enum(["24h", "7d", "30d"]).optional().describe("Time window: 24h, 7d or 30d (default 30d)"),
|
|
@@ -619,10 +958,11 @@ var listTrendingHashtags = defineOperation({
|
|
|
619
958
|
method: "GET",
|
|
620
959
|
path: "/trends/hashtags",
|
|
621
960
|
kind: "read",
|
|
961
|
+
cost: FREE_COST,
|
|
622
962
|
summary: "List rising and popular hashtags across platforms",
|
|
623
963
|
description: "Lists trending hashtags across YouTube, Instagram and TikTok using Creator River\u2019s dual-track trend engine: steady 7-day momentum baselines by default, or live viral-video aggregations when filtering by country, time window, sponsored status or business email availability. Free. Returns each tag, state, creator count, total views, delta, related tags and sample creators with creatorId and hasEmail (no handles until unlocked).",
|
|
624
964
|
input: z3.object({
|
|
625
|
-
platform: z3.enum(
|
|
965
|
+
platform: z3.enum(TREND_PLATFORMS).optional().describe("Limit to youtube, instagram or tiktok"),
|
|
626
966
|
niche: z3.enum(CREATOR_NICHES).optional().describe("Limit to a content niche"),
|
|
627
967
|
country: z3.string().trim().length(2).optional().describe("Two-letter creator country code, e.g. US, GB, DE"),
|
|
628
968
|
window: z3.enum(["24h", "7d", "30d"]).optional().describe(
|
|
@@ -638,6 +978,8 @@ var listTrendingHashtags = defineOperation({
|
|
|
638
978
|
});
|
|
639
979
|
var operations = [
|
|
640
980
|
getAccount,
|
|
981
|
+
getPricing,
|
|
982
|
+
getCreditHistory,
|
|
641
983
|
searchCreators,
|
|
642
984
|
browseCreators,
|
|
643
985
|
findCreator,
|
|
@@ -655,11 +997,22 @@ var operations = [
|
|
|
655
997
|
saveCreator,
|
|
656
998
|
unsaveCreator,
|
|
657
999
|
listSavedCreators,
|
|
1000
|
+
listLists,
|
|
1001
|
+
createList,
|
|
1002
|
+
updateList,
|
|
1003
|
+
deleteList,
|
|
1004
|
+
getList,
|
|
1005
|
+
addToList,
|
|
1006
|
+
removeFromList,
|
|
1007
|
+
exportList,
|
|
1008
|
+
previewExport,
|
|
1009
|
+
prepareExport,
|
|
658
1010
|
listCampaigns,
|
|
659
1011
|
createCampaign,
|
|
660
1012
|
updateCampaign,
|
|
661
1013
|
getCampaignStatus,
|
|
662
1014
|
addCreator,
|
|
1015
|
+
exportCampaign,
|
|
663
1016
|
revealContact,
|
|
664
1017
|
revealContacts,
|
|
665
1018
|
sendEmail,
|
|
@@ -670,10 +1023,10 @@ var operations = [
|
|
|
670
1023
|
];
|
|
671
1024
|
|
|
672
1025
|
// src/cli.ts
|
|
673
|
-
import { Command, CommanderError } from "commander";
|
|
1026
|
+
import { Command, CommanderError, Option } from "commander";
|
|
674
1027
|
|
|
675
1028
|
// package.json
|
|
676
|
-
var version = "0.
|
|
1029
|
+
var version = "0.8.1";
|
|
677
1030
|
|
|
678
1031
|
// src/http.ts
|
|
679
1032
|
var DEFAULT_API_URL = "https://www.creatorriver.com";
|
|
@@ -737,19 +1090,12 @@ async function send(endpoint2, url, init) {
|
|
|
737
1090
|
`Unexpected response from ${url.origin} (HTTP ${response.status})`
|
|
738
1091
|
);
|
|
739
1092
|
}
|
|
740
|
-
|
|
1093
|
+
function buildOperationRequest(operation, input, endpoint2) {
|
|
741
1094
|
const params = new Set(pathParamNames(operation.path));
|
|
742
1095
|
const fields = Object.entries(input).filter(
|
|
743
1096
|
([name, value]) => !params.has(name) && value !== void 0
|
|
744
1097
|
);
|
|
745
|
-
const url = apiUrl(
|
|
746
|
-
const headers = {
|
|
747
|
-
authorization: `Bearer ${connection.apiKey}`
|
|
748
|
-
};
|
|
749
|
-
const init = {
|
|
750
|
-
method: operation.method,
|
|
751
|
-
headers
|
|
752
|
-
};
|
|
1098
|
+
const url = apiUrl(endpoint2, `/api/v1${fillPath(operation.path, input)}`);
|
|
753
1099
|
if (operation.method === "GET") {
|
|
754
1100
|
for (const [name, value] of fields) {
|
|
755
1101
|
url.searchParams.set(
|
|
@@ -757,11 +1103,28 @@ async function callOperation(operation, input, connection) {
|
|
|
757
1103
|
Array.isArray(value) ? value.join(",") : String(value)
|
|
758
1104
|
);
|
|
759
1105
|
}
|
|
760
|
-
|
|
1106
|
+
return { method: operation.method, url };
|
|
1107
|
+
}
|
|
1108
|
+
return {
|
|
1109
|
+
method: operation.method,
|
|
1110
|
+
url,
|
|
1111
|
+
body: Object.fromEntries(fields)
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
async function callOperation(operation, input, connection) {
|
|
1115
|
+
const built = buildOperationRequest(operation, input, connection);
|
|
1116
|
+
const headers = {
|
|
1117
|
+
authorization: `Bearer ${connection.apiKey}`
|
|
1118
|
+
};
|
|
1119
|
+
const init = {
|
|
1120
|
+
method: built.method,
|
|
1121
|
+
headers
|
|
1122
|
+
};
|
|
1123
|
+
if (built.body !== void 0) {
|
|
761
1124
|
headers["content-type"] = "application/json";
|
|
762
|
-
init.body = JSON.stringify(
|
|
1125
|
+
init.body = JSON.stringify(built.body);
|
|
763
1126
|
}
|
|
764
|
-
return send(connection, url, init);
|
|
1127
|
+
return send(connection, built.url, init);
|
|
765
1128
|
}
|
|
766
1129
|
function postJson(endpoint2, path, body) {
|
|
767
1130
|
return send(endpoint2, apiUrl(endpoint2, path), {
|
|
@@ -897,8 +1260,10 @@ async function waitForLogin(endpoint2, io, login, waitSeconds) {
|
|
|
897
1260
|
var LOGIN_HINT = "run `creatorriver auth login`";
|
|
898
1261
|
var GROUP_DESCRIPTIONS = {
|
|
899
1262
|
creators: "Find, inspect, unlock and save creators, and find more like one",
|
|
1263
|
+
lists: "Create, manage and export creator lists",
|
|
1264
|
+
exports: "Preview costs and unlock creators before exporting CSV",
|
|
900
1265
|
trends: "List recent viral videos and rising hashtags across platforms",
|
|
901
|
-
campaigns: "Create, change and
|
|
1266
|
+
campaigns: "Create, change, follow and export campaigns and the creators in them",
|
|
902
1267
|
contacts: "Reveal email addresses for one or more selected creators",
|
|
903
1268
|
emails: "Send outreach emails",
|
|
904
1269
|
conversations: "Read email threads with creators and record their replies",
|
|
@@ -913,6 +1278,34 @@ function forCli(text, operations2) {
|
|
|
913
1278
|
text
|
|
914
1279
|
);
|
|
915
1280
|
}
|
|
1281
|
+
function formatCliSummary(operation) {
|
|
1282
|
+
return operation.cost.model === "free" ? operation.summary : `${operation.summary} [${operation.cost.label}]`;
|
|
1283
|
+
}
|
|
1284
|
+
function formatCliDescription(operation, operations2) {
|
|
1285
|
+
const base = forCli(operation.description, operations2) ?? "";
|
|
1286
|
+
const note = forCli(operation.cost.note, operations2);
|
|
1287
|
+
const costLine = note ? `Cost: ${operation.cost.label} \u2014 ${note}` : `Cost: ${operation.cost.label}`;
|
|
1288
|
+
return base ? `${base}
|
|
1289
|
+
|
|
1290
|
+
${costLine}` : costLine;
|
|
1291
|
+
}
|
|
1292
|
+
function dryRunNote(operation, input) {
|
|
1293
|
+
if (operation.cost.model === "free") {
|
|
1294
|
+
return void 0;
|
|
1295
|
+
}
|
|
1296
|
+
if (operation.cost.model === "quota") {
|
|
1297
|
+
return "0 credits; may count toward the daily search allowance (check `creatorriver account` or `creatorriver pricing`).";
|
|
1298
|
+
}
|
|
1299
|
+
if (operation.name === "send_email") {
|
|
1300
|
+
return "First 100 outreach emails/day are free (Pro subscriptions allow 101-200/day at 0.1 credits each). Check `creatorriver account` for remaining free emails today.";
|
|
1301
|
+
}
|
|
1302
|
+
if (Array.isArray(input.creatorIds) && input.creatorIds.length > 0) {
|
|
1303
|
+
const ids = input.creatorIds.join(",");
|
|
1304
|
+
const noEmailFlag = operation.name === "prepare_export" && input.includeEmail === false ? " --no-include-email" : "";
|
|
1305
|
+
return `Upper bound assuming none are unlocked yet. Run \`creatorriver exports preview --creator-ids ${ids}${noEmailFlag}\` for an exact account-scoped quote.`;
|
|
1306
|
+
}
|
|
1307
|
+
return "Upper bound assuming this creator has not been unlocked or revealed yet; repeating already-paid items costs 0 credits.";
|
|
1308
|
+
}
|
|
916
1309
|
function describeFlag(field, operations2) {
|
|
917
1310
|
return [
|
|
918
1311
|
forCli(field.description, operations2),
|
|
@@ -945,7 +1338,7 @@ function buildInput(fields, options) {
|
|
|
945
1338
|
for (const field of fields) {
|
|
946
1339
|
const value = options[field.name];
|
|
947
1340
|
if (value === void 0) continue;
|
|
948
|
-
input[field.name] = field.kind === "boolean" ?
|
|
1341
|
+
input[field.name] = field.kind === "boolean" ? Boolean(value) : parseFieldText(field, String(value));
|
|
949
1342
|
}
|
|
950
1343
|
return input;
|
|
951
1344
|
}
|
|
@@ -1020,17 +1413,22 @@ Exit codes: 0 ok, ${Object.entries(EXIT_CODES).sort(([, a], [, b]) => a - b).map
|
|
|
1020
1413
|
parent = program.commands.find((command2) => command2.name() === first) ?? program.command(first).description(GROUP_DESCRIPTIONS[first] ?? "");
|
|
1021
1414
|
}
|
|
1022
1415
|
const fields = describeFields(operation.input);
|
|
1023
|
-
const command = parent.command(second ?? first).summary(operation
|
|
1416
|
+
const command = parent.command(second ?? first).summary(formatCliSummary(operation)).description(formatCliDescription(operation, operations2));
|
|
1024
1417
|
for (const field of fields) {
|
|
1025
1418
|
const flag = flagName(field.name);
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1419
|
+
if (field.kind === "boolean") {
|
|
1420
|
+
command.option(flag, describeFlag(field, operations2));
|
|
1421
|
+
command.addOption(new Option(`--no-${flag.slice(2)}`).hideHelp());
|
|
1422
|
+
} else {
|
|
1423
|
+
command.option(`${flag} <value>`, describeFlag(field, operations2));
|
|
1424
|
+
}
|
|
1030
1425
|
}
|
|
1031
1426
|
command.option(
|
|
1032
1427
|
"--input-json <json>",
|
|
1033
1428
|
"the whole input as a JSON object; flags override its fields"
|
|
1429
|
+
).option(
|
|
1430
|
+
"--dry-run",
|
|
1431
|
+
"preview the request and estimated maximum credit cost without calling the API"
|
|
1034
1432
|
).action(async (options) => {
|
|
1035
1433
|
try {
|
|
1036
1434
|
const parsed = operation.input.strict().safeParse(buildInput(fields, options));
|
|
@@ -1042,9 +1440,34 @@ Exit codes: 0 ok, ${Object.entries(EXIT_CODES).sort(([, a], [, b]) => a - b).map
|
|
|
1042
1440
|
}))
|
|
1043
1441
|
});
|
|
1044
1442
|
}
|
|
1443
|
+
const validatedInput = parsed.data;
|
|
1444
|
+
if (options.dryRun === true) {
|
|
1445
|
+
const built = buildOperationRequest(
|
|
1446
|
+
operation,
|
|
1447
|
+
validatedInput,
|
|
1448
|
+
endpoint(io)
|
|
1449
|
+
);
|
|
1450
|
+
const estimatedMaxCredits = estimateMaxOperationCredits(
|
|
1451
|
+
operation,
|
|
1452
|
+
validatedInput
|
|
1453
|
+
);
|
|
1454
|
+
const note = dryRunNote(operation, validatedInput);
|
|
1455
|
+
succeed({
|
|
1456
|
+
dryRun: true,
|
|
1457
|
+
operation: operation.name,
|
|
1458
|
+
command: operation.command.join(" "),
|
|
1459
|
+
method: built.method,
|
|
1460
|
+
url: built.url.toString(),
|
|
1461
|
+
...built.body !== void 0 ? { body: built.body } : {},
|
|
1462
|
+
cost: operation.cost,
|
|
1463
|
+
estimatedMaxCredits,
|
|
1464
|
+
...note ? { note } : {}
|
|
1465
|
+
});
|
|
1466
|
+
return;
|
|
1467
|
+
}
|
|
1045
1468
|
const data = await callOperation(
|
|
1046
1469
|
operation,
|
|
1047
|
-
|
|
1470
|
+
validatedInput,
|
|
1048
1471
|
await connect(io)
|
|
1049
1472
|
);
|
|
1050
1473
|
succeed(data);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "creatorriver",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Creator River CLI: search 10M+ YouTube, TikTok and
|
|
3
|
+
"version": "0.8.1",
|
|
4
|
+
"description": "Creator River CLI: search 10M+ YouTube, TikTok, Instagram and X creators, every one with a contact email, and run outreach from your terminal or AI agent",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"creator-river",
|
|
7
7
|
"influencer-marketing",
|