influship 0.2.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/CHANGELOG.md +62 -30
  2. package/LICENSE +1 -1
  3. package/README.md +88 -43
  4. package/client.d.mts +49 -29
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +49 -29
  7. package/client.d.ts.map +1 -1
  8. package/client.js +89 -56
  9. package/client.js.map +1 -1
  10. package/client.mjs +89 -56
  11. package/client.mjs.map +1 -1
  12. package/core/api-promise.d.mts +2 -2
  13. package/core/api-promise.d.mts.map +1 -1
  14. package/core/api-promise.d.ts +2 -2
  15. package/core/api-promise.d.ts.map +1 -1
  16. package/core/api-promise.js.map +1 -1
  17. package/core/api-promise.mjs.map +1 -1
  18. package/core/error.d.mts +2 -2
  19. package/core/error.d.mts.map +1 -1
  20. package/core/error.d.ts +2 -2
  21. package/core/error.d.ts.map +1 -1
  22. package/core/error.js +4 -4
  23. package/core/error.js.map +1 -1
  24. package/core/error.mjs +2 -2
  25. package/core/error.mjs.map +1 -1
  26. package/core/pagination.d.mts +75 -0
  27. package/core/pagination.d.mts.map +1 -0
  28. package/core/pagination.d.ts +75 -0
  29. package/core/pagination.d.ts.map +1 -0
  30. package/core/pagination.js +139 -0
  31. package/core/pagination.js.map +1 -0
  32. package/core/pagination.mjs +132 -0
  33. package/core/pagination.mjs.map +1 -0
  34. package/core/resource.d.mts +3 -3
  35. package/core/resource.d.mts.map +1 -1
  36. package/core/resource.d.ts +3 -3
  37. package/core/resource.d.ts.map +1 -1
  38. package/core/resource.js.map +1 -1
  39. package/core/resource.mjs.map +1 -1
  40. package/index.d.mts +4 -3
  41. package/index.d.mts.map +1 -1
  42. package/index.d.ts +4 -3
  43. package/index.d.ts.map +1 -1
  44. package/index.js +6 -4
  45. package/index.js.map +1 -1
  46. package/index.mjs +4 -3
  47. package/index.mjs.map +1 -1
  48. package/internal/parse.d.mts +2 -2
  49. package/internal/parse.d.mts.map +1 -1
  50. package/internal/parse.d.ts +2 -2
  51. package/internal/parse.d.ts.map +1 -1
  52. package/internal/parse.js +5 -0
  53. package/internal/parse.js.map +1 -1
  54. package/internal/parse.mjs +5 -0
  55. package/internal/parse.mjs.map +1 -1
  56. package/internal/shims.js +1 -1
  57. package/internal/shims.js.map +1 -1
  58. package/internal/shims.mjs +1 -1
  59. package/internal/shims.mjs.map +1 -1
  60. package/internal/tslib.js +17 -17
  61. package/internal/uploads.d.mts +4 -4
  62. package/internal/uploads.d.mts.map +1 -1
  63. package/internal/uploads.d.ts +4 -4
  64. package/internal/uploads.d.ts.map +1 -1
  65. package/internal/uploads.js.map +1 -1
  66. package/internal/uploads.mjs.map +1 -1
  67. package/internal/utils/base64.js +2 -2
  68. package/internal/utils/base64.js.map +1 -1
  69. package/internal/utils/base64.mjs +3 -3
  70. package/internal/utils/base64.mjs.map +1 -1
  71. package/internal/utils/log.d.mts +3 -3
  72. package/internal/utils/log.d.mts.map +1 -1
  73. package/internal/utils/log.d.ts +3 -3
  74. package/internal/utils/log.d.ts.map +1 -1
  75. package/internal/utils/log.js.map +1 -1
  76. package/internal/utils/log.mjs.map +1 -1
  77. package/internal/utils/path.js +1 -1
  78. package/internal/utils/path.js.map +1 -1
  79. package/internal/utils/path.mjs +2 -2
  80. package/internal/utils/path.mjs.map +1 -1
  81. package/internal/utils/query.d.mts +2 -0
  82. package/internal/utils/query.d.mts.map +1 -0
  83. package/internal/utils/query.d.ts +2 -0
  84. package/internal/utils/query.d.ts.map +1 -0
  85. package/internal/utils/query.js +10 -0
  86. package/internal/utils/query.js.map +1 -0
  87. package/internal/utils/query.mjs +6 -0
  88. package/internal/utils/query.mjs.map +1 -0
  89. package/internal/utils/values.js +5 -5
  90. package/internal/utils/values.js.map +1 -1
  91. package/internal/utils/values.mjs +6 -6
  92. package/internal/utils/values.mjs.map +1 -1
  93. package/internal/utils.d.mts +1 -0
  94. package/internal/utils.d.ts +1 -0
  95. package/internal/utils.js +1 -0
  96. package/internal/utils.js.map +1 -1
  97. package/internal/utils.mjs +1 -0
  98. package/package.json +24 -3
  99. package/pagination.d.mts +2 -0
  100. package/pagination.d.mts.map +1 -0
  101. package/pagination.d.ts +2 -0
  102. package/pagination.d.ts.map +1 -0
  103. package/pagination.js +6 -0
  104. package/pagination.js.map +1 -0
  105. package/pagination.mjs +2 -0
  106. package/pagination.mjs.map +1 -0
  107. package/resources/creators.d.mts +326 -247
  108. package/resources/creators.d.mts.map +1 -1
  109. package/resources/creators.d.ts +326 -247
  110. package/resources/creators.d.ts.map +1 -1
  111. package/resources/creators.js +80 -63
  112. package/resources/creators.js.map +1 -1
  113. package/resources/creators.mjs +80 -63
  114. package/resources/creators.mjs.map +1 -1
  115. package/resources/health.d.mts +13 -1
  116. package/resources/health.d.mts.map +1 -1
  117. package/resources/health.d.ts +13 -1
  118. package/resources/health.d.ts.map +1 -1
  119. package/resources/health.js +4 -1
  120. package/resources/health.js.map +1 -1
  121. package/resources/health.mjs +4 -1
  122. package/resources/health.mjs.map +1 -1
  123. package/resources/index.d.mts +6 -7
  124. package/resources/index.d.mts.map +1 -1
  125. package/resources/index.d.ts +6 -7
  126. package/resources/index.d.ts.map +1 -1
  127. package/resources/index.js +5 -7
  128. package/resources/index.js.map +1 -1
  129. package/resources/index.mjs +2 -3
  130. package/resources/index.mjs.map +1 -1
  131. package/resources/posts.d.mts +82 -202
  132. package/resources/posts.d.mts.map +1 -1
  133. package/resources/posts.d.ts +82 -202
  134. package/resources/posts.d.ts.map +1 -1
  135. package/resources/posts.js +17 -38
  136. package/resources/posts.js.map +1 -1
  137. package/resources/posts.mjs +17 -38
  138. package/resources/posts.mjs.map +1 -1
  139. package/resources/profiles.d.mts +208 -58
  140. package/resources/profiles.d.mts.map +1 -1
  141. package/resources/profiles.d.ts +208 -58
  142. package/resources/profiles.d.ts.map +1 -1
  143. package/resources/profiles.js +37 -41
  144. package/resources/profiles.js.map +1 -1
  145. package/resources/profiles.mjs +37 -41
  146. package/resources/profiles.mjs.map +1 -1
  147. package/resources/raw/index.d.mts +4 -0
  148. package/resources/raw/index.d.mts.map +1 -0
  149. package/resources/raw/index.d.ts +4 -0
  150. package/resources/raw/index.d.ts.map +1 -0
  151. package/resources/raw/index.js +11 -0
  152. package/resources/raw/index.js.map +1 -0
  153. package/resources/raw/index.mjs +5 -0
  154. package/resources/raw/index.mjs.map +1 -0
  155. package/resources/raw/instagram.d.mts +215 -0
  156. package/resources/raw/instagram.d.mts.map +1 -0
  157. package/resources/raw/instagram.d.ts +215 -0
  158. package/resources/raw/instagram.d.ts.map +1 -0
  159. package/resources/raw/instagram.js +31 -0
  160. package/resources/raw/instagram.js.map +1 -0
  161. package/resources/raw/instagram.mjs +27 -0
  162. package/resources/raw/instagram.mjs.map +1 -0
  163. package/resources/raw/raw.d.mts +14 -0
  164. package/resources/raw/raw.d.mts.map +1 -0
  165. package/resources/raw/raw.d.ts +14 -0
  166. package/resources/raw/raw.d.ts.map +1 -0
  167. package/resources/raw/raw.js +21 -0
  168. package/resources/raw/raw.js.map +1 -0
  169. package/resources/raw/raw.mjs +16 -0
  170. package/resources/raw/raw.mjs.map +1 -0
  171. package/resources/raw/youtube.d.mts +455 -0
  172. package/resources/raw/youtube.d.mts.map +1 -0
  173. package/resources/raw/youtube.d.ts +455 -0
  174. package/resources/raw/youtube.d.ts.map +1 -0
  175. package/resources/raw/youtube.js +61 -0
  176. package/resources/raw/youtube.js.map +1 -0
  177. package/resources/raw/youtube.mjs +57 -0
  178. package/resources/raw/youtube.mjs.map +1 -0
  179. package/resources/raw.d.mts +2 -0
  180. package/resources/raw.d.mts.map +1 -0
  181. package/resources/raw.d.ts +2 -0
  182. package/resources/raw.d.ts.map +1 -0
  183. package/resources/raw.js +6 -0
  184. package/resources/raw.js.map +1 -0
  185. package/resources/raw.mjs +3 -0
  186. package/resources/raw.mjs.map +1 -0
  187. package/resources/search.d.mts +126 -117
  188. package/resources/search.d.mts.map +1 -1
  189. package/resources/search.d.ts +126 -117
  190. package/resources/search.d.ts.map +1 -1
  191. package/resources/search.js +46 -13
  192. package/resources/search.js.map +1 -1
  193. package/resources/search.mjs +46 -13
  194. package/resources/search.mjs.map +1 -1
  195. package/resources/shared.d.mts +55 -0
  196. package/resources/shared.d.mts.map +1 -0
  197. package/resources/shared.d.ts +55 -0
  198. package/resources/shared.d.ts.map +1 -0
  199. package/resources/shared.js +4 -0
  200. package/resources/shared.js.map +1 -0
  201. package/resources/shared.mjs +3 -0
  202. package/resources/shared.mjs.map +1 -0
  203. package/src/client.ts +153 -127
  204. package/src/core/api-promise.ts +4 -4
  205. package/src/core/error.ts +2 -2
  206. package/src/core/pagination.ts +232 -0
  207. package/src/core/resource.ts +3 -3
  208. package/src/index.ts +4 -3
  209. package/src/internal/parse.ts +8 -2
  210. package/src/internal/shims.ts +1 -1
  211. package/src/internal/uploads.ts +5 -5
  212. package/src/internal/utils/base64.ts +3 -3
  213. package/src/internal/utils/log.ts +3 -3
  214. package/src/internal/utils/path.ts +2 -2
  215. package/src/internal/utils/query.ts +7 -0
  216. package/src/internal/utils/values.ts +6 -6
  217. package/src/internal/utils.ts +1 -0
  218. package/src/pagination.ts +2 -0
  219. package/src/resources/creators.ts +369 -271
  220. package/src/resources/health.ts +13 -1
  221. package/src/resources/index.ts +22 -41
  222. package/src/resources/posts.ts +89 -232
  223. package/src/resources/profiles.ts +252 -59
  224. package/src/resources/raw/index.ts +16 -0
  225. package/src/resources/raw/instagram.ts +271 -0
  226. package/src/resources/raw/raw.ts +47 -0
  227. package/src/resources/raw/youtube.ts +585 -0
  228. package/src/resources/raw.ts +3 -0
  229. package/src/resources/search.ts +145 -131
  230. package/src/resources/shared.ts +66 -0
  231. package/src/version.ts +1 -1
  232. package/version.d.mts +1 -1
  233. package/version.d.ts +1 -1
  234. package/version.js +1 -1
  235. package/version.mjs +1 -1
  236. package/resources/brand-safety.d.mts +0 -234
  237. package/resources/brand-safety.d.mts.map +0 -1
  238. package/resources/brand-safety.d.ts +0 -234
  239. package/resources/brand-safety.d.ts.map +0 -1
  240. package/resources/brand-safety.js +0 -75
  241. package/resources/brand-safety.js.map +0 -1
  242. package/resources/brand-safety.mjs +0 -71
  243. package/resources/brand-safety.mjs.map +0 -1
  244. package/resources/lookalike.d.mts +0 -142
  245. package/resources/lookalike.d.mts.map +0 -1
  246. package/resources/lookalike.d.ts +0 -142
  247. package/resources/lookalike.d.ts.map +0 -1
  248. package/resources/lookalike.js +0 -28
  249. package/resources/lookalike.js.map +0 -1
  250. package/resources/lookalike.mjs +0 -24
  251. package/resources/lookalike.mjs.map +0 -1
  252. package/resources/match.d.mts +0 -90
  253. package/resources/match.d.mts.map +0 -1
  254. package/resources/match.d.ts +0 -90
  255. package/resources/match.d.ts.map +0 -1
  256. package/resources/match.js +0 -22
  257. package/resources/match.js.map +0 -1
  258. package/resources/match.mjs +0 -18
  259. package/resources/match.mjs.map +0 -1
  260. package/src/resources/brand-safety.ts +0 -304
  261. package/src/resources/lookalike.ts +0 -186
  262. package/src/resources/match.ts +0 -115
@@ -1,304 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../core/resource';
4
- import * as ProfilesAPI from './profiles';
5
- import { APIPromise } from '../core/api-promise';
6
- import { RequestOptions } from '../internal/request-options';
7
-
8
- export class BrandSafety extends APIResource {
9
- /**
10
- * Analyze creators for brand safety risks using AI-powered content analysis.
11
- *
12
- * This endpoint evaluates creators for potential brand safety issues including
13
- * controversial content, inappropriate associations, and reputation risks.
14
- *
15
- * **Pricing**: 2.0 credits per creator analyzed
16
- *
17
- * @example
18
- * ```ts
19
- * const response = await client.brandSafety.analyzeCreators({
20
- * creator_ids: [
21
- * '123e4567-e89b-12d3-a456-426614174000',
22
- * '987fcdeb-51a2-43d1-9f12-345678901234',
23
- * ],
24
- * });
25
- * ```
26
- */
27
- analyzeCreators(
28
- body: BrandSafetyAnalyzeCreatorsParams,
29
- options?: RequestOptions,
30
- ): APIPromise<BrandSafetyAnalyzeCreatorsResponse> {
31
- return this._client.post('/v1/brand-safety/creators', { body, ...options });
32
- }
33
-
34
- /**
35
- * Analyze individual posts for brand safety risks.
36
- *
37
- * This endpoint evaluates specific posts for potential brand safety issues.
38
- *
39
- * **Pricing**: 0.5 credits per post analyzed
40
- *
41
- * @example
42
- * ```ts
43
- * const response = await client.brandSafety.analyzePosts({
44
- * posts: [
45
- * {
46
- * platform: 'instagram',
47
- * url: 'https://www.instagram.com/p/Cx123Sample/',
48
- * },
49
- * {
50
- * platform: 'instagram',
51
- * post_id: '9876543210987654321',
52
- * },
53
- * ],
54
- * });
55
- * ```
56
- */
57
- analyzePosts(
58
- body: BrandSafetyAnalyzePostsParams,
59
- options?: RequestOptions,
60
- ): APIPromise<BrandSafetyAnalyzePostsResponse> {
61
- return this._client.post('/v1/brand-safety/posts', { body, ...options });
62
- }
63
-
64
- /**
65
- * Analyze social media profiles for brand safety risks.
66
- *
67
- * This endpoint evaluates profiles by username for potential brand safety issues.
68
- *
69
- * **Pricing**: 2.0 credits per profile analyzed
70
- *
71
- * @example
72
- * ```ts
73
- * const response = await client.brandSafety.analyzeProfiles({
74
- * profiles: [
75
- * { platform: 'instagram', username: 'wellnessdaily' },
76
- * ],
77
- * });
78
- * ```
79
- */
80
- analyzeProfiles(
81
- body: BrandSafetyAnalyzeProfilesParams,
82
- options?: RequestOptions,
83
- ): APIPromise<BrandSafetyAnalyzeProfilesResponse> {
84
- return this._client.post('/v1/brand-safety/profiles', { body, ...options });
85
- }
86
- }
87
-
88
- /**
89
- * Brand safety analysis results
90
- */
91
- export interface BrandSafetyAnalysis {
92
- /**
93
- * Specific safety concerns detected. Empty array = no issues found.
94
- */
95
- flags: Array<BrandSafetyFlag>;
96
-
97
- metadata: BrandSafetyAnalysis.Metadata;
98
-
99
- /**
100
- * Whether the analysis completed successfully
101
- */
102
- ok: boolean;
103
-
104
- /**
105
- * Confidence score (0-1) for the rating. >0.8 = high confidence.
106
- */
107
- overall_confidence: number;
108
-
109
- /**
110
- * Brand safety rating. A = safe (no risks), B = moderate concerns, C = significant
111
- * risks.
112
- */
113
- rating: 'A' | 'B' | 'C';
114
-
115
- /**
116
- * Detailed reasoning explaining the analysis result. Includes context about
117
- * content analyzed and decision factors.
118
- */
119
- reasoning: string;
120
-
121
- /**
122
- * Human-readable summary of the assessment.
123
- */
124
- summary: string;
125
- }
126
-
127
- export namespace BrandSafetyAnalysis {
128
- export interface Metadata {
129
- /**
130
- * When the analysis was performed
131
- */
132
- analysis_date: string;
133
-
134
- /**
135
- * Information about the content that was analyzed
136
- */
137
- content_analyzed: Metadata.ContentAnalyzed;
138
-
139
- /**
140
- * Version of the AI model used for analysis
141
- */
142
- model_version: string;
143
-
144
- /**
145
- * Processing time in milliseconds
146
- */
147
- processing_time_ms: number;
148
- }
149
-
150
- export namespace Metadata {
151
- /**
152
- * Information about the content that was analyzed
153
- */
154
- export interface ContentAnalyzed {
155
- /**
156
- * Number of posts analyzed (for profile/creator analysis)
157
- */
158
- posts_count?: number;
159
-
160
- /**
161
- * Length of text content analyzed
162
- */
163
- text_length?: number;
164
- }
165
- }
166
- }
167
-
168
- /**
169
- * Individual brand safety flag with detailed information
170
- */
171
- export interface BrandSafetyFlag {
172
- /**
173
- * Confidence score for this specific flag (0-1). Higher values indicate greater
174
- * certainty about this concern.
175
- */
176
- confidence: number;
177
-
178
- /**
179
- * Human-readable description explaining the concern. Provides context about what
180
- * was detected.
181
- */
182
- description: string;
183
-
184
- /**
185
- * Severity level of the concern:
186
- *
187
- * - `low`: Minor issue, may be acceptable for some brands
188
- * - `medium`: Moderate concern, evaluate based on brand guidelines
189
- * - `high`: Significant risk, likely unsuitable for most brands
190
- */
191
- severity: 'low' | 'medium' | 'high';
192
-
193
- /**
194
- * Category of brand safety concern detected:
195
- *
196
- * - `adult_sexual_content`: Sexually explicit or suggestive content
197
- * - `profanity_strong_language`: Profanity or offensive language
198
- * - `drugs_alcohol_tobacco`: Drug, alcohol, or tobacco-related content
199
- * - `violence_weapons`: Violent content or weapon references
200
- * - `hate_discrimination`: Hate speech or discriminatory content
201
- * - `political_social_issues`: Politically divisive or controversial topics
202
- * - `misinformation_conspiracy`: Misinformation or conspiracy theories
203
- * - `misc`: Other brand safety concerns
204
- */
205
- type:
206
- | 'adult_sexual_content'
207
- | 'profanity_strong_language'
208
- | 'drugs_alcohol_tobacco'
209
- | 'violence_weapons'
210
- | 'hate_discrimination'
211
- | 'political_social_issues'
212
- | 'misinformation_conspiracy'
213
- | 'misc';
214
-
215
- /**
216
- * Specific examples or evidence that triggered this flag. May include post
217
- * excerpts or contextual information.
218
- */
219
- evidence?: Array<string>;
220
- }
221
-
222
- /**
223
- * Result of brand safety analysis
224
- */
225
- export interface BrandSafetyResult {
226
- /**
227
- * Unique identifier for the analysis result
228
- */
229
- id: string;
230
-
231
- /**
232
- * Brand safety analysis results
233
- */
234
- analysis: BrandSafetyAnalysis;
235
- }
236
-
237
- export interface BrandSafetyAnalyzeCreatorsResponse {
238
- results?: Array<BrandSafetyResult>;
239
- }
240
-
241
- export interface BrandSafetyAnalyzePostsResponse {
242
- results?: Array<BrandSafetyResult>;
243
- }
244
-
245
- export interface BrandSafetyAnalyzeProfilesResponse {
246
- results?: Array<BrandSafetyResult>;
247
- }
248
-
249
- export interface BrandSafetyAnalyzeCreatorsParams {
250
- /**
251
- * Creator IDs to analyze
252
- */
253
- creator_ids: Array<string>;
254
- }
255
-
256
- export interface BrandSafetyAnalyzePostsParams {
257
- posts: Array<
258
- BrandSafetyAnalyzePostsParams.BrandSafetyPostByURL | BrandSafetyAnalyzePostsParams.BrandSafetyPostByID
259
- >;
260
- }
261
-
262
- export namespace BrandSafetyAnalyzePostsParams {
263
- export interface BrandSafetyPostByURL {
264
- /**
265
- * Social media platform hosting the post
266
- */
267
- platform: 'instagram';
268
-
269
- /**
270
- * URL of the post to scan
271
- */
272
- url: string;
273
- }
274
-
275
- export interface BrandSafetyPostByID {
276
- /**
277
- * Social media platform hosting the post
278
- */
279
- platform: 'instagram';
280
-
281
- /**
282
- * Platform-specific post identifier
283
- */
284
- post_id: string;
285
- }
286
- }
287
-
288
- export interface BrandSafetyAnalyzeProfilesParams {
289
- profiles: Array<ProfilesAPI.CreatorReferenceByHandle>;
290
- }
291
-
292
- export declare namespace BrandSafety {
293
- export {
294
- type BrandSafetyAnalysis as BrandSafetyAnalysis,
295
- type BrandSafetyFlag as BrandSafetyFlag,
296
- type BrandSafetyResult as BrandSafetyResult,
297
- type BrandSafetyAnalyzeCreatorsResponse as BrandSafetyAnalyzeCreatorsResponse,
298
- type BrandSafetyAnalyzePostsResponse as BrandSafetyAnalyzePostsResponse,
299
- type BrandSafetyAnalyzeProfilesResponse as BrandSafetyAnalyzeProfilesResponse,
300
- type BrandSafetyAnalyzeCreatorsParams as BrandSafetyAnalyzeCreatorsParams,
301
- type BrandSafetyAnalyzePostsParams as BrandSafetyAnalyzePostsParams,
302
- type BrandSafetyAnalyzeProfilesParams as BrandSafetyAnalyzeProfilesParams,
303
- };
304
- }
@@ -1,186 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../core/resource';
4
- import * as LookalikeAPI from './lookalike';
5
- import * as MatchAPI from './match';
6
- import * as ProfilesAPI from './profiles';
7
- import * as SearchAPI from './search';
8
- import { APIPromise } from '../core/api-promise';
9
- import { RequestOptions } from '../internal/request-options';
10
-
11
- export class Lookalike extends APIResource {
12
- /**
13
- * Find creators similar to your seed creators using AI-powered similarity
14
- * analysis.
15
- *
16
- * This endpoint analyzes your seed creators and finds similar influencers based on
17
- * audience demographics, content style, and engagement patterns.
18
- *
19
- * **Pricing**:
20
- *
21
- * - Base: 1.0 credit per creator returned
22
- * - Detailed mode: Additional 0.05 credits per social account profile
23
- * - **Example**: 25 lookalike creators in lite mode = 25 credits
24
- * - **Example**: 25 creators with avg 3 profiles each in detailed mode = 25 + (25
25
- * × 3 × 0.05) = 28.75 credits
26
- */
27
- findSimilarCreators(
28
- params: LookalikeFindSimilarCreatorsParams,
29
- options?: RequestOptions,
30
- ): APIPromise<LookalikeFindSimilarCreatorsResponse> {
31
- const { cursor, limit, ...body } = params;
32
- return this._client.post('/v1/lookalike', { query: { cursor, limit }, body, ...options });
33
- }
34
- }
35
-
36
- export interface LookalikeSeedBase {
37
- /**
38
- * Weight for this seed in similarity calculation
39
- */
40
- weight?: number;
41
- }
42
-
43
- export interface LookalikeFindSimilarCreatorsResponse {
44
- /**
45
- * Current billing plan
46
- */
47
- billing_plan?: string;
48
-
49
- /**
50
- * Credits consumed for this request
51
- */
52
- credits_charged?: number;
53
-
54
- /**
55
- * Features used in this request
56
- */
57
- features?: Array<string>;
58
-
59
- /**
60
- * Total number of results after filtering
61
- */
62
- filtered_total?: number;
63
-
64
- /**
65
- * Whether there are more results available
66
- */
67
- has_more?: boolean;
68
-
69
- items?: Array<SearchAPI.SearchItem>;
70
-
71
- /**
72
- * Cursor for next page of results
73
- */
74
- next_cursor?: string;
75
-
76
- rate_limit?: LookalikeFindSimilarCreatorsResponse.RateLimit;
77
- }
78
-
79
- export namespace LookalikeFindSimilarCreatorsResponse {
80
- export interface RateLimit {
81
- /**
82
- * Rate limit for this endpoint
83
- */
84
- limit?: number;
85
-
86
- /**
87
- * Remaining requests in current window
88
- */
89
- remaining?: number;
90
-
91
- /**
92
- * Unix timestamp when rate limit resets
93
- */
94
- reset?: number;
95
- }
96
- }
97
-
98
- export interface LookalikeFindSimilarCreatorsParams {
99
- /**
100
- * Body param: Seed creators to find lookalikes for. Max 10 seeds, each with
101
- * optional weight (0-10, default 1).
102
- */
103
- seeds: Array<
104
- | LookalikeFindSimilarCreatorsParams.LookalikeSeedByID
105
- | LookalikeFindSimilarCreatorsParams.LookalikeSeedByHandle
106
- >;
107
-
108
- /**
109
- * Query param: Opaque pagination cursor from previous response's `next_cursor`. Do
110
- * not construct manually.
111
- */
112
- cursor?: string;
113
-
114
- /**
115
- * Query param: Maximum number of results to return
116
- */
117
- limit?: number;
118
-
119
- /**
120
- * Body param:
121
- */
122
- filters?: LookalikeFindSimilarCreatorsParams.Filters;
123
-
124
- /**
125
- * Body param: Response detail level
126
- */
127
- mode?: 'lite' | 'detailed';
128
-
129
- /**
130
- * Body param: Filter which social media profiles to include in the response for
131
- * each creator.
132
- *
133
- * - If not specified, all profiles for each creator are returned
134
- * - If specified, only profiles from these platforms are included
135
- * - This allows you to control which platforms you want to see results from
136
- * - Independent of your seed creators' platforms - you can mix seed types freely
137
- * Example: ["instagram"] to only see instagram profiles, ["instagram", "tiktok"]
138
- * for both
139
- * - This allows you to get cross-platform creators but only show specific platform
140
- * profiles
141
- */
142
- profile_platforms?: Array<'instagram' | 'tiktok'>;
143
- }
144
-
145
- export namespace LookalikeFindSimilarCreatorsParams {
146
- export interface LookalikeSeedByID extends LookalikeAPI.LookalikeSeedBase, MatchAPI.CreatorReferenceByID {}
147
-
148
- export interface LookalikeSeedByHandle
149
- extends LookalikeAPI.LookalikeSeedBase,
150
- ProfilesAPI.CreatorReferenceByHandle {}
151
-
152
- export interface Filters {
153
- audience_size?: Filters.AudienceSize;
154
-
155
- engagement_rate?: Filters.EngagementRate;
156
-
157
- /**
158
- * Filter by platforms
159
- */
160
- platform?: Array<string>;
161
-
162
- verified?: boolean;
163
- }
164
-
165
- export namespace Filters {
166
- export interface AudienceSize {
167
- max?: number;
168
-
169
- min?: number;
170
- }
171
-
172
- export interface EngagementRate {
173
- max?: number;
174
-
175
- min?: number;
176
- }
177
- }
178
- }
179
-
180
- export declare namespace Lookalike {
181
- export {
182
- type LookalikeSeedBase as LookalikeSeedBase,
183
- type LookalikeFindSimilarCreatorsResponse as LookalikeFindSimilarCreatorsResponse,
184
- type LookalikeFindSimilarCreatorsParams as LookalikeFindSimilarCreatorsParams,
185
- };
186
- }
@@ -1,115 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../core/resource';
4
- import * as ProfilesAPI from './profiles';
5
- import { APIPromise } from '../core/api-promise';
6
- import { RequestOptions } from '../internal/request-options';
7
-
8
- export class Match extends APIResource {
9
- /**
10
- * Evaluate how well creators align with campaign requirements using AI-powered
11
- * analysis.
12
- *
13
- * Provide creator references and campaign description to receive match scores
14
- * (0-100), AI decisions (good/neutral/avoid), explanations, and supporting
15
- * evidence.
16
- *
17
- * **Pricing**: 0.1 credits per creator analyzed
18
- */
19
- analyze(body: MatchAnalyzeParams, options?: RequestOptions): APIPromise<MatchAnalyzeResponse> {
20
- return this._client.post('/v1/match', { body, ...options });
21
- }
22
- }
23
-
24
- export interface CreatorReferenceByID {
25
- /**
26
- * Unique creator identifier
27
- */
28
- id: string;
29
-
30
- /**
31
- * Platform name (optional when using the ID)
32
- */
33
- platform?: 'instagram';
34
- }
35
-
36
- export interface MatchResult {
37
- creator?: MatchResult.Creator;
38
-
39
- /**
40
- * AI recommendation decision:
41
- *
42
- * - `good`: Strong fit for the campaign, recommended
43
- * - `neutral`: Acceptable fit, evaluate based on other factors
44
- * - `avoid`: Not recommended for this campaign
45
- */
46
- decision?: 'good' | 'neutral' | 'avoid';
47
-
48
- /**
49
- * Array of specific evidence supporting the match decision. Includes relevant
50
- * content examples and audience insights.
51
- */
52
- evidence?: Array<string>;
53
-
54
- /**
55
- * Human-readable explanation of the match assessment. Summarizes why this creator
56
- * fits or doesn't fit the campaign.
57
- */
58
- explanation?: string;
59
-
60
- /**
61
- * Match score from 0 to 100 indicating campaign fit.
62
- *
63
- * - 80-100: Excellent match
64
- * - 60-79: Good match
65
- * - 40-59: Moderate match
66
- * - 0-39: Poor match
67
- */
68
- match_score?: number;
69
- }
70
-
71
- export namespace MatchResult {
72
- export interface Creator {
73
- id?: string;
74
-
75
- platform?: 'instagram';
76
-
77
- username?: string;
78
- }
79
- }
80
-
81
- export interface MatchAnalyzeResponse {
82
- items?: Array<MatchResult>;
83
- }
84
-
85
- export interface MatchAnalyzeParams {
86
- /**
87
- * Creators to match against campaign. Max 100 creators per request.
88
- */
89
- creators: Array<CreatorReferenceByID | ProfilesAPI.CreatorReferenceByHandle>;
90
-
91
- search_intent: MatchAnalyzeParams.SearchIntent;
92
- }
93
-
94
- export namespace MatchAnalyzeParams {
95
- export interface SearchIntent {
96
- /**
97
- * Campaign search intent
98
- */
99
- query: string;
100
-
101
- /**
102
- * Additional context for matching
103
- */
104
- context?: string;
105
- }
106
- }
107
-
108
- export declare namespace Match {
109
- export {
110
- type CreatorReferenceByID as CreatorReferenceByID,
111
- type MatchResult as MatchResult,
112
- type MatchAnalyzeResponse as MatchAnalyzeResponse,
113
- type MatchAnalyzeParams as MatchAnalyzeParams,
114
- };
115
- }