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.
- package/CHANGELOG.md +62 -30
- package/LICENSE +1 -1
- package/README.md +88 -43
- package/client.d.mts +49 -29
- package/client.d.mts.map +1 -1
- package/client.d.ts +49 -29
- package/client.d.ts.map +1 -1
- package/client.js +89 -56
- package/client.js.map +1 -1
- package/client.mjs +89 -56
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +2 -2
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +2 -2
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts +2 -2
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +2 -2
- package/core/error.d.ts.map +1 -1
- package/core/error.js +4 -4
- package/core/error.js.map +1 -1
- package/core/error.mjs +2 -2
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts +75 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +75 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +139 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +132 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +3 -3
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +3 -3
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/index.d.mts +4 -3
- package/index.d.mts.map +1 -1
- package/index.d.ts +4 -3
- package/index.d.ts.map +1 -1
- package/index.js +6 -4
- package/index.js.map +1 -1
- package/index.mjs +4 -3
- package/index.mjs.map +1 -1
- package/internal/parse.d.mts +2 -2
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +2 -2
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/shims.js +1 -1
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/uploads.d.mts +4 -4
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +4 -4
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.js +2 -2
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +3 -3
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts +3 -3
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +3 -3
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.js +1 -1
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +2 -2
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils/values.js +5 -5
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +6 -6
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +24 -3
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/creators.d.mts +326 -247
- package/resources/creators.d.mts.map +1 -1
- package/resources/creators.d.ts +326 -247
- package/resources/creators.d.ts.map +1 -1
- package/resources/creators.js +80 -63
- package/resources/creators.js.map +1 -1
- package/resources/creators.mjs +80 -63
- package/resources/creators.mjs.map +1 -1
- package/resources/health.d.mts +13 -1
- package/resources/health.d.mts.map +1 -1
- package/resources/health.d.ts +13 -1
- package/resources/health.d.ts.map +1 -1
- package/resources/health.js +4 -1
- package/resources/health.js.map +1 -1
- package/resources/health.mjs +4 -1
- package/resources/health.mjs.map +1 -1
- package/resources/index.d.mts +6 -7
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -7
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -7
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -3
- package/resources/index.mjs.map +1 -1
- package/resources/posts.d.mts +82 -202
- package/resources/posts.d.mts.map +1 -1
- package/resources/posts.d.ts +82 -202
- package/resources/posts.d.ts.map +1 -1
- package/resources/posts.js +17 -38
- package/resources/posts.js.map +1 -1
- package/resources/posts.mjs +17 -38
- package/resources/posts.mjs.map +1 -1
- package/resources/profiles.d.mts +208 -58
- package/resources/profiles.d.mts.map +1 -1
- package/resources/profiles.d.ts +208 -58
- package/resources/profiles.d.ts.map +1 -1
- package/resources/profiles.js +37 -41
- package/resources/profiles.js.map +1 -1
- package/resources/profiles.mjs +37 -41
- package/resources/profiles.mjs.map +1 -1
- package/resources/raw/index.d.mts +4 -0
- package/resources/raw/index.d.mts.map +1 -0
- package/resources/raw/index.d.ts +4 -0
- package/resources/raw/index.d.ts.map +1 -0
- package/resources/raw/index.js +11 -0
- package/resources/raw/index.js.map +1 -0
- package/resources/raw/index.mjs +5 -0
- package/resources/raw/index.mjs.map +1 -0
- package/resources/raw/instagram.d.mts +215 -0
- package/resources/raw/instagram.d.mts.map +1 -0
- package/resources/raw/instagram.d.ts +215 -0
- package/resources/raw/instagram.d.ts.map +1 -0
- package/resources/raw/instagram.js +31 -0
- package/resources/raw/instagram.js.map +1 -0
- package/resources/raw/instagram.mjs +27 -0
- package/resources/raw/instagram.mjs.map +1 -0
- package/resources/raw/raw.d.mts +14 -0
- package/resources/raw/raw.d.mts.map +1 -0
- package/resources/raw/raw.d.ts +14 -0
- package/resources/raw/raw.d.ts.map +1 -0
- package/resources/raw/raw.js +21 -0
- package/resources/raw/raw.js.map +1 -0
- package/resources/raw/raw.mjs +16 -0
- package/resources/raw/raw.mjs.map +1 -0
- package/resources/raw/youtube.d.mts +455 -0
- package/resources/raw/youtube.d.mts.map +1 -0
- package/resources/raw/youtube.d.ts +455 -0
- package/resources/raw/youtube.d.ts.map +1 -0
- package/resources/raw/youtube.js +61 -0
- package/resources/raw/youtube.js.map +1 -0
- package/resources/raw/youtube.mjs +57 -0
- package/resources/raw/youtube.mjs.map +1 -0
- package/resources/raw.d.mts +2 -0
- package/resources/raw.d.mts.map +1 -0
- package/resources/raw.d.ts +2 -0
- package/resources/raw.d.ts.map +1 -0
- package/resources/raw.js +6 -0
- package/resources/raw.js.map +1 -0
- package/resources/raw.mjs +3 -0
- package/resources/raw.mjs.map +1 -0
- package/resources/search.d.mts +126 -117
- package/resources/search.d.mts.map +1 -1
- package/resources/search.d.ts +126 -117
- package/resources/search.d.ts.map +1 -1
- package/resources/search.js +46 -13
- package/resources/search.js.map +1 -1
- package/resources/search.mjs +46 -13
- package/resources/search.mjs.map +1 -1
- package/resources/shared.d.mts +55 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +55 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/src/client.ts +153 -127
- package/src/core/api-promise.ts +4 -4
- package/src/core/error.ts +2 -2
- package/src/core/pagination.ts +232 -0
- package/src/core/resource.ts +3 -3
- package/src/index.ts +4 -3
- package/src/internal/parse.ts +8 -2
- package/src/internal/shims.ts +1 -1
- package/src/internal/uploads.ts +5 -5
- package/src/internal/utils/base64.ts +3 -3
- package/src/internal/utils/log.ts +3 -3
- package/src/internal/utils/path.ts +2 -2
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils/values.ts +6 -6
- package/src/internal/utils.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/creators.ts +369 -271
- package/src/resources/health.ts +13 -1
- package/src/resources/index.ts +22 -41
- package/src/resources/posts.ts +89 -232
- package/src/resources/profiles.ts +252 -59
- package/src/resources/raw/index.ts +16 -0
- package/src/resources/raw/instagram.ts +271 -0
- package/src/resources/raw/raw.ts +47 -0
- package/src/resources/raw/youtube.ts +585 -0
- package/src/resources/raw.ts +3 -0
- package/src/resources/search.ts +145 -131
- package/src/resources/shared.ts +66 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/brand-safety.d.mts +0 -234
- package/resources/brand-safety.d.mts.map +0 -1
- package/resources/brand-safety.d.ts +0 -234
- package/resources/brand-safety.d.ts.map +0 -1
- package/resources/brand-safety.js +0 -75
- package/resources/brand-safety.js.map +0 -1
- package/resources/brand-safety.mjs +0 -71
- package/resources/brand-safety.mjs.map +0 -1
- package/resources/lookalike.d.mts +0 -142
- package/resources/lookalike.d.mts.map +0 -1
- package/resources/lookalike.d.ts +0 -142
- package/resources/lookalike.d.ts.map +0 -1
- package/resources/lookalike.js +0 -28
- package/resources/lookalike.js.map +0 -1
- package/resources/lookalike.mjs +0 -24
- package/resources/lookalike.mjs.map +0 -1
- package/resources/match.d.mts +0 -90
- package/resources/match.d.mts.map +0 -1
- package/resources/match.d.ts +0 -90
- package/resources/match.d.ts.map +0 -1
- package/resources/match.js +0 -22
- package/resources/match.js.map +0 -1
- package/resources/match.mjs +0 -18
- package/resources/match.mjs.map +0 -1
- package/src/resources/brand-safety.ts +0 -304
- package/src/resources/lookalike.ts +0 -186
- package/src/resources/match.ts +0 -115
package/resources/search.d.mts
CHANGED
|
@@ -1,189 +1,198 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as SearchAPI from "./search.mjs";
|
|
3
|
+
import * as Shared from "./shared.mjs";
|
|
3
4
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
5
|
+
import { PagePromise, QueryCursor, type QueryCursorParams } from "../core/pagination.mjs";
|
|
4
6
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* AI-powered semantic search to find creators using natural language queries. Understands intent and context to match creators based on content themes, audience, and style.
|
|
9
|
+
*/
|
|
5
10
|
export declare class Search extends APIResource {
|
|
6
11
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
12
|
+
* Search for creators using natural language queries. The AI understands intent
|
|
13
|
+
* and context to match creators based on content themes, audience demographics,
|
|
14
|
+
* and style.
|
|
15
|
+
*
|
|
16
|
+
* The response includes a `search_id` that can be used with `GET /v1/search/{id}`
|
|
17
|
+
* to paginate through results for free.
|
|
18
|
+
*
|
|
19
|
+
* **Use cases:**
|
|
9
20
|
*
|
|
10
|
-
*
|
|
21
|
+
* - Find creators in a specific niche ("vegan food bloggers in LA")
|
|
22
|
+
* - Discover creators with specific audience characteristics ("fitness influencers
|
|
23
|
+
* with millennial audience")
|
|
24
|
+
* - Search by content style ("creators who post cinematic travel videos")
|
|
11
25
|
*
|
|
12
|
-
*
|
|
13
|
-
* - Detailed mode: Additional 0.05 credits per social account profile
|
|
14
|
-
* - **Example**: 10 creators in lite mode = 20 credits
|
|
15
|
-
* - **Example**: 10 creators with avg 2 profiles each in detailed mode = 20 + (10
|
|
16
|
-
* × 2 × 0.05) = 21 credits
|
|
26
|
+
* **Pricing**: 25 credits base + 2 credits per creator returned
|
|
17
27
|
*
|
|
18
28
|
* @example
|
|
19
29
|
* ```ts
|
|
20
|
-
* const
|
|
30
|
+
* const search = await client.search.create({
|
|
21
31
|
* query:
|
|
22
|
-
* 'fitness influencers with 100k+ followers who post workout
|
|
32
|
+
* 'fitness influencers with 100k+ followers who post workout videos',
|
|
23
33
|
* });
|
|
24
34
|
* ```
|
|
25
35
|
*/
|
|
26
|
-
|
|
36
|
+
create(body: SearchCreateParams, options?: RequestOptions): APIPromise<SearchCreateResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Paginate through results from a previous search. Use the `search_id` returned by
|
|
39
|
+
* `POST /v1/search` to fetch additional pages.
|
|
40
|
+
*
|
|
41
|
+
* Search sessions expire after 1 hour. After expiry, a new search must be run.
|
|
42
|
+
*
|
|
43
|
+
* **Pricing**: 0 credits (included with initial search)
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* // Automatically fetches more pages as needed.
|
|
48
|
+
* for await (const searchRetrieveResponse of client.search.retrieve(
|
|
49
|
+
* '123e4567-e89b-12d3-a456-426614174000',
|
|
50
|
+
* )) {
|
|
51
|
+
* // ...
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
retrieve(id: string, query?: SearchRetrieveParams | null | undefined, options?: RequestOptions): PagePromise<SearchRetrieveResponsesQueryCursor, SearchRetrieveResponse>;
|
|
27
56
|
}
|
|
57
|
+
export type SearchRetrieveResponsesQueryCursor = QueryCursor<SearchRetrieveResponse>;
|
|
28
58
|
/**
|
|
29
|
-
* Search
|
|
59
|
+
* Search match information
|
|
30
60
|
*/
|
|
31
|
-
export interface
|
|
61
|
+
export interface MatchInfo {
|
|
32
62
|
/**
|
|
33
|
-
*
|
|
63
|
+
* Human-readable match reasons
|
|
34
64
|
*/
|
|
35
|
-
|
|
65
|
+
reasons: Array<string>;
|
|
36
66
|
/**
|
|
37
|
-
*
|
|
38
|
-
* query
|
|
67
|
+
* Match relevance score (0-1)
|
|
39
68
|
*/
|
|
40
|
-
|
|
69
|
+
score: number;
|
|
70
|
+
}
|
|
71
|
+
export interface SearchCreateResponse {
|
|
72
|
+
data: Array<SearchCreateResponse.Data>;
|
|
41
73
|
/**
|
|
42
|
-
*
|
|
74
|
+
* Whether more results are available
|
|
43
75
|
*/
|
|
44
|
-
|
|
76
|
+
has_more: boolean;
|
|
45
77
|
/**
|
|
46
|
-
*
|
|
78
|
+
* Cursor for the next page
|
|
47
79
|
*/
|
|
48
|
-
|
|
80
|
+
next_cursor: string | null;
|
|
49
81
|
/**
|
|
50
|
-
*
|
|
51
|
-
* for 24 hours.
|
|
82
|
+
* Search ID. Use with GET /v1/search/{id} for free pagination.
|
|
52
83
|
*/
|
|
53
|
-
|
|
84
|
+
search_id: string;
|
|
54
85
|
/**
|
|
55
|
-
*
|
|
56
|
-
* platforms. null if unavailable.
|
|
86
|
+
* Total number of results across all pages
|
|
57
87
|
*/
|
|
58
|
-
|
|
88
|
+
total: number;
|
|
59
89
|
}
|
|
60
|
-
export declare namespace
|
|
61
|
-
|
|
62
|
-
* AI-powered recommendation analysis explaining why this creator matches your
|
|
63
|
-
* query
|
|
64
|
-
*/
|
|
65
|
-
interface AIRecommendation {
|
|
90
|
+
export declare namespace SearchCreateResponse {
|
|
91
|
+
interface Data {
|
|
66
92
|
/**
|
|
67
|
-
*
|
|
68
|
-
* matching factors from the query.
|
|
93
|
+
* Basic creator information
|
|
69
94
|
*/
|
|
70
|
-
|
|
95
|
+
creator: Shared.CreatorBasic;
|
|
71
96
|
/**
|
|
72
|
-
*
|
|
73
|
-
* indicate strong relevance.
|
|
97
|
+
* Search match information
|
|
74
98
|
*/
|
|
75
|
-
|
|
99
|
+
match: SearchAPI.MatchInfo;
|
|
76
100
|
/**
|
|
77
|
-
*
|
|
78
|
-
* fact represents specific, verifiable information about the creator.
|
|
101
|
+
* Abbreviated profile information
|
|
79
102
|
*/
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
namespace AIRecommendation {
|
|
103
|
+
primary_profile: Shared.ProfileSummary | null;
|
|
83
104
|
/**
|
|
84
|
-
*
|
|
85
|
-
* Facts are specific, verifiable pieces of information extracted from creator
|
|
86
|
-
* data.
|
|
105
|
+
* Abbreviated profile information
|
|
87
106
|
*/
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* The actual fact text describing specific information about the creator
|
|
91
|
-
*/
|
|
92
|
-
fact: string;
|
|
93
|
-
/**
|
|
94
|
-
* Unique identifier for this fact
|
|
95
|
-
*/
|
|
96
|
-
factId: string;
|
|
97
|
-
/**
|
|
98
|
-
* Combined relevance score (similarity × confidence × temporal decay). Higher
|
|
99
|
-
* scores indicate stronger evidence for the match.
|
|
100
|
-
*/
|
|
101
|
-
score: number;
|
|
102
|
-
/**
|
|
103
|
-
* When this fact was created or observed (ISO 8601 format)
|
|
104
|
-
*/
|
|
105
|
-
created_at?: string;
|
|
106
|
-
/**
|
|
107
|
-
* Array of source post IDs where this fact originated. A single fact may come from
|
|
108
|
-
* multiple posts.
|
|
109
|
-
*/
|
|
110
|
-
source_post_id?: Array<string>;
|
|
111
|
-
}
|
|
107
|
+
relevant_profile: Shared.ProfileSummary | null;
|
|
112
108
|
}
|
|
113
109
|
}
|
|
114
|
-
export interface
|
|
110
|
+
export interface SearchRetrieveResponse {
|
|
111
|
+
/**
|
|
112
|
+
* Basic creator information
|
|
113
|
+
*/
|
|
114
|
+
creator: Shared.CreatorBasic;
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
117
|
-
* with `has_more` to display "Showing 25 of 1,247 results" in your UI.
|
|
116
|
+
* Search match information
|
|
118
117
|
*/
|
|
119
|
-
|
|
118
|
+
match: MatchInfo;
|
|
120
119
|
/**
|
|
121
|
-
*
|
|
122
|
-
* `next_cursor` value in your next request.
|
|
120
|
+
* Abbreviated profile information
|
|
123
121
|
*/
|
|
124
|
-
|
|
125
|
-
items?: Array<SearchItem>;
|
|
122
|
+
primary_profile: Shared.ProfileSummary | null;
|
|
126
123
|
/**
|
|
127
|
-
*
|
|
128
|
-
* `cursor` query parameter. Only present when `has_more` is true.
|
|
124
|
+
* Abbreviated profile information
|
|
129
125
|
*/
|
|
130
|
-
|
|
126
|
+
relevant_profile: Shared.ProfileSummary | null;
|
|
131
127
|
}
|
|
132
|
-
export interface
|
|
128
|
+
export interface SearchCreateParams {
|
|
133
129
|
/**
|
|
134
|
-
*
|
|
130
|
+
* Natural language search query
|
|
135
131
|
*/
|
|
136
132
|
query: string;
|
|
137
133
|
/**
|
|
138
|
-
*
|
|
139
|
-
* not construct manually.
|
|
134
|
+
* Additional filters
|
|
140
135
|
*/
|
|
141
|
-
|
|
136
|
+
filters?: SearchCreateParams.Filters;
|
|
142
137
|
/**
|
|
143
|
-
*
|
|
138
|
+
* Maximum results to return
|
|
144
139
|
*/
|
|
145
140
|
limit?: number;
|
|
146
141
|
/**
|
|
147
|
-
*
|
|
148
|
-
*/
|
|
149
|
-
filters?: SearchFindCreatorsParams.Filters;
|
|
150
|
-
/**
|
|
151
|
-
* Body param: Filter social accounts to only these platforms. Reduces payload
|
|
152
|
-
* size. Does not affect search results or costs.
|
|
142
|
+
* Filter results to specific platforms
|
|
153
143
|
*/
|
|
154
|
-
|
|
144
|
+
platforms?: Array<'instagram'>;
|
|
145
|
+
}
|
|
146
|
+
export declare namespace SearchCreateParams {
|
|
155
147
|
/**
|
|
156
|
-
*
|
|
157
|
-
* follower_count, engagement_rate). `detailed` adds avg_comments_recent,
|
|
158
|
-
* avg_video_views_recent, follower_change_rate, etc. Detailed mode costs 5x more
|
|
159
|
-
* (0.05 vs 0.01 credits per profile).
|
|
148
|
+
* Additional filters
|
|
160
149
|
*/
|
|
161
|
-
mode?: 'lite' | 'detailed';
|
|
162
|
-
}
|
|
163
|
-
export declare namespace SearchFindCreatorsParams {
|
|
164
150
|
interface Filters {
|
|
165
151
|
/**
|
|
166
|
-
*
|
|
152
|
+
* Filter by engagement rate
|
|
153
|
+
*/
|
|
154
|
+
engagement_rate?: Filters.EngagementRate;
|
|
155
|
+
/**
|
|
156
|
+
* Filter by follower count
|
|
167
157
|
*/
|
|
168
|
-
|
|
158
|
+
followers?: Filters.Followers;
|
|
169
159
|
/**
|
|
170
|
-
*
|
|
171
|
-
* `AND` = creator must match ALL platform filters. Default: OR.
|
|
160
|
+
* Filter by verified status
|
|
172
161
|
*/
|
|
173
|
-
|
|
162
|
+
verified?: boolean;
|
|
174
163
|
}
|
|
175
164
|
namespace Filters {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Filter by engagement rate
|
|
167
|
+
*/
|
|
168
|
+
interface EngagementRate {
|
|
169
|
+
/**
|
|
170
|
+
* Maximum engagement rate (%)
|
|
171
|
+
*/
|
|
172
|
+
max?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Minimum engagement rate (%)
|
|
175
|
+
*/
|
|
176
|
+
min?: number;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Filter by follower count
|
|
180
|
+
*/
|
|
181
|
+
interface Followers {
|
|
182
|
+
/**
|
|
183
|
+
* Maximum follower count
|
|
184
|
+
*/
|
|
185
|
+
max?: number;
|
|
186
|
+
/**
|
|
187
|
+
* Minimum follower count
|
|
188
|
+
*/
|
|
189
|
+
min?: number;
|
|
183
190
|
}
|
|
184
191
|
}
|
|
185
192
|
}
|
|
193
|
+
export interface SearchRetrieveParams extends QueryCursorParams {
|
|
194
|
+
}
|
|
186
195
|
export declare namespace Search {
|
|
187
|
-
export { type
|
|
196
|
+
export { type MatchInfo as MatchInfo, type SearchCreateResponse as SearchCreateResponse, type SearchRetrieveResponse as SearchRetrieveResponse, type SearchRetrieveResponsesQueryCursor as SearchRetrieveResponsesQueryCursor, type SearchCreateParams as SearchCreateParams, type SearchRetrieveParams as SearchRetrieveParams, };
|
|
188
197
|
}
|
|
189
198
|
//# sourceMappingURL=search.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.mts","sourceRoot":"","sources":["../src/resources/search.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OAC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;KACF;CACF;AAED,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;CAAG;AAElE,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
package/resources/search.d.ts
CHANGED
|
@@ -1,189 +1,198 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as SearchAPI from "./search.js";
|
|
3
|
+
import * as Shared from "./shared.js";
|
|
3
4
|
import { APIPromise } from "../core/api-promise.js";
|
|
5
|
+
import { PagePromise, QueryCursor, type QueryCursorParams } from "../core/pagination.js";
|
|
4
6
|
import { RequestOptions } from "../internal/request-options.js";
|
|
7
|
+
/**
|
|
8
|
+
* AI-powered semantic search to find creators using natural language queries. Understands intent and context to match creators based on content themes, audience, and style.
|
|
9
|
+
*/
|
|
5
10
|
export declare class Search extends APIResource {
|
|
6
11
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
12
|
+
* Search for creators using natural language queries. The AI understands intent
|
|
13
|
+
* and context to match creators based on content themes, audience demographics,
|
|
14
|
+
* and style.
|
|
15
|
+
*
|
|
16
|
+
* The response includes a `search_id` that can be used with `GET /v1/search/{id}`
|
|
17
|
+
* to paginate through results for free.
|
|
18
|
+
*
|
|
19
|
+
* **Use cases:**
|
|
9
20
|
*
|
|
10
|
-
*
|
|
21
|
+
* - Find creators in a specific niche ("vegan food bloggers in LA")
|
|
22
|
+
* - Discover creators with specific audience characteristics ("fitness influencers
|
|
23
|
+
* with millennial audience")
|
|
24
|
+
* - Search by content style ("creators who post cinematic travel videos")
|
|
11
25
|
*
|
|
12
|
-
*
|
|
13
|
-
* - Detailed mode: Additional 0.05 credits per social account profile
|
|
14
|
-
* - **Example**: 10 creators in lite mode = 20 credits
|
|
15
|
-
* - **Example**: 10 creators with avg 2 profiles each in detailed mode = 20 + (10
|
|
16
|
-
* × 2 × 0.05) = 21 credits
|
|
26
|
+
* **Pricing**: 25 credits base + 2 credits per creator returned
|
|
17
27
|
*
|
|
18
28
|
* @example
|
|
19
29
|
* ```ts
|
|
20
|
-
* const
|
|
30
|
+
* const search = await client.search.create({
|
|
21
31
|
* query:
|
|
22
|
-
* 'fitness influencers with 100k+ followers who post workout
|
|
32
|
+
* 'fitness influencers with 100k+ followers who post workout videos',
|
|
23
33
|
* });
|
|
24
34
|
* ```
|
|
25
35
|
*/
|
|
26
|
-
|
|
36
|
+
create(body: SearchCreateParams, options?: RequestOptions): APIPromise<SearchCreateResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Paginate through results from a previous search. Use the `search_id` returned by
|
|
39
|
+
* `POST /v1/search` to fetch additional pages.
|
|
40
|
+
*
|
|
41
|
+
* Search sessions expire after 1 hour. After expiry, a new search must be run.
|
|
42
|
+
*
|
|
43
|
+
* **Pricing**: 0 credits (included with initial search)
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* // Automatically fetches more pages as needed.
|
|
48
|
+
* for await (const searchRetrieveResponse of client.search.retrieve(
|
|
49
|
+
* '123e4567-e89b-12d3-a456-426614174000',
|
|
50
|
+
* )) {
|
|
51
|
+
* // ...
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
retrieve(id: string, query?: SearchRetrieveParams | null | undefined, options?: RequestOptions): PagePromise<SearchRetrieveResponsesQueryCursor, SearchRetrieveResponse>;
|
|
27
56
|
}
|
|
57
|
+
export type SearchRetrieveResponsesQueryCursor = QueryCursor<SearchRetrieveResponse>;
|
|
28
58
|
/**
|
|
29
|
-
* Search
|
|
59
|
+
* Search match information
|
|
30
60
|
*/
|
|
31
|
-
export interface
|
|
61
|
+
export interface MatchInfo {
|
|
32
62
|
/**
|
|
33
|
-
*
|
|
63
|
+
* Human-readable match reasons
|
|
34
64
|
*/
|
|
35
|
-
|
|
65
|
+
reasons: Array<string>;
|
|
36
66
|
/**
|
|
37
|
-
*
|
|
38
|
-
* query
|
|
67
|
+
* Match relevance score (0-1)
|
|
39
68
|
*/
|
|
40
|
-
|
|
69
|
+
score: number;
|
|
70
|
+
}
|
|
71
|
+
export interface SearchCreateResponse {
|
|
72
|
+
data: Array<SearchCreateResponse.Data>;
|
|
41
73
|
/**
|
|
42
|
-
*
|
|
74
|
+
* Whether more results are available
|
|
43
75
|
*/
|
|
44
|
-
|
|
76
|
+
has_more: boolean;
|
|
45
77
|
/**
|
|
46
|
-
*
|
|
78
|
+
* Cursor for the next page
|
|
47
79
|
*/
|
|
48
|
-
|
|
80
|
+
next_cursor: string | null;
|
|
49
81
|
/**
|
|
50
|
-
*
|
|
51
|
-
* for 24 hours.
|
|
82
|
+
* Search ID. Use with GET /v1/search/{id} for free pagination.
|
|
52
83
|
*/
|
|
53
|
-
|
|
84
|
+
search_id: string;
|
|
54
85
|
/**
|
|
55
|
-
*
|
|
56
|
-
* platforms. null if unavailable.
|
|
86
|
+
* Total number of results across all pages
|
|
57
87
|
*/
|
|
58
|
-
|
|
88
|
+
total: number;
|
|
59
89
|
}
|
|
60
|
-
export declare namespace
|
|
61
|
-
|
|
62
|
-
* AI-powered recommendation analysis explaining why this creator matches your
|
|
63
|
-
* query
|
|
64
|
-
*/
|
|
65
|
-
interface AIRecommendation {
|
|
90
|
+
export declare namespace SearchCreateResponse {
|
|
91
|
+
interface Data {
|
|
66
92
|
/**
|
|
67
|
-
*
|
|
68
|
-
* matching factors from the query.
|
|
93
|
+
* Basic creator information
|
|
69
94
|
*/
|
|
70
|
-
|
|
95
|
+
creator: Shared.CreatorBasic;
|
|
71
96
|
/**
|
|
72
|
-
*
|
|
73
|
-
* indicate strong relevance.
|
|
97
|
+
* Search match information
|
|
74
98
|
*/
|
|
75
|
-
|
|
99
|
+
match: SearchAPI.MatchInfo;
|
|
76
100
|
/**
|
|
77
|
-
*
|
|
78
|
-
* fact represents specific, verifiable information about the creator.
|
|
101
|
+
* Abbreviated profile information
|
|
79
102
|
*/
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
namespace AIRecommendation {
|
|
103
|
+
primary_profile: Shared.ProfileSummary | null;
|
|
83
104
|
/**
|
|
84
|
-
*
|
|
85
|
-
* Facts are specific, verifiable pieces of information extracted from creator
|
|
86
|
-
* data.
|
|
105
|
+
* Abbreviated profile information
|
|
87
106
|
*/
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* The actual fact text describing specific information about the creator
|
|
91
|
-
*/
|
|
92
|
-
fact: string;
|
|
93
|
-
/**
|
|
94
|
-
* Unique identifier for this fact
|
|
95
|
-
*/
|
|
96
|
-
factId: string;
|
|
97
|
-
/**
|
|
98
|
-
* Combined relevance score (similarity × confidence × temporal decay). Higher
|
|
99
|
-
* scores indicate stronger evidence for the match.
|
|
100
|
-
*/
|
|
101
|
-
score: number;
|
|
102
|
-
/**
|
|
103
|
-
* When this fact was created or observed (ISO 8601 format)
|
|
104
|
-
*/
|
|
105
|
-
created_at?: string;
|
|
106
|
-
/**
|
|
107
|
-
* Array of source post IDs where this fact originated. A single fact may come from
|
|
108
|
-
* multiple posts.
|
|
109
|
-
*/
|
|
110
|
-
source_post_id?: Array<string>;
|
|
111
|
-
}
|
|
107
|
+
relevant_profile: Shared.ProfileSummary | null;
|
|
112
108
|
}
|
|
113
109
|
}
|
|
114
|
-
export interface
|
|
110
|
+
export interface SearchRetrieveResponse {
|
|
111
|
+
/**
|
|
112
|
+
* Basic creator information
|
|
113
|
+
*/
|
|
114
|
+
creator: Shared.CreatorBasic;
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
117
|
-
* with `has_more` to display "Showing 25 of 1,247 results" in your UI.
|
|
116
|
+
* Search match information
|
|
118
117
|
*/
|
|
119
|
-
|
|
118
|
+
match: MatchInfo;
|
|
120
119
|
/**
|
|
121
|
-
*
|
|
122
|
-
* `next_cursor` value in your next request.
|
|
120
|
+
* Abbreviated profile information
|
|
123
121
|
*/
|
|
124
|
-
|
|
125
|
-
items?: Array<SearchItem>;
|
|
122
|
+
primary_profile: Shared.ProfileSummary | null;
|
|
126
123
|
/**
|
|
127
|
-
*
|
|
128
|
-
* `cursor` query parameter. Only present when `has_more` is true.
|
|
124
|
+
* Abbreviated profile information
|
|
129
125
|
*/
|
|
130
|
-
|
|
126
|
+
relevant_profile: Shared.ProfileSummary | null;
|
|
131
127
|
}
|
|
132
|
-
export interface
|
|
128
|
+
export interface SearchCreateParams {
|
|
133
129
|
/**
|
|
134
|
-
*
|
|
130
|
+
* Natural language search query
|
|
135
131
|
*/
|
|
136
132
|
query: string;
|
|
137
133
|
/**
|
|
138
|
-
*
|
|
139
|
-
* not construct manually.
|
|
134
|
+
* Additional filters
|
|
140
135
|
*/
|
|
141
|
-
|
|
136
|
+
filters?: SearchCreateParams.Filters;
|
|
142
137
|
/**
|
|
143
|
-
*
|
|
138
|
+
* Maximum results to return
|
|
144
139
|
*/
|
|
145
140
|
limit?: number;
|
|
146
141
|
/**
|
|
147
|
-
*
|
|
148
|
-
*/
|
|
149
|
-
filters?: SearchFindCreatorsParams.Filters;
|
|
150
|
-
/**
|
|
151
|
-
* Body param: Filter social accounts to only these platforms. Reduces payload
|
|
152
|
-
* size. Does not affect search results or costs.
|
|
142
|
+
* Filter results to specific platforms
|
|
153
143
|
*/
|
|
154
|
-
|
|
144
|
+
platforms?: Array<'instagram'>;
|
|
145
|
+
}
|
|
146
|
+
export declare namespace SearchCreateParams {
|
|
155
147
|
/**
|
|
156
|
-
*
|
|
157
|
-
* follower_count, engagement_rate). `detailed` adds avg_comments_recent,
|
|
158
|
-
* avg_video_views_recent, follower_change_rate, etc. Detailed mode costs 5x more
|
|
159
|
-
* (0.05 vs 0.01 credits per profile).
|
|
148
|
+
* Additional filters
|
|
160
149
|
*/
|
|
161
|
-
mode?: 'lite' | 'detailed';
|
|
162
|
-
}
|
|
163
|
-
export declare namespace SearchFindCreatorsParams {
|
|
164
150
|
interface Filters {
|
|
165
151
|
/**
|
|
166
|
-
*
|
|
152
|
+
* Filter by engagement rate
|
|
153
|
+
*/
|
|
154
|
+
engagement_rate?: Filters.EngagementRate;
|
|
155
|
+
/**
|
|
156
|
+
* Filter by follower count
|
|
167
157
|
*/
|
|
168
|
-
|
|
158
|
+
followers?: Filters.Followers;
|
|
169
159
|
/**
|
|
170
|
-
*
|
|
171
|
-
* `AND` = creator must match ALL platform filters. Default: OR.
|
|
160
|
+
* Filter by verified status
|
|
172
161
|
*/
|
|
173
|
-
|
|
162
|
+
verified?: boolean;
|
|
174
163
|
}
|
|
175
164
|
namespace Filters {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Filter by engagement rate
|
|
167
|
+
*/
|
|
168
|
+
interface EngagementRate {
|
|
169
|
+
/**
|
|
170
|
+
* Maximum engagement rate (%)
|
|
171
|
+
*/
|
|
172
|
+
max?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Minimum engagement rate (%)
|
|
175
|
+
*/
|
|
176
|
+
min?: number;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Filter by follower count
|
|
180
|
+
*/
|
|
181
|
+
interface Followers {
|
|
182
|
+
/**
|
|
183
|
+
* Maximum follower count
|
|
184
|
+
*/
|
|
185
|
+
max?: number;
|
|
186
|
+
/**
|
|
187
|
+
* Minimum follower count
|
|
188
|
+
*/
|
|
189
|
+
min?: number;
|
|
183
190
|
}
|
|
184
191
|
}
|
|
185
192
|
}
|
|
193
|
+
export interface SearchRetrieveParams extends QueryCursorParams {
|
|
194
|
+
}
|
|
186
195
|
export declare namespace Search {
|
|
187
|
-
export { type
|
|
196
|
+
export { type MatchInfo as MatchInfo, type SearchCreateResponse as SearchCreateResponse, type SearchRetrieveResponse as SearchRetrieveResponse, type SearchRetrieveResponsesQueryCursor as SearchRetrieveResponsesQueryCursor, type SearchCreateParams as SearchCreateParams, type SearchRetrieveParams as SearchRetrieveParams, };
|
|
188
197
|
}
|
|
189
198
|
//# sourceMappingURL=search.d.ts.map
|