influship 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/LICENSE +201 -0
- package/README.md +372 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +198 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +198 -0
- package/client.d.ts.map +1 -0
- package/client.js +469 -0
- package/client.js.map +1 -0
- package/client.mjs +465 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +86 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +80 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +138 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/brand-safety.d.mts +234 -0
- package/resources/brand-safety.d.mts.map +1 -0
- package/resources/brand-safety.d.ts +234 -0
- package/resources/brand-safety.d.ts.map +1 -0
- package/resources/brand-safety.js +75 -0
- package/resources/brand-safety.js.map +1 -0
- package/resources/brand-safety.mjs +71 -0
- package/resources/brand-safety.mjs.map +1 -0
- package/resources/creators.d.mts +364 -0
- package/resources/creators.d.mts.map +1 -0
- package/resources/creators.d.ts +364 -0
- package/resources/creators.d.ts.map +1 -0
- package/resources/creators.js +119 -0
- package/resources/creators.js.map +1 -0
- package/resources/creators.mjs +115 -0
- package/resources/creators.mjs.map +1 -0
- package/resources/health.d.mts +17 -0
- package/resources/health.d.mts.map +1 -0
- package/resources/health.d.ts +17 -0
- package/resources/health.d.ts.map +1 -0
- package/resources/health.js +15 -0
- package/resources/health.js.map +1 -0
- package/resources/health.mjs +11 -0
- package/resources/health.mjs.map +1 -0
- package/resources/index.d.mts +9 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +9 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +21 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +10 -0
- package/resources/index.mjs.map +1 -0
- package/resources/lookalike.d.mts +142 -0
- package/resources/lookalike.d.mts.map +1 -0
- package/resources/lookalike.d.ts +142 -0
- package/resources/lookalike.d.ts.map +1 -0
- package/resources/lookalike.js +28 -0
- package/resources/lookalike.js.map +1 -0
- package/resources/lookalike.mjs +24 -0
- package/resources/lookalike.mjs.map +1 -0
- package/resources/match.d.mts +90 -0
- package/resources/match.d.mts.map +1 -0
- package/resources/match.d.ts +90 -0
- package/resources/match.d.ts.map +1 -0
- package/resources/match.js +22 -0
- package/resources/match.js.map +1 -0
- package/resources/match.mjs +18 -0
- package/resources/match.mjs.map +1 -0
- package/resources/posts.d.mts +284 -0
- package/resources/posts.d.mts.map +1 -0
- package/resources/posts.d.ts +284 -0
- package/resources/posts.d.ts.map +1 -0
- package/resources/posts.js +55 -0
- package/resources/posts.js.map +1 -0
- package/resources/posts.mjs +51 -0
- package/resources/posts.mjs.map +1 -0
- package/resources/profiles.d.mts +99 -0
- package/resources/profiles.d.mts.map +1 -0
- package/resources/profiles.d.ts +99 -0
- package/resources/profiles.d.ts.map +1 -0
- package/resources/profiles.js +69 -0
- package/resources/profiles.js.map +1 -0
- package/resources/profiles.mjs +65 -0
- package/resources/profiles.mjs.map +1 -0
- package/resources/search.d.mts +189 -0
- package/resources/search.d.mts.map +1 -0
- package/resources/search.d.ts +189 -0
- package/resources/search.d.ts.map +1 -0
- package/resources/search.js +33 -0
- package/resources/search.js.map +1 -0
- package/resources/search.mjs +29 -0
- package/resources/search.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +845 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +127 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/brand-safety.ts +304 -0
- package/src/resources/creators.ts +450 -0
- package/src/resources/health.ts +24 -0
- package/src/resources/index.ts +62 -0
- package/src/resources/lookalike.ts +186 -0
- package/src/resources/match.ts +115 -0
- package/src/resources/posts.ts +347 -0
- package/src/resources/profiles.ts +114 -0
- package/src/resources/search.ts +234 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as BrandSafetyAPI from './brand-safety';
|
|
5
|
+
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Posts extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Analyze a social media post for engagement metrics, content insights, and brand
|
|
11
|
+
* safety.
|
|
12
|
+
*
|
|
13
|
+
* Provide post via URL or post_id+platform. Optionally include AI analysis and/or
|
|
14
|
+
* brand safety features.
|
|
15
|
+
*
|
|
16
|
+
* **Pricing**:
|
|
17
|
+
*
|
|
18
|
+
* - Base: 1.0 credit per post
|
|
19
|
+
* - AI Analysis feature: +0.5 credits (includes summary and transcript)
|
|
20
|
+
* - Brand Safety feature: +0.5 credits (includes rating and risk flags)
|
|
21
|
+
* - **Example**: 1 post with both features = 1.0 + 0.5 + 0.5 = 2.0 credits
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const postAnalysis = await client.posts.analyze({
|
|
26
|
+
* url: 'https://example.com',
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
analyze(body: PostAnalyzeParams, options?: RequestOptions): APIPromise<PostAnalysis> {
|
|
31
|
+
return this._client.post('/v1/posts/analyze', { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Retrieve posts for a specific creator using cursor-based pagination.
|
|
36
|
+
*
|
|
37
|
+
* This endpoint allows you to fetch posts from a creator's social media accounts
|
|
38
|
+
* with optional analysis features and date filtering.
|
|
39
|
+
*
|
|
40
|
+
* **Pricing**:
|
|
41
|
+
*
|
|
42
|
+
* - Base: 0.01 credits per post returned
|
|
43
|
+
* - The more posts you request, the more you pay
|
|
44
|
+
* - Use the `limit` parameter to control costs
|
|
45
|
+
* - **Example**: 25 posts = 0.25 credits
|
|
46
|
+
* - **Example**: 100 posts = 1.0 credit
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const response = await client.posts.listByCreator();
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
listByCreator(
|
|
54
|
+
query: PostListByCreatorParams | null | undefined = {},
|
|
55
|
+
options?: RequestOptions,
|
|
56
|
+
): APIPromise<PostListByCreatorResponse> {
|
|
57
|
+
return this._client.get('/v1/posts/by-creator', { query, ...options });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* AI-powered content analysis. Only present when `ai_analysis` feature is
|
|
63
|
+
* requested.
|
|
64
|
+
*/
|
|
65
|
+
export interface AIAnalysis {
|
|
66
|
+
/**
|
|
67
|
+
* AI-generated summary describing key themes, topics, and messaging.
|
|
68
|
+
*/
|
|
69
|
+
summary: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Transcription of spoken words in video. null for photo posts or videos without
|
|
73
|
+
* speech.
|
|
74
|
+
*/
|
|
75
|
+
transcript?: string | null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Cursor-based pagination metadata. Use this to navigate through paginated results
|
|
80
|
+
* efficiently.
|
|
81
|
+
*/
|
|
82
|
+
export interface CursorPagination {
|
|
83
|
+
/**
|
|
84
|
+
* Indicates whether more results are available.
|
|
85
|
+
*
|
|
86
|
+
* - `true`: Additional pages exist, use the `cursor` to fetch them
|
|
87
|
+
* - `false`: This is the last page of results
|
|
88
|
+
*/
|
|
89
|
+
has_more: boolean;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Opaque base64-encoded cursor string for fetching the next page. Pass this value
|
|
93
|
+
* as the `cursor` query parameter in your next request. null when `has_more` is
|
|
94
|
+
* false (no more pages available). Do not attempt to decode or construct cursor
|
|
95
|
+
* values manually.
|
|
96
|
+
*/
|
|
97
|
+
cursor?: string | null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Analysis result for a single social media post
|
|
102
|
+
*/
|
|
103
|
+
export interface PostAnalysis {
|
|
104
|
+
/**
|
|
105
|
+
* Internal post ID
|
|
106
|
+
*/
|
|
107
|
+
id: string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Creator information for a post
|
|
111
|
+
*/
|
|
112
|
+
creator: PostAnalysis.Creator;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Whether this post contains video content. true for video posts and reels, false
|
|
116
|
+
* for photo posts.
|
|
117
|
+
*/
|
|
118
|
+
is_video: boolean;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* URL of the primary media file (image or video). For carousel posts, this is the
|
|
122
|
+
* first item.
|
|
123
|
+
*/
|
|
124
|
+
media_url: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Social media platform
|
|
128
|
+
*/
|
|
129
|
+
platform: 'instagram' | 'tiktok';
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Platform-specific unique identifier for this post. Format varies by platform
|
|
133
|
+
* (Instagram: numeric ID, TikTok: alphanumeric).
|
|
134
|
+
*/
|
|
135
|
+
platform_post_id: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* ISO 8601 timestamp when the post was originally published.
|
|
139
|
+
*/
|
|
140
|
+
posted_at: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Alt text or accessibility caption describing the media. Useful for understanding
|
|
144
|
+
* image content. null if unavailable.
|
|
145
|
+
*/
|
|
146
|
+
accessibility_caption?: string | null;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* AI-powered content analysis. Only present when `ai_analysis` feature is
|
|
150
|
+
* requested.
|
|
151
|
+
*/
|
|
152
|
+
ai_analysis?: AIAnalysis;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Brand safety analysis results
|
|
156
|
+
*/
|
|
157
|
+
brand_safety?: BrandSafetyAPI.BrandSafetyAnalysis;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Post caption text written by the creator. null if no caption was provided.
|
|
161
|
+
*/
|
|
162
|
+
caption?: string | null;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Total comments on post. null if unavailable.
|
|
166
|
+
*/
|
|
167
|
+
comments_count?: number | null;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Total likes on post. null if platform hides like counts or data unavailable.
|
|
171
|
+
*/
|
|
172
|
+
likes_count?: number | null;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Array of all media URLs in this post. Contains multiple items for carousel
|
|
176
|
+
* posts, single item for regular posts.
|
|
177
|
+
*/
|
|
178
|
+
media_urls?: Array<string>;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* ISO 8601 timestamp when we last scraped/updated this post's data. Metrics are
|
|
182
|
+
* accurate as of this time.
|
|
183
|
+
*/
|
|
184
|
+
scraped_at?: string;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Instagram shortcode used in post URLs (instagram.com/p/{shortcode}). Only
|
|
188
|
+
* present for Instagram posts, null for other platforms.
|
|
189
|
+
*/
|
|
190
|
+
shortcode?: string | null;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Thumbnail image URL for video posts. Only present when is_video is true, null
|
|
194
|
+
* for photo posts.
|
|
195
|
+
*/
|
|
196
|
+
thumbnail_url?: string | null;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Video length in seconds. null for photo posts.
|
|
200
|
+
*/
|
|
201
|
+
video_duration_seconds?: number | null;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Video view count. null for photo posts or if unavailable.
|
|
205
|
+
*/
|
|
206
|
+
video_view_count?: number | null;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export namespace PostAnalysis {
|
|
210
|
+
/**
|
|
211
|
+
* Creator information for a post
|
|
212
|
+
*/
|
|
213
|
+
export interface Creator {
|
|
214
|
+
/**
|
|
215
|
+
* Creator UUID
|
|
216
|
+
*/
|
|
217
|
+
id: string;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Social media platform
|
|
221
|
+
*/
|
|
222
|
+
platform: 'instagram' | 'tiktok';
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Social media username
|
|
226
|
+
*/
|
|
227
|
+
username: string;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Response for getting posts by creator
|
|
233
|
+
*/
|
|
234
|
+
export interface PostListByCreatorResponse {
|
|
235
|
+
/**
|
|
236
|
+
* Cursor-based pagination metadata. Use this to navigate through paginated results
|
|
237
|
+
* efficiently.
|
|
238
|
+
*/
|
|
239
|
+
pagination: CursorPagination;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Array of posts
|
|
243
|
+
*/
|
|
244
|
+
posts: Array<PostAnalysis>;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export type PostAnalyzeParams = PostAnalyzeParams.Variant0 | PostAnalyzeParams.Variant1;
|
|
248
|
+
|
|
249
|
+
export declare namespace PostAnalyzeParams {
|
|
250
|
+
export interface Variant0 {
|
|
251
|
+
/**
|
|
252
|
+
* Public URL of the post to analyze
|
|
253
|
+
*/
|
|
254
|
+
url: string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Analysis features to include
|
|
258
|
+
*/
|
|
259
|
+
features?: Array<'ai_analysis' | 'brand_safety'>;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Social media platform (required when using post_id)
|
|
263
|
+
*/
|
|
264
|
+
platform?: 'instagram' | 'tiktok';
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Platform-specific post ID
|
|
268
|
+
*/
|
|
269
|
+
post_id?: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface Variant1 {
|
|
273
|
+
/**
|
|
274
|
+
* Social media platform
|
|
275
|
+
*/
|
|
276
|
+
platform: 'instagram' | 'tiktok';
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Platform-specific post ID
|
|
280
|
+
*/
|
|
281
|
+
post_id: string;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Analysis features to include
|
|
285
|
+
*/
|
|
286
|
+
features?: Array<'ai_analysis' | 'brand_safety'>;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Public URL of the post to analyze
|
|
290
|
+
*/
|
|
291
|
+
url?: string;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface PostListByCreatorParams {
|
|
296
|
+
/**
|
|
297
|
+
* Creator UUID
|
|
298
|
+
*/
|
|
299
|
+
creator_id?: string;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Opaque pagination cursor from previous response. Do not construct manually.
|
|
303
|
+
*/
|
|
304
|
+
cursor?: string;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Start date for filtering posts (ISO 8601)
|
|
308
|
+
*/
|
|
309
|
+
date_from?: string;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* End date for filtering posts (ISO 8601)
|
|
313
|
+
*/
|
|
314
|
+
date_to?: string;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Optional analysis features. `ai_analysis` adds summary/transcript.
|
|
318
|
+
* `brand_safety` adds rating/flags. Each feature has additional cost.
|
|
319
|
+
*/
|
|
320
|
+
features?: Array<'ai_analysis' | 'brand_safety'>;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Number of posts per page. Min 1, max 100, default 25.
|
|
324
|
+
*/
|
|
325
|
+
limit?: number;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Social media platform
|
|
329
|
+
*/
|
|
330
|
+
platform?: 'instagram' | 'tiktok';
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Social media username
|
|
334
|
+
*/
|
|
335
|
+
username?: string;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export declare namespace Posts {
|
|
339
|
+
export {
|
|
340
|
+
type AIAnalysis as AIAnalysis,
|
|
341
|
+
type CursorPagination as CursorPagination,
|
|
342
|
+
type PostAnalysis as PostAnalysis,
|
|
343
|
+
type PostListByCreatorResponse as PostListByCreatorResponse,
|
|
344
|
+
type PostAnalyzeParams as PostAnalyzeParams,
|
|
345
|
+
type PostListByCreatorParams as PostListByCreatorParams,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as CreatorsAPI from './creators';
|
|
5
|
+
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Profiles extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* **DISCOVERY ENDPOINT**: Look up social account data when you know a username and
|
|
11
|
+
* platform.
|
|
12
|
+
*
|
|
13
|
+
* **🎯 When to use this endpoint:**
|
|
14
|
+
*
|
|
15
|
+
* - ✅ You have a username and platform (e.g., @fitness_guru on Instagram)
|
|
16
|
+
* - ✅ You want to discover who a social account belongs to
|
|
17
|
+
* - ✅ You need to look up specific social accounts by username
|
|
18
|
+
* - ✅ You want to get social account metrics for known usernames
|
|
19
|
+
*
|
|
20
|
+
* **❌ When NOT to use this endpoint:**
|
|
21
|
+
*
|
|
22
|
+
* - ❌ You already have a creator UUID (use `/v1/creators/{id}/profiles` instead)
|
|
23
|
+
* - ❌ You want to get all accounts for a creator (use
|
|
24
|
+
* `/v1/creators/{id}/profiles` instead)
|
|
25
|
+
*
|
|
26
|
+
* **📊 Response Format:** Returns `SocialAccountLite` or `SocialAccountDetailed`
|
|
27
|
+
* objects with identical structure to `/v1/creators/{id}/profiles`. Both endpoints
|
|
28
|
+
* return the same data structure for consistency.
|
|
29
|
+
*
|
|
30
|
+
* **🔗 Data Relationships:**
|
|
31
|
+
*
|
|
32
|
+
* - Use the `creator_profile_id` field to fetch creator-level data via
|
|
33
|
+
* `/v1/creators`
|
|
34
|
+
* - Use the `creator_profile_id` to get all social accounts via
|
|
35
|
+
* `/v1/creators/{id}/profiles`
|
|
36
|
+
* - Creator-level data includes: name, bio, avatar, ai_one_line_bio
|
|
37
|
+
* - Social account data includes: follower_count, engagement_rate, verified,
|
|
38
|
+
* platform-specific metrics
|
|
39
|
+
*
|
|
40
|
+
* **🔄 Typical Workflow:**
|
|
41
|
+
*
|
|
42
|
+
* 1. **Discovery**: Call `/v1/profiles` with username+platform → get social
|
|
43
|
+
* account data + creator_profile_id
|
|
44
|
+
* 2. **Creator Data**: Call `/v1/creators` with creator_profile_id → get
|
|
45
|
+
* creator-level data
|
|
46
|
+
* 3. **All Accounts**: Call `/v1/creators/{id}/profiles` with creator_profile_id →
|
|
47
|
+
* get all social accounts for that creator
|
|
48
|
+
*
|
|
49
|
+
* **⚙️ Parameters:**
|
|
50
|
+
*
|
|
51
|
+
* - `mode`: `lite` (default) or `detailed` - controls response detail level
|
|
52
|
+
* - `platforms`: Array of platform names to filter results (e.g.,
|
|
53
|
+
* `["instagram", "tiktok"]`) **Pricing**: 0.01-0.05 credits per profile
|
|
54
|
+
* (lite/detailed mode)
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const response = await client.profiles.lookup({
|
|
59
|
+
* profiles: [
|
|
60
|
+
* { platform: 'instagram', username: 'fitness_guru' },
|
|
61
|
+
* { platform: 'tiktok', username: 'fitness_guru' },
|
|
62
|
+
* ],
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
lookup(body: ProfileLookupParams, options?: RequestOptions): APIPromise<ProfileLookupResponse> {
|
|
67
|
+
return this._client.post('/v1/profiles', { body, ...options });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface CreatorReferenceByHandle {
|
|
72
|
+
/**
|
|
73
|
+
* Social platform where the creator exists
|
|
74
|
+
*/
|
|
75
|
+
platform: 'instagram' | 'tiktok';
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Username on the platform
|
|
79
|
+
*/
|
|
80
|
+
username: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface ProfileLookupResponse {
|
|
84
|
+
/**
|
|
85
|
+
* Array of social account objects. The structure depends on the `mode` parameter:
|
|
86
|
+
*
|
|
87
|
+
* - If `mode: "lite"`: Returns SocialAccountLite objects
|
|
88
|
+
* - If `mode: "detailed"`: Returns SocialAccountDetailed objects with additional
|
|
89
|
+
* fields
|
|
90
|
+
*/
|
|
91
|
+
profiles?: Array<CreatorsAPI.SocialAccountLite | CreatorsAPI.SocialAccountDetailed>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface ProfileLookupParams {
|
|
95
|
+
profiles: Array<CreatorReferenceByHandle>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Response detail level - lite for basic fields, detailed for additional metrics
|
|
99
|
+
*/
|
|
100
|
+
mode?: 'lite' | 'detailed';
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Filter results to only include these platforms
|
|
104
|
+
*/
|
|
105
|
+
platforms?: Array<'instagram' | 'tiktok'>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export declare namespace Profiles {
|
|
109
|
+
export {
|
|
110
|
+
type CreatorReferenceByHandle as CreatorReferenceByHandle,
|
|
111
|
+
type ProfileLookupResponse as ProfileLookupResponse,
|
|
112
|
+
type ProfileLookupParams as ProfileLookupParams,
|
|
113
|
+
};
|
|
114
|
+
}
|