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
|
@@ -1,114 +1,307 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
-
import * as CreatorsAPI from './creators';
|
|
5
4
|
import { APIPromise } from '../core/api-promise';
|
|
6
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Access individual social media profiles with detailed metrics, growth data, and activity information. Profiles are platform-specific accounts linked to creators.
|
|
10
|
+
*/
|
|
8
11
|
export class Profiles extends APIResource {
|
|
9
12
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
13
|
+
* Retrieve detailed profile data including metrics, growth statistics, and
|
|
14
|
+
* activity information from our database.
|
|
12
15
|
*
|
|
13
|
-
*
|
|
16
|
+
* **Response includes:**
|
|
14
17
|
*
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
18
|
+
* - Basic info (bio, avatar, verification status)
|
|
19
|
+
* - Performance metrics (followers, engagement rate, avg likes/comments)
|
|
20
|
+
* - Growth data (30-day follower growth, monthly rate)
|
|
21
|
+
* - Activity data (last post date, posting frequency)
|
|
19
22
|
*
|
|
20
|
-
*
|
|
23
|
+
* **Pricing**: 0.1 credits per request ($0.001)
|
|
21
24
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* platform-specific metrics
|
|
39
|
-
*
|
|
40
|
-
* **🔄 Typical Workflow:**
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const profile = await client.profiles.get(
|
|
28
|
+
* 'fitness_coach_jane',
|
|
29
|
+
* { platform: 'instagram' },
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
get(username: string, params: ProfileGetParams, options?: RequestOptions): APIPromise<ProfileGetResponse> {
|
|
34
|
+
const { platform } = params;
|
|
35
|
+
return this._client.get(path`/v1/profiles/${platform}/${username}`, options);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Look up multiple profiles in a single request. Efficiently retrieve data for up
|
|
40
|
+
* to 100 profiles at once.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
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
|
|
42
|
+
* **Response includes:**
|
|
48
43
|
*
|
|
49
|
-
*
|
|
44
|
+
* - `found`: Array of profiles that exist in our database
|
|
45
|
+
* - `not_found`: Array of profiles that weren't found (consider live scraping
|
|
46
|
+
* these)
|
|
50
47
|
*
|
|
51
|
-
*
|
|
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)
|
|
48
|
+
* **Pricing**: 0.1 credits per profile ($0.001)
|
|
55
49
|
*
|
|
56
50
|
* @example
|
|
57
51
|
* ```ts
|
|
58
52
|
* const response = await client.profiles.lookup({
|
|
59
53
|
* profiles: [
|
|
60
|
-
* {
|
|
61
|
-
*
|
|
54
|
+
* {
|
|
55
|
+
* platform: 'instagram',
|
|
56
|
+
* username: 'fitness_coach_jane',
|
|
57
|
+
* },
|
|
62
58
|
* ],
|
|
63
59
|
* });
|
|
64
60
|
* ```
|
|
65
61
|
*/
|
|
66
62
|
lookup(body: ProfileLookupParams, options?: RequestOptions): APIPromise<ProfileLookupResponse> {
|
|
67
|
-
return this._client.post('/v1/profiles', { body, ...options });
|
|
63
|
+
return this._client.post('/v1/profiles/lookup', { body, ...options });
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
66
|
|
|
71
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Profile activity information
|
|
69
|
+
*/
|
|
70
|
+
export interface ProfileActivity {
|
|
71
|
+
/**
|
|
72
|
+
* Timestamp of last post
|
|
73
|
+
*/
|
|
74
|
+
last_post_at: string | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Profile growth statistics
|
|
79
|
+
*/
|
|
80
|
+
export interface ProfileGrowth {
|
|
81
|
+
/**
|
|
82
|
+
* Follower growth percentage over 30 days (e.g. 2.5 means +2.5%)
|
|
83
|
+
*/
|
|
84
|
+
followers_30d_pct: number;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Profile performance metrics
|
|
89
|
+
*/
|
|
90
|
+
export interface ProfileMetrics {
|
|
91
|
+
/**
|
|
92
|
+
* Average comments on recent posts
|
|
93
|
+
*/
|
|
94
|
+
avg_comments_recent: number;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Average likes on recent posts
|
|
98
|
+
*/
|
|
99
|
+
avg_likes_recent: number;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Average views on recent posts (for video content)
|
|
103
|
+
*/
|
|
104
|
+
avg_views_recent: number | null;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Engagement rate as a percentage (e.g. 3.5 means 3.5%)
|
|
108
|
+
*/
|
|
109
|
+
engagement_rate: number;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Follower count
|
|
113
|
+
*/
|
|
114
|
+
followers: number;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Following count
|
|
118
|
+
*/
|
|
119
|
+
following: number;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Total post count
|
|
123
|
+
*/
|
|
124
|
+
posts: number;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Posts in the last 30 days
|
|
128
|
+
*/
|
|
129
|
+
posts_last_30d: number;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Average posts per week
|
|
133
|
+
*/
|
|
134
|
+
posts_per_week: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Full profile details
|
|
139
|
+
*/
|
|
140
|
+
export interface ProfileResponseData {
|
|
141
|
+
/**
|
|
142
|
+
* Profile unique identifier
|
|
143
|
+
*/
|
|
144
|
+
id: string;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Profile activity information
|
|
148
|
+
*/
|
|
149
|
+
activity: ProfileActivity;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Avatar URL
|
|
153
|
+
*/
|
|
154
|
+
avatar_url: string | null;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Profile bio
|
|
158
|
+
*/
|
|
159
|
+
bio: string | null;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Account category
|
|
163
|
+
*/
|
|
164
|
+
category: string | null;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Creator unique identifier
|
|
168
|
+
*/
|
|
169
|
+
creator_id: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Last data refresh timestamp
|
|
173
|
+
*/
|
|
174
|
+
data_updated_at: string | null;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Display name
|
|
178
|
+
*/
|
|
179
|
+
display_name: string | null;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* External website URL from bio
|
|
183
|
+
*/
|
|
184
|
+
external_url: string | null;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Profile growth statistics
|
|
188
|
+
*/
|
|
189
|
+
growth: ProfileGrowth;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Whether this is a business account
|
|
193
|
+
*/
|
|
194
|
+
is_business: boolean;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Whether the account is private
|
|
198
|
+
*/
|
|
199
|
+
is_private: boolean;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Whether the account is verified
|
|
203
|
+
*/
|
|
204
|
+
is_verified: boolean;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Profile performance metrics
|
|
208
|
+
*/
|
|
209
|
+
metrics: ProfileMetrics;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Social media platform
|
|
213
|
+
*/
|
|
214
|
+
platform: 'instagram';
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Listed pronouns
|
|
218
|
+
*/
|
|
219
|
+
pronouns: Array<string> | null;
|
|
220
|
+
|
|
72
221
|
/**
|
|
73
|
-
*
|
|
222
|
+
* Profile URL
|
|
74
223
|
*/
|
|
75
|
-
|
|
224
|
+
url: string;
|
|
76
225
|
|
|
77
226
|
/**
|
|
78
|
-
*
|
|
227
|
+
* Profile username
|
|
79
228
|
*/
|
|
80
229
|
username: string;
|
|
81
230
|
}
|
|
82
231
|
|
|
232
|
+
export interface ProfileGetResponse {
|
|
233
|
+
/**
|
|
234
|
+
* Full profile details
|
|
235
|
+
*/
|
|
236
|
+
data: ProfileResponseData;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Present when partial results were returned because profile metrics/data were
|
|
240
|
+
* skipped due to integrity issues.
|
|
241
|
+
*/
|
|
242
|
+
warning?: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
83
245
|
export interface ProfileLookupResponse {
|
|
84
246
|
/**
|
|
85
|
-
*
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
247
|
+
* Profiles that were found
|
|
248
|
+
*/
|
|
249
|
+
data: Array<ProfileResponseData>;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Profiles that were not found
|
|
90
253
|
*/
|
|
91
|
-
|
|
254
|
+
not_found: Array<ProfileLookupResponse.NotFound>;
|
|
92
255
|
}
|
|
93
256
|
|
|
94
|
-
export
|
|
95
|
-
|
|
257
|
+
export namespace ProfileLookupResponse {
|
|
258
|
+
export interface NotFound {
|
|
259
|
+
/**
|
|
260
|
+
* Social media platform
|
|
261
|
+
*/
|
|
262
|
+
platform: 'instagram';
|
|
263
|
+
|
|
264
|
+
username: string;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
96
267
|
|
|
268
|
+
export interface ProfileGetParams {
|
|
97
269
|
/**
|
|
98
|
-
*
|
|
270
|
+
* Platform name
|
|
99
271
|
*/
|
|
100
|
-
|
|
272
|
+
platform: string;
|
|
273
|
+
}
|
|
101
274
|
|
|
275
|
+
export interface ProfileLookupParams {
|
|
102
276
|
/**
|
|
103
|
-
*
|
|
277
|
+
* Profiles to lookup
|
|
104
278
|
*/
|
|
105
|
-
|
|
279
|
+
profiles: Array<ProfileLookupParams.Profile>;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export namespace ProfileLookupParams {
|
|
283
|
+
export interface Profile {
|
|
284
|
+
/**
|
|
285
|
+
* Social media platform
|
|
286
|
+
*/
|
|
287
|
+
platform: 'instagram';
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Username to lookup
|
|
291
|
+
*/
|
|
292
|
+
username: string;
|
|
293
|
+
}
|
|
106
294
|
}
|
|
107
295
|
|
|
108
296
|
export declare namespace Profiles {
|
|
109
297
|
export {
|
|
110
|
-
type
|
|
298
|
+
type ProfileActivity as ProfileActivity,
|
|
299
|
+
type ProfileGrowth as ProfileGrowth,
|
|
300
|
+
type ProfileMetrics as ProfileMetrics,
|
|
301
|
+
type ProfileResponseData as ProfileResponseData,
|
|
302
|
+
type ProfileGetResponse as ProfileGetResponse,
|
|
111
303
|
type ProfileLookupResponse as ProfileLookupResponse,
|
|
304
|
+
type ProfileGetParams as ProfileGetParams,
|
|
112
305
|
type ProfileLookupParams as ProfileLookupParams,
|
|
113
306
|
};
|
|
114
307
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Instagram, type InstagramGetProfileResponse, type InstagramGetProfileParams } from './instagram';
|
|
4
|
+
export { Raw } from './raw';
|
|
5
|
+
export {
|
|
6
|
+
Youtube,
|
|
7
|
+
type TranscriptSegment,
|
|
8
|
+
type YoutubeGetChannelResponse,
|
|
9
|
+
type YoutubeGetChannelTranscriptsResponse,
|
|
10
|
+
type YoutubeGetTranscriptResponse,
|
|
11
|
+
type YoutubeSearchResponse,
|
|
12
|
+
type YoutubeGetChannelParams,
|
|
13
|
+
type YoutubeGetChannelTranscriptsParams,
|
|
14
|
+
type YoutubeGetTranscriptParams,
|
|
15
|
+
type YoutubeSearchParams,
|
|
16
|
+
} from './youtube';
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Fetch fresh data directly from social platforms in real-time. Use when you need the most current information or data for profiles not yet in our database.
|
|
10
|
+
*/
|
|
11
|
+
export class Instagram extends APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Fetch fresh Instagram profile data directly from Instagram in real-time. Use
|
|
14
|
+
* this when you need the most current follower counts, bio, or recent activity.
|
|
15
|
+
*
|
|
16
|
+
* **When to use live scraping:**
|
|
17
|
+
*
|
|
18
|
+
* - Profile not found in our database
|
|
19
|
+
* - Need real-time follower/engagement data
|
|
20
|
+
* - Verifying current profile status before campaign
|
|
21
|
+
*
|
|
22
|
+
* **Note:** Live scraping is slower than cached data (2-5 seconds) and costs more.
|
|
23
|
+
* Use cached endpoints when freshness isn't critical.
|
|
24
|
+
*
|
|
25
|
+
* **Pricing**: 0.5 credits per profile scraped ($0.005)
|
|
26
|
+
*/
|
|
27
|
+
getProfile(
|
|
28
|
+
username: string,
|
|
29
|
+
query: InstagramGetProfileParams | null | undefined = {},
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): APIPromise<InstagramGetProfileResponse> {
|
|
32
|
+
return this._client.get(path`/v1/raw/instagram/profile/${username}`, { query, ...options });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface InstagramGetProfileResponse {
|
|
37
|
+
/**
|
|
38
|
+
* Live scraped profile data
|
|
39
|
+
*/
|
|
40
|
+
data: InstagramGetProfileResponse.Data;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export namespace InstagramGetProfileResponse {
|
|
44
|
+
/**
|
|
45
|
+
* Live scraped profile data
|
|
46
|
+
*/
|
|
47
|
+
export interface Data {
|
|
48
|
+
/**
|
|
49
|
+
* Profile unique identifier
|
|
50
|
+
*/
|
|
51
|
+
id: string;
|
|
52
|
+
|
|
53
|
+
activity: Data.Activity;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Avatar URL
|
|
57
|
+
*/
|
|
58
|
+
avatar_url: string | null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Profile bio
|
|
62
|
+
*/
|
|
63
|
+
bio: string | null;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Account category
|
|
67
|
+
*/
|
|
68
|
+
category: string | null;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Creator unique identifier
|
|
72
|
+
*/
|
|
73
|
+
creator_id: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Last data refresh timestamp
|
|
77
|
+
*/
|
|
78
|
+
data_updated_at: string | null;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Display name
|
|
82
|
+
*/
|
|
83
|
+
display_name: string | null;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* External website URL
|
|
87
|
+
*/
|
|
88
|
+
external_url: string | null;
|
|
89
|
+
|
|
90
|
+
growth: Data.Growth;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Whether this is a business account
|
|
94
|
+
*/
|
|
95
|
+
is_business: boolean;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Whether the account is private
|
|
99
|
+
*/
|
|
100
|
+
is_private: boolean;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Whether the account is verified
|
|
104
|
+
*/
|
|
105
|
+
is_verified: boolean;
|
|
106
|
+
|
|
107
|
+
metrics: Data.Metrics;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Social media platform
|
|
111
|
+
*/
|
|
112
|
+
platform: 'instagram';
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Listed pronouns
|
|
116
|
+
*/
|
|
117
|
+
pronouns: Array<string> | null;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* When this data was scraped
|
|
121
|
+
*/
|
|
122
|
+
scraped_at: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Profile URL
|
|
126
|
+
*/
|
|
127
|
+
url: string;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Profile username
|
|
131
|
+
*/
|
|
132
|
+
username: string;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Recent posts (only included when include_posts=true)
|
|
136
|
+
*/
|
|
137
|
+
posts?: Array<Data.Post>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export namespace Data {
|
|
141
|
+
export interface Activity {
|
|
142
|
+
/**
|
|
143
|
+
* Timestamp of last post
|
|
144
|
+
*/
|
|
145
|
+
last_post_at: string | null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface Growth {
|
|
149
|
+
/**
|
|
150
|
+
* Follower growth percentage over 30 days (e.g. 2.5 means +2.5%)
|
|
151
|
+
*/
|
|
152
|
+
followers_30d_pct: number;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface Metrics {
|
|
156
|
+
/**
|
|
157
|
+
* Average comments on recent posts
|
|
158
|
+
*/
|
|
159
|
+
avg_comments_recent: number;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Average likes on recent posts
|
|
163
|
+
*/
|
|
164
|
+
avg_likes_recent: number;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Average views on recent posts
|
|
168
|
+
*/
|
|
169
|
+
avg_views_recent: number | null;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Engagement rate as a percentage (e.g. 3.5 means 3.5%)
|
|
173
|
+
*/
|
|
174
|
+
engagement_rate: number;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Follower count
|
|
178
|
+
*/
|
|
179
|
+
followers: number;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Following count
|
|
183
|
+
*/
|
|
184
|
+
following: number;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Total post count
|
|
188
|
+
*/
|
|
189
|
+
posts: number;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Posts in the last 30 days
|
|
193
|
+
*/
|
|
194
|
+
posts_last_30d: number;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Average posts per week
|
|
198
|
+
*/
|
|
199
|
+
posts_per_week: number;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Simplified post from live scrape
|
|
204
|
+
*/
|
|
205
|
+
export interface Post {
|
|
206
|
+
/**
|
|
207
|
+
* Post unique identifier
|
|
208
|
+
*/
|
|
209
|
+
id: string;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Post caption
|
|
213
|
+
*/
|
|
214
|
+
caption: string | null;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Comment count
|
|
218
|
+
*/
|
|
219
|
+
comments_count: number | null;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Like count
|
|
223
|
+
*/
|
|
224
|
+
likes_count: number | null;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Primary media URL
|
|
228
|
+
*/
|
|
229
|
+
media_url: string | null;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Platform-specific post ID
|
|
233
|
+
*/
|
|
234
|
+
platform_id: string;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Post timestamp
|
|
238
|
+
*/
|
|
239
|
+
posted_at: string;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Type of post
|
|
243
|
+
*/
|
|
244
|
+
type: 'image' | 'video' | 'carousel' | 'reel' | 'story';
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Post URL
|
|
248
|
+
*/
|
|
249
|
+
url: string;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface InstagramGetProfileParams {
|
|
255
|
+
/**
|
|
256
|
+
* Include recent posts in response
|
|
257
|
+
*/
|
|
258
|
+
include_posts?: boolean;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Number of posts to include
|
|
262
|
+
*/
|
|
263
|
+
post_limit?: number;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export declare namespace Instagram {
|
|
267
|
+
export {
|
|
268
|
+
type InstagramGetProfileResponse as InstagramGetProfileResponse,
|
|
269
|
+
type InstagramGetProfileParams as InstagramGetProfileParams,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as InstagramAPI from './instagram';
|
|
5
|
+
import { Instagram, InstagramGetProfileParams, InstagramGetProfileResponse } from './instagram';
|
|
6
|
+
import * as YoutubeAPI from './youtube';
|
|
7
|
+
import {
|
|
8
|
+
TranscriptSegment,
|
|
9
|
+
Youtube,
|
|
10
|
+
YoutubeGetChannelParams,
|
|
11
|
+
YoutubeGetChannelResponse,
|
|
12
|
+
YoutubeGetChannelTranscriptsParams,
|
|
13
|
+
YoutubeGetChannelTranscriptsResponse,
|
|
14
|
+
YoutubeGetTranscriptParams,
|
|
15
|
+
YoutubeGetTranscriptResponse,
|
|
16
|
+
YoutubeSearchParams,
|
|
17
|
+
YoutubeSearchResponse,
|
|
18
|
+
} from './youtube';
|
|
19
|
+
|
|
20
|
+
export class Raw extends APIResource {
|
|
21
|
+
instagram: InstagramAPI.Instagram = new InstagramAPI.Instagram(this._client);
|
|
22
|
+
youtube: YoutubeAPI.Youtube = new YoutubeAPI.Youtube(this._client);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
Raw.Instagram = Instagram;
|
|
26
|
+
Raw.Youtube = Youtube;
|
|
27
|
+
|
|
28
|
+
export declare namespace Raw {
|
|
29
|
+
export {
|
|
30
|
+
Instagram as Instagram,
|
|
31
|
+
type InstagramGetProfileResponse as InstagramGetProfileResponse,
|
|
32
|
+
type InstagramGetProfileParams as InstagramGetProfileParams,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
Youtube as Youtube,
|
|
37
|
+
type TranscriptSegment as TranscriptSegment,
|
|
38
|
+
type YoutubeGetChannelResponse as YoutubeGetChannelResponse,
|
|
39
|
+
type YoutubeGetChannelTranscriptsResponse as YoutubeGetChannelTranscriptsResponse,
|
|
40
|
+
type YoutubeGetTranscriptResponse as YoutubeGetTranscriptResponse,
|
|
41
|
+
type YoutubeSearchResponse as YoutubeSearchResponse,
|
|
42
|
+
type YoutubeGetChannelParams as YoutubeGetChannelParams,
|
|
43
|
+
type YoutubeGetChannelTranscriptsParams as YoutubeGetChannelTranscriptsParams,
|
|
44
|
+
type YoutubeGetTranscriptParams as YoutubeGetTranscriptParams,
|
|
45
|
+
type YoutubeSearchParams as YoutubeSearchParams,
|
|
46
|
+
};
|
|
47
|
+
}
|