influship 0.2.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/CHANGELOG.md +62 -30
  2. package/LICENSE +1 -1
  3. package/README.md +88 -43
  4. package/client.d.mts +49 -29
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +49 -29
  7. package/client.d.ts.map +1 -1
  8. package/client.js +89 -56
  9. package/client.js.map +1 -1
  10. package/client.mjs +89 -56
  11. package/client.mjs.map +1 -1
  12. package/core/api-promise.d.mts +2 -2
  13. package/core/api-promise.d.mts.map +1 -1
  14. package/core/api-promise.d.ts +2 -2
  15. package/core/api-promise.d.ts.map +1 -1
  16. package/core/api-promise.js.map +1 -1
  17. package/core/api-promise.mjs.map +1 -1
  18. package/core/error.d.mts +2 -2
  19. package/core/error.d.mts.map +1 -1
  20. package/core/error.d.ts +2 -2
  21. package/core/error.d.ts.map +1 -1
  22. package/core/error.js +4 -4
  23. package/core/error.js.map +1 -1
  24. package/core/error.mjs +2 -2
  25. package/core/error.mjs.map +1 -1
  26. package/core/pagination.d.mts +75 -0
  27. package/core/pagination.d.mts.map +1 -0
  28. package/core/pagination.d.ts +75 -0
  29. package/core/pagination.d.ts.map +1 -0
  30. package/core/pagination.js +139 -0
  31. package/core/pagination.js.map +1 -0
  32. package/core/pagination.mjs +132 -0
  33. package/core/pagination.mjs.map +1 -0
  34. package/core/resource.d.mts +3 -3
  35. package/core/resource.d.mts.map +1 -1
  36. package/core/resource.d.ts +3 -3
  37. package/core/resource.d.ts.map +1 -1
  38. package/core/resource.js.map +1 -1
  39. package/core/resource.mjs.map +1 -1
  40. package/index.d.mts +4 -3
  41. package/index.d.mts.map +1 -1
  42. package/index.d.ts +4 -3
  43. package/index.d.ts.map +1 -1
  44. package/index.js +6 -4
  45. package/index.js.map +1 -1
  46. package/index.mjs +4 -3
  47. package/index.mjs.map +1 -1
  48. package/internal/parse.d.mts +2 -2
  49. package/internal/parse.d.mts.map +1 -1
  50. package/internal/parse.d.ts +2 -2
  51. package/internal/parse.d.ts.map +1 -1
  52. package/internal/parse.js +5 -0
  53. package/internal/parse.js.map +1 -1
  54. package/internal/parse.mjs +5 -0
  55. package/internal/parse.mjs.map +1 -1
  56. package/internal/shims.js +1 -1
  57. package/internal/shims.js.map +1 -1
  58. package/internal/shims.mjs +1 -1
  59. package/internal/shims.mjs.map +1 -1
  60. package/internal/tslib.js +17 -17
  61. package/internal/uploads.d.mts +4 -4
  62. package/internal/uploads.d.mts.map +1 -1
  63. package/internal/uploads.d.ts +4 -4
  64. package/internal/uploads.d.ts.map +1 -1
  65. package/internal/uploads.js.map +1 -1
  66. package/internal/uploads.mjs.map +1 -1
  67. package/internal/utils/base64.js +2 -2
  68. package/internal/utils/base64.js.map +1 -1
  69. package/internal/utils/base64.mjs +3 -3
  70. package/internal/utils/base64.mjs.map +1 -1
  71. package/internal/utils/log.d.mts +3 -3
  72. package/internal/utils/log.d.mts.map +1 -1
  73. package/internal/utils/log.d.ts +3 -3
  74. package/internal/utils/log.d.ts.map +1 -1
  75. package/internal/utils/log.js.map +1 -1
  76. package/internal/utils/log.mjs.map +1 -1
  77. package/internal/utils/path.js +1 -1
  78. package/internal/utils/path.js.map +1 -1
  79. package/internal/utils/path.mjs +2 -2
  80. package/internal/utils/path.mjs.map +1 -1
  81. package/internal/utils/query.d.mts +2 -0
  82. package/internal/utils/query.d.mts.map +1 -0
  83. package/internal/utils/query.d.ts +2 -0
  84. package/internal/utils/query.d.ts.map +1 -0
  85. package/internal/utils/query.js +10 -0
  86. package/internal/utils/query.js.map +1 -0
  87. package/internal/utils/query.mjs +6 -0
  88. package/internal/utils/query.mjs.map +1 -0
  89. package/internal/utils/values.js +5 -5
  90. package/internal/utils/values.js.map +1 -1
  91. package/internal/utils/values.mjs +6 -6
  92. package/internal/utils/values.mjs.map +1 -1
  93. package/internal/utils.d.mts +1 -0
  94. package/internal/utils.d.ts +1 -0
  95. package/internal/utils.js +1 -0
  96. package/internal/utils.js.map +1 -1
  97. package/internal/utils.mjs +1 -0
  98. package/package.json +24 -3
  99. package/pagination.d.mts +2 -0
  100. package/pagination.d.mts.map +1 -0
  101. package/pagination.d.ts +2 -0
  102. package/pagination.d.ts.map +1 -0
  103. package/pagination.js +6 -0
  104. package/pagination.js.map +1 -0
  105. package/pagination.mjs +2 -0
  106. package/pagination.mjs.map +1 -0
  107. package/resources/creators.d.mts +326 -247
  108. package/resources/creators.d.mts.map +1 -1
  109. package/resources/creators.d.ts +326 -247
  110. package/resources/creators.d.ts.map +1 -1
  111. package/resources/creators.js +80 -63
  112. package/resources/creators.js.map +1 -1
  113. package/resources/creators.mjs +80 -63
  114. package/resources/creators.mjs.map +1 -1
  115. package/resources/health.d.mts +13 -1
  116. package/resources/health.d.mts.map +1 -1
  117. package/resources/health.d.ts +13 -1
  118. package/resources/health.d.ts.map +1 -1
  119. package/resources/health.js +4 -1
  120. package/resources/health.js.map +1 -1
  121. package/resources/health.mjs +4 -1
  122. package/resources/health.mjs.map +1 -1
  123. package/resources/index.d.mts +6 -7
  124. package/resources/index.d.mts.map +1 -1
  125. package/resources/index.d.ts +6 -7
  126. package/resources/index.d.ts.map +1 -1
  127. package/resources/index.js +5 -7
  128. package/resources/index.js.map +1 -1
  129. package/resources/index.mjs +2 -3
  130. package/resources/index.mjs.map +1 -1
  131. package/resources/posts.d.mts +82 -202
  132. package/resources/posts.d.mts.map +1 -1
  133. package/resources/posts.d.ts +82 -202
  134. package/resources/posts.d.ts.map +1 -1
  135. package/resources/posts.js +17 -38
  136. package/resources/posts.js.map +1 -1
  137. package/resources/posts.mjs +17 -38
  138. package/resources/posts.mjs.map +1 -1
  139. package/resources/profiles.d.mts +208 -58
  140. package/resources/profiles.d.mts.map +1 -1
  141. package/resources/profiles.d.ts +208 -58
  142. package/resources/profiles.d.ts.map +1 -1
  143. package/resources/profiles.js +37 -41
  144. package/resources/profiles.js.map +1 -1
  145. package/resources/profiles.mjs +37 -41
  146. package/resources/profiles.mjs.map +1 -1
  147. package/resources/raw/index.d.mts +4 -0
  148. package/resources/raw/index.d.mts.map +1 -0
  149. package/resources/raw/index.d.ts +4 -0
  150. package/resources/raw/index.d.ts.map +1 -0
  151. package/resources/raw/index.js +11 -0
  152. package/resources/raw/index.js.map +1 -0
  153. package/resources/raw/index.mjs +5 -0
  154. package/resources/raw/index.mjs.map +1 -0
  155. package/resources/raw/instagram.d.mts +215 -0
  156. package/resources/raw/instagram.d.mts.map +1 -0
  157. package/resources/raw/instagram.d.ts +215 -0
  158. package/resources/raw/instagram.d.ts.map +1 -0
  159. package/resources/raw/instagram.js +31 -0
  160. package/resources/raw/instagram.js.map +1 -0
  161. package/resources/raw/instagram.mjs +27 -0
  162. package/resources/raw/instagram.mjs.map +1 -0
  163. package/resources/raw/raw.d.mts +14 -0
  164. package/resources/raw/raw.d.mts.map +1 -0
  165. package/resources/raw/raw.d.ts +14 -0
  166. package/resources/raw/raw.d.ts.map +1 -0
  167. package/resources/raw/raw.js +21 -0
  168. package/resources/raw/raw.js.map +1 -0
  169. package/resources/raw/raw.mjs +16 -0
  170. package/resources/raw/raw.mjs.map +1 -0
  171. package/resources/raw/youtube.d.mts +455 -0
  172. package/resources/raw/youtube.d.mts.map +1 -0
  173. package/resources/raw/youtube.d.ts +455 -0
  174. package/resources/raw/youtube.d.ts.map +1 -0
  175. package/resources/raw/youtube.js +61 -0
  176. package/resources/raw/youtube.js.map +1 -0
  177. package/resources/raw/youtube.mjs +57 -0
  178. package/resources/raw/youtube.mjs.map +1 -0
  179. package/resources/raw.d.mts +2 -0
  180. package/resources/raw.d.mts.map +1 -0
  181. package/resources/raw.d.ts +2 -0
  182. package/resources/raw.d.ts.map +1 -0
  183. package/resources/raw.js +6 -0
  184. package/resources/raw.js.map +1 -0
  185. package/resources/raw.mjs +3 -0
  186. package/resources/raw.mjs.map +1 -0
  187. package/resources/search.d.mts +126 -117
  188. package/resources/search.d.mts.map +1 -1
  189. package/resources/search.d.ts +126 -117
  190. package/resources/search.d.ts.map +1 -1
  191. package/resources/search.js +46 -13
  192. package/resources/search.js.map +1 -1
  193. package/resources/search.mjs +46 -13
  194. package/resources/search.mjs.map +1 -1
  195. package/resources/shared.d.mts +55 -0
  196. package/resources/shared.d.mts.map +1 -0
  197. package/resources/shared.d.ts +55 -0
  198. package/resources/shared.d.ts.map +1 -0
  199. package/resources/shared.js +4 -0
  200. package/resources/shared.js.map +1 -0
  201. package/resources/shared.mjs +3 -0
  202. package/resources/shared.mjs.map +1 -0
  203. package/src/client.ts +153 -127
  204. package/src/core/api-promise.ts +4 -4
  205. package/src/core/error.ts +2 -2
  206. package/src/core/pagination.ts +232 -0
  207. package/src/core/resource.ts +3 -3
  208. package/src/index.ts +4 -3
  209. package/src/internal/parse.ts +8 -2
  210. package/src/internal/shims.ts +1 -1
  211. package/src/internal/uploads.ts +5 -5
  212. package/src/internal/utils/base64.ts +3 -3
  213. package/src/internal/utils/log.ts +3 -3
  214. package/src/internal/utils/path.ts +2 -2
  215. package/src/internal/utils/query.ts +7 -0
  216. package/src/internal/utils/values.ts +6 -6
  217. package/src/internal/utils.ts +1 -0
  218. package/src/pagination.ts +2 -0
  219. package/src/resources/creators.ts +369 -271
  220. package/src/resources/health.ts +13 -1
  221. package/src/resources/index.ts +22 -41
  222. package/src/resources/posts.ts +89 -232
  223. package/src/resources/profiles.ts +252 -59
  224. package/src/resources/raw/index.ts +16 -0
  225. package/src/resources/raw/instagram.ts +271 -0
  226. package/src/resources/raw/raw.ts +47 -0
  227. package/src/resources/raw/youtube.ts +585 -0
  228. package/src/resources/raw.ts +3 -0
  229. package/src/resources/search.ts +145 -131
  230. package/src/resources/shared.ts +66 -0
  231. package/src/version.ts +1 -1
  232. package/version.d.mts +1 -1
  233. package/version.d.ts +1 -1
  234. package/version.js +1 -1
  235. package/version.mjs +1 -1
  236. package/resources/brand-safety.d.mts +0 -234
  237. package/resources/brand-safety.d.mts.map +0 -1
  238. package/resources/brand-safety.d.ts +0 -234
  239. package/resources/brand-safety.d.ts.map +0 -1
  240. package/resources/brand-safety.js +0 -75
  241. package/resources/brand-safety.js.map +0 -1
  242. package/resources/brand-safety.mjs +0 -71
  243. package/resources/brand-safety.mjs.map +0 -1
  244. package/resources/lookalike.d.mts +0 -142
  245. package/resources/lookalike.d.mts.map +0 -1
  246. package/resources/lookalike.d.ts +0 -142
  247. package/resources/lookalike.d.ts.map +0 -1
  248. package/resources/lookalike.js +0 -28
  249. package/resources/lookalike.js.map +0 -1
  250. package/resources/lookalike.mjs +0 -24
  251. package/resources/lookalike.mjs.map +0 -1
  252. package/resources/match.d.mts +0 -90
  253. package/resources/match.d.mts.map +0 -1
  254. package/resources/match.d.ts +0 -90
  255. package/resources/match.d.ts.map +0 -1
  256. package/resources/match.js +0 -22
  257. package/resources/match.js.map +0 -1
  258. package/resources/match.mjs +0 -18
  259. package/resources/match.mjs.map +0 -1
  260. package/src/resources/brand-safety.ts +0 -304
  261. package/src/resources/lookalike.ts +0 -186
  262. package/src/resources/match.ts +0 -115
@@ -4,18 +4,30 @@ import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
+ /**
8
+ * API health and status endpoints
9
+ */
7
10
  export class Health extends APIResource {
8
11
  /**
9
- * Check the health status of the API
12
+ * Check API health status. No authentication required.
10
13
  */
11
14
  check(options?: RequestOptions): APIPromise<HealthCheckResponse> {
12
15
  return this._client.get('/health', options);
13
16
  }
14
17
  }
15
18
 
19
+ /**
20
+ * Health check response
21
+ */
16
22
  export interface HealthCheckResponse {
23
+ /**
24
+ * Service health status
25
+ */
17
26
  ok: boolean;
18
27
 
28
+ /**
29
+ * Current server timestamp
30
+ */
19
31
  timestamp: string;
20
32
  }
21
33
 
@@ -1,62 +1,43 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export {
4
- BrandSafety,
5
- type BrandSafetyAnalysis,
6
- type BrandSafetyFlag,
7
- type BrandSafetyResult,
8
- type BrandSafetyAnalyzeCreatorsResponse,
9
- type BrandSafetyAnalyzePostsResponse,
10
- type BrandSafetyAnalyzeProfilesResponse,
11
- type BrandSafetyAnalyzeCreatorsParams,
12
- type BrandSafetyAnalyzePostsParams,
13
- type BrandSafetyAnalyzeProfilesParams,
14
- } from './brand-safety';
3
+ export * from './shared';
15
4
  export {
16
5
  Creators,
17
- type Creator,
18
- type CreatorAutocomplete,
19
- type SocialAccountDetailed,
20
- type SocialAccountLite,
21
6
  type CreatorRetrieveResponse,
22
7
  type CreatorAutocompleteResponse,
23
- type CreatorListProfilesResponse,
8
+ type CreatorLookalikeResponse,
9
+ type CreatorMatchResponse,
24
10
  type CreatorRetrieveParams,
25
11
  type CreatorAutocompleteParams,
26
- type CreatorListProfilesParams,
12
+ type CreatorLookalikeParams,
13
+ type CreatorMatchParams,
14
+ type CreatorLookalikeResponsesBodyCursor,
27
15
  } from './creators';
28
16
  export { Health, type HealthCheckResponse } from './health';
29
- export {
30
- Lookalike,
31
- type LookalikeSeedBase,
32
- type LookalikeFindSimilarCreatorsResponse,
33
- type LookalikeFindSimilarCreatorsParams,
34
- } from './lookalike';
35
- export {
36
- Match,
37
- type CreatorReferenceByID,
38
- type MatchResult,
39
- type MatchAnalyzeResponse,
40
- type MatchAnalyzeParams,
41
- } from './match';
42
17
  export {
43
18
  Posts,
44
- type AIAnalysis,
45
- type CursorPagination,
46
- type PostAnalysis,
47
- type PostListByCreatorResponse,
48
- type PostAnalyzeParams,
49
- type PostListByCreatorParams,
19
+ type PostListResponse,
20
+ type PostListParams,
21
+ type PostListResponsesQueryCursor,
50
22
  } from './posts';
51
23
  export {
52
24
  Profiles,
53
- type CreatorReferenceByHandle,
25
+ type ProfileActivity,
26
+ type ProfileGrowth,
27
+ type ProfileMetrics,
28
+ type ProfileResponseData,
29
+ type ProfileGetResponse,
54
30
  type ProfileLookupResponse,
31
+ type ProfileGetParams,
55
32
  type ProfileLookupParams,
56
33
  } from './profiles';
34
+ export { Raw } from './raw/raw';
57
35
  export {
58
36
  Search,
59
- type SearchItem,
60
- type SearchFindCreatorsResponse,
61
- type SearchFindCreatorsParams,
37
+ type MatchInfo,
38
+ type SearchCreateResponse,
39
+ type SearchRetrieveResponse,
40
+ type SearchCreateParams,
41
+ type SearchRetrieveParams,
42
+ type SearchRetrieveResponsesQueryCursor,
62
43
  } from './search';
@@ -1,347 +1,204 @@
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 BrandSafetyAPI from './brand-safety';
5
- import { APIPromise } from '../core/api-promise';
4
+ import { PagePromise, QueryCursor, type QueryCursorParams } from '../core/pagination';
6
5
  import { RequestOptions } from '../internal/request-options';
7
6
 
7
+ /**
8
+ * Retrieve and analyze social media posts with engagement metrics, media content, and performance data.
9
+ */
8
10
  export class Posts extends APIResource {
9
11
  /**
10
- * Analyze a social media post for engagement metrics, content insights, and brand
11
- * safety.
12
+ * Retrieve posts for a creator or profile with engagement metrics and media data.
12
13
  *
13
- * Provide post via URL or post_id+platform. Optionally include AI analysis and/or
14
- * brand safety features.
14
+ * **Query options:**
15
15
  *
16
- * **Pricing**:
16
+ * - By creator: Use `creator_id` to get posts across all their profiles
17
+ * - By profile: Use `platform` + `username` for a specific profile's posts
17
18
  *
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
19
+ * **Sort options:**
22
20
  *
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.
21
+ * - `recent`: Most recent posts first (default)
22
+ * - `top_engagement`: Highest engagement rate first
23
+ * - `most_likes`: Most likes first
24
+ * - `most_views`: Most views first (video content)
25
+ * - `most_comments`: Most comments first
36
26
  *
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
- * ```
27
+ * **Pricing**: 0.05 credits per post returned ($0.0005)
52
28
  */
53
- listByCreator(
54
- query: PostListByCreatorParams | null | undefined = {},
29
+ list(
30
+ query: PostListParams | null | undefined = {},
55
31
  options?: RequestOptions,
56
- ): APIPromise<PostListByCreatorResponse> {
57
- return this._client.get('/v1/posts/by-creator', { query, ...options });
32
+ ): PagePromise<PostListResponsesQueryCursor, PostListResponse> {
33
+ return this._client.getAPIList('/v1/posts', QueryCursor<PostListResponse>, { query, ...options });
58
34
  }
59
35
  }
60
36
 
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
- }
37
+ export type PostListResponsesQueryCursor = QueryCursor<PostListResponse>;
77
38
 
78
39
  /**
79
- * Cursor-based pagination metadata. Use this to navigate through paginated results
80
- * efficiently.
40
+ * Full post details
81
41
  */
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
-
42
+ export interface PostListResponse {
91
43
  /**
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
44
+ * Post unique identifier
106
45
  */
107
46
  id: string;
108
47
 
109
48
  /**
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.
49
+ * Post caption
145
50
  */
146
- accessibility_caption?: string | null;
51
+ caption: string | null;
147
52
 
148
53
  /**
149
- * AI-powered content analysis. Only present when `ai_analysis` feature is
150
- * requested.
54
+ * Hashtags used in the post
151
55
  */
152
- ai_analysis?: AIAnalysis;
56
+ hashtags: Array<string>;
153
57
 
154
58
  /**
155
- * Brand safety analysis results
59
+ * Post location information
156
60
  */
157
- brand_safety?: BrandSafetyAPI.BrandSafetyAnalysis;
61
+ location: PostListResponse.Location | null;
158
62
 
159
63
  /**
160
- * Post caption text written by the creator. null if no caption was provided.
64
+ * Post media information
161
65
  */
162
- caption?: string | null;
66
+ media: PostListResponse.Media;
163
67
 
164
68
  /**
165
- * Total comments on post. null if unavailable.
69
+ * Usernames mentioned in the post
166
70
  */
167
- comments_count?: number | null;
71
+ mentions: Array<string>;
168
72
 
169
73
  /**
170
- * Total likes on post. null if platform hides like counts or data unavailable.
74
+ * Post engagement metrics
171
75
  */
172
- likes_count?: number | null;
76
+ metrics: PostListResponse.Metrics;
173
77
 
174
78
  /**
175
- * Array of all media URLs in this post. Contains multiple items for carousel
176
- * posts, single item for regular posts.
79
+ * Social media platform
177
80
  */
178
- media_urls?: Array<string>;
81
+ platform: 'instagram';
179
82
 
180
83
  /**
181
- * ISO 8601 timestamp when we last scraped/updated this post's data. Metrics are
182
- * accurate as of this time.
84
+ * Platform-specific post ID
183
85
  */
184
- scraped_at?: string;
86
+ platform_id: string;
185
87
 
186
88
  /**
187
- * Instagram shortcode used in post URLs (instagram.com/p/{shortcode}). Only
188
- * present for Instagram posts, null for other platforms.
89
+ * Post timestamp
189
90
  */
190
- shortcode?: string | null;
91
+ posted_at: string;
191
92
 
192
93
  /**
193
- * Thumbnail image URL for video posts. Only present when is_video is true, null
194
- * for photo posts.
94
+ * Profile unique identifier
195
95
  */
196
- thumbnail_url?: string | null;
96
+ profile_id: string;
197
97
 
198
98
  /**
199
- * Video length in seconds. null for photo posts.
99
+ * Type of post
200
100
  */
201
- video_duration_seconds?: number | null;
101
+ type: 'image' | 'video' | 'carousel' | 'reel' | 'story';
202
102
 
203
103
  /**
204
- * Video view count. null for photo posts or if unavailable.
104
+ * Post URL
205
105
  */
206
- video_view_count?: number | null;
106
+ url: string;
207
107
  }
208
108
 
209
- export namespace PostAnalysis {
109
+ export namespace PostListResponse {
210
110
  /**
211
- * Creator information for a post
111
+ * Post location information
212
112
  */
213
- export interface Creator {
214
- /**
215
- * Creator UUID
216
- */
217
- id: string;
218
-
113
+ export interface Location {
219
114
  /**
220
- * Social media platform
115
+ * Location name
221
116
  */
222
- platform: 'instagram' | 'tiktok';
223
-
224
- /**
225
- * Social media username
226
- */
227
- username: string;
117
+ name: string | null;
228
118
  }
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
119
 
241
120
  /**
242
- * Array of posts
121
+ * Post media information
243
122
  */
244
- posts: Array<PostAnalysis>;
245
- }
246
-
247
- export type PostAnalyzeParams = PostAnalyzeParams.Variant0 | PostAnalyzeParams.Variant1;
248
-
249
- export declare namespace PostAnalyzeParams {
250
- export interface Variant0 {
123
+ export interface Media {
251
124
  /**
252
- * Public URL of the post to analyze
125
+ * Video duration in seconds
253
126
  */
254
- url: string;
127
+ duration_seconds: number | null;
255
128
 
256
129
  /**
257
- * Analysis features to include
130
+ * Thumbnail URL
258
131
  */
259
- features?: Array<'ai_analysis' | 'brand_safety'>;
132
+ thumbnail_url: string | null;
260
133
 
261
134
  /**
262
- * Social media platform (required when using post_id)
135
+ * Media URL
263
136
  */
264
- platform?: 'instagram' | 'tiktok';
137
+ url: string | null;
265
138
 
266
139
  /**
267
- * Platform-specific post ID
140
+ * Video URL (for video content)
268
141
  */
269
- post_id?: string;
142
+ video_url: string | null;
270
143
  }
271
144
 
272
- export interface Variant1 {
145
+ /**
146
+ * Post engagement metrics
147
+ */
148
+ export interface Metrics {
149
+ /**
150
+ * Comment count
151
+ */
152
+ comments: number | null;
153
+
273
154
  /**
274
- * Social media platform
155
+ * Engagement rate for this post as a percentage (e.g. 3.8 means 3.8%)
275
156
  */
276
- platform: 'instagram' | 'tiktok';
157
+ engagement_rate: number | null;
277
158
 
278
159
  /**
279
- * Platform-specific post ID
160
+ * Like count
280
161
  */
281
- post_id: string;
162
+ likes: number | null;
282
163
 
283
164
  /**
284
- * Analysis features to include
165
+ * Share count
285
166
  */
286
- features?: Array<'ai_analysis' | 'brand_safety'>;
167
+ shares: number | null;
287
168
 
288
169
  /**
289
- * Public URL of the post to analyze
170
+ * View count (for video content)
290
171
  */
291
- url?: string;
172
+ views: number | null;
292
173
  }
293
174
  }
294
175
 
295
- export interface PostListByCreatorParams {
176
+ export interface PostListParams extends QueryCursorParams {
296
177
  /**
297
- * Creator UUID
178
+ * Creator ID (use this OR platform+username)
298
179
  */
299
180
  creator_id?: string;
300
181
 
301
182
  /**
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)
183
+ * Platform (required with username)
308
184
  */
309
- date_from?: string;
185
+ platform?: 'instagram';
310
186
 
311
187
  /**
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
188
+ * Sort order
329
189
  */
330
- platform?: 'instagram' | 'tiktok';
190
+ sort?: 'recent' | 'top_engagement' | 'most_likes' | 'most_views' | 'most_comments';
331
191
 
332
192
  /**
333
- * Social media username
193
+ * Username (required with platform)
334
194
  */
335
195
  username?: string;
336
196
  }
337
197
 
338
198
  export declare namespace Posts {
339
199
  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,
200
+ type PostListResponse as PostListResponse,
201
+ type PostListResponsesQueryCursor as PostListResponsesQueryCursor,
202
+ type PostListParams as PostListParams,
346
203
  };
347
204
  }