n8n-nodes-tiktok-user-api 0.0.0-stage β†’ 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/LICENSE.md +19 -0
  2. package/README.md +157 -2
  3. package/dist/credentials/ApifyApi.credentials.d.ts +10 -0
  4. package/dist/credentials/ApifyApi.credentials.js +39 -0
  5. package/dist/credentials/ApifyApi.credentials.js.map +1 -0
  6. package/dist/credentials/ApifyOAuth2Api.credentials.d.ts +9 -0
  7. package/dist/credentials/ApifyOAuth2Api.credentials.js +69 -0
  8. package/dist/credentials/ApifyOAuth2Api.credentials.js.map +1 -0
  9. package/dist/icons/apify.svg +5 -0
  10. package/dist/nodes/ApifyTiktokUserApi/ApifyTiktokUserApi.node.d.ts +13 -0
  11. package/dist/nodes/ApifyTiktokUserApi/ApifyTiktokUserApi.node.js +84 -0
  12. package/dist/nodes/ApifyTiktokUserApi/ApifyTiktokUserApi.node.js.map +1 -0
  13. package/dist/nodes/ApifyTiktokUserApi/ApifyTiktokUserApi.node.json +38 -0
  14. package/dist/nodes/ApifyTiktokUserApi/ApifyTiktokUserApi.properties.d.ts +4 -0
  15. package/dist/nodes/ApifyTiktokUserApi/ApifyTiktokUserApi.properties.js +131 -0
  16. package/dist/nodes/ApifyTiktokUserApi/ApifyTiktokUserApi.properties.js.map +1 -0
  17. package/dist/nodes/ApifyTiktokUserApi/helpers/executeActor.d.ts +3 -0
  18. package/dist/nodes/ApifyTiktokUserApi/helpers/executeActor.js +38 -0
  19. package/dist/nodes/ApifyTiktokUserApi/helpers/executeActor.js.map +1 -0
  20. package/dist/nodes/ApifyTiktokUserApi/helpers/genericFunctions.d.ts +10 -0
  21. package/dist/nodes/ApifyTiktokUserApi/helpers/genericFunctions.js +83 -0
  22. package/dist/nodes/ApifyTiktokUserApi/helpers/genericFunctions.js.map +1 -0
  23. package/dist/nodes/ApifyTiktokUserApi/logo.svg +5 -0
  24. package/dist/package.json +67 -0
  25. package/dist/tsconfig.tsbuildinfo +1 -0
  26. package/package.json +66 -5
package/LICENSE.md ADDED
@@ -0,0 +1,19 @@
1
+ Copyright 2022 n8n
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,158 @@
1
- # Temporary Holding Version
1
+ # n8n node: TikTok Profile Videos API
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Scrape TikTok Profile feeds with NO watermarks! Get video URLs, descriptions, music, stats, and more. Extract data by username, URL, or User ID. Control output with a limit. #tiktok #scraper #nowatermark
4
+
5
+ This community node runs the [TikTok Profile Videos API](https://apify.com/novi/tiktok-user-api?fpr=7hce1m) Actor on [Apify](https://apify.com?fpr=7hce1m) and
6
+ returns its results to your workflow, one n8n item per result. It also works as a tool for the n8n
7
+ AI Agent.
8
+
9
+ ## Installation
10
+
11
+ 1. In n8n, go to **Settings > Community Nodes**.
12
+ 2. Select **Install**, enter `n8n-nodes-tiktok-user-api` and confirm.
13
+
14
+ For self-hosted n8n you can also run `npm install n8n-nodes-tiktok-user-api` in your n8n custom nodes folder.
15
+ See the [n8n community nodes docs](https://docs.n8n.io/integrations/community-nodes/installation/).
16
+
17
+ ## Credentials
18
+
19
+ You need an [Apify account](https://console.apify.com/sign-up?fpr=7hce1m). In the node, pick one of:
20
+
21
+ - **API Key**: paste your token from [Apify Console > Settings > API & Integrations](https://console.apify.com/settings/integrations).
22
+ - **OAuth2**: sign in with Apify (n8n cloud).
23
+
24
+ The Actor is billed to your Apify account. See the pricing on the [Actor page](https://apify.com/novi/tiktok-user-api?fpr=7hce1m).
25
+
26
+ ## Parameters
27
+
28
+ Only the fields you fill in are sent to the Actor; empty fields use the Actor's own defaults.
29
+
30
+ | Parameter | Type | Default | Description |
31
+ |---|---|---|---|
32
+ | **Username(s)**<br>`usernames` | List | | Username(s) of TikTok users to scrape. Ex: nike |
33
+ | **User's ID(s)**<br>`userIds` | List | | User ID, get from other TikTok API data. Ex: 6714563164218679553 |
34
+ | **User's URL(s)**<br>`urls` | List | | User URL from TikTok. Ex: https://www.tiktok.com/@nickiminaj |
35
+ | **limit** (required)<br>`limit` | Number | `20` | Soft limit of each userId, username, url. If actual result size >= limit. The scraper will stop. |
36
+
37
+ ## Output example
38
+
39
+ Each dataset item becomes one n8n item. A shortened example (the real items have more fields):
40
+
41
+ ```json
42
+ {
43
+ "aweme_id": "7714381579564387598",
44
+ "desc": "Let’s see what sticks πŸ‘€",
45
+ "create_time": 1796144443,
46
+ "author": {
47
+ "uid": "208464585232822272",
48
+ "short_id": "0",
49
+ "nickname": "Nike",
50
+ "signature": "Just Do It.",
51
+ "avatar_larger": {},
52
+ "avatar_thumb": {},
53
+ "avatar_medium": {},
54
+ "follow_status": 0
55
+ },
56
+ "music": {
57
+ "id": 7714381606068276000,
58
+ "id_str": "7714381606068275981",
59
+ "title": "original sound - nike",
60
+ "author": "Nike",
61
+ "album": "",
62
+ "cover_large": {},
63
+ "cover_medium": {},
64
+ "cover_thumb": {}
65
+ },
66
+ "cha_list": null,
67
+ "video": {
68
+ "play_addr": {},
69
+ "cover": {},
70
+ "height": 1280,
71
+ "width": 720,
72
+ "dynamic_cover": {},
73
+ "origin_cover": {},
74
+ "ratio": "720p",
75
+ "download_addr": {}
76
+ },
77
+ "share_url": "https://www.tiktok.com/@nike/video/7714381579564387598?_r=1&u_code=elgdg4eji4j662&preview_pb=0&sharer_language=en&_d=...",
78
+ "user_digged": 0,
79
+ "statistics": {
80
+ "aweme_id": "7714381579564387598",
81
+ "comment_count": 16,
82
+ "digg_count": 190,
83
+ "download_count": 0,
84
+ "play_count": 13246,
85
+ "share_count": 0,
86
+ "forward_count": 0,
87
+ "lose_count": 0
88
+ },
89
+ "status": {
90
+ "aweme_id": "7714381579564387598",
91
+ "is_delete": false,
92
+ "allow_share": true,
93
+ "allow_comment": true,
94
+ "private_status": 0,
95
+ "in_reviewing": false,
96
+ "reviewed": 0,
97
+ "self_see": false
98
+ },
99
+ "rate": 12,
100
+ "text_extra": [],
101
+ "is_top": 0,
102
+ "label_top": {
103
+ "uri": "tiktok-obj/1598708589477025.PNG",
104
+ "url_list": [
105
+ "https://p16-common.tiktokcdn-eu.com/tiktok-obj/1598708589477025.PNG~tplv-tiktokx-origin.image?dr=10423&t=4d5b0474&ps=...",
106
+ "https://p19-common.tiktokcdn-eu.com/tiktok-obj/1598708589477025.PNG~tplv-tiktokx-origin.image?dr=10423&t=4d5b0474&ps=..."
107
+ ],
108
+ "width": 720,
109
+ "height": 720,
110
+ "url_prefix": null
111
+ },
112
+ "share_info": {
113
+ "share_url": "https://www.tiktok.com/@nike/video/7714381579564387598?_r=1&u_code=elgdg4eji4j662&preview_pb=0&sharer_language=en&_d=...",
114
+ "share_desc": "Check out Nike's video! #TikTok",
115
+ "share_title": "Check out Nike’s video! #TikTok > ",
116
+ "bool_persist": 0,
117
+ "share_title_myself": "",
118
+ "share_title_other": "",
119
+ "share_link_desc": "",
120
+ "share_signature_url": ""
121
+ },
122
+ "distance": "",
123
+ "video_labels": [],
124
+ "is_vr": false,
125
+ "is_ads": false,
126
+ "aweme_type": 0,
127
+ "cmt_swt": false,
128
+ "image_infos": null,
129
+ "risk_infos": {
130
+ "vote": false,
131
+ "warn": false,
132
+ "risk_sink": false,
133
+ "type": 0,
134
+ "content": ""
135
+ },
136
+ "is_relieve": false
137
+ }
138
+ ```
139
+
140
+ ## How it works
141
+
142
+ The node starts a run of the Actor with your parameters, waits for it to finish, and returns the
143
+ items of the run's dataset. If the run fails without producing any items, the node throws an error
144
+ with the run's status message (enable **Continue On Fail** to keep the workflow going).
145
+
146
+ ## Changelog
147
+
148
+ - **0.1.0** (2026-12-02): first release.
149
+
150
+ ## Links
151
+
152
+ - [Actor on Apify Store](https://apify.com/novi/tiktok-user-api?fpr=7hce1m)
153
+ - [Apify integration with n8n](https://docs.apify.com/platform/integrations/n8n)
154
+ - [Report an issue](https://apify.com/novi/tiktok-user-api/issues)
155
+
156
+ ## License
157
+
158
+ [MIT](LICENSE.md)
@@ -0,0 +1,10 @@
1
+ import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class ApifyApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ icon: Icon;
7
+ properties: INodeProperties[];
8
+ authenticate: IAuthenticateGeneric;
9
+ test: ICredentialTestRequest;
10
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApifyApi = void 0;
4
+ class ApifyApi {
5
+ constructor() {
6
+ this.name = 'apifyApi';
7
+ this.displayName = 'Apify API';
8
+ this.documentationUrl = 'https://docs.apify.com/platform/integrations/api#api-token';
9
+ this.icon = {
10
+ light: "file:../nodes/ApifyTiktokUserApi/logo.svg",
11
+ dark: "file:../nodes/ApifyTiktokUserApi/logo.svg",
12
+ };
13
+ this.properties = [
14
+ {
15
+ displayName: 'API Key',
16
+ name: 'apiKey',
17
+ type: 'string',
18
+ typeOptions: { password: true },
19
+ default: '',
20
+ },
21
+ ];
22
+ this.authenticate = {
23
+ type: 'generic',
24
+ properties: {
25
+ headers: {
26
+ Authorization: '=Bearer {{$credentials.apiKey}}',
27
+ },
28
+ },
29
+ };
30
+ this.test = {
31
+ request: {
32
+ method: 'GET',
33
+ url: 'https://api.apify.com/v2/me',
34
+ },
35
+ };
36
+ }
37
+ }
38
+ exports.ApifyApi = ApifyApi;
39
+ //# sourceMappingURL=ApifyApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApifyApi.credentials.js","sourceRoot":"","sources":["../../credentials/ApifyApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,QAAQ;IAArB;QACC,SAAI,GAAG,UAAU,CAAC;QAElB,gBAAW,GAAG,WAAW,CAAC;QAE1B,qBAAgB,GAAG,4DAA4D,CAAC;QAEhF,SAAI,GAAS;YACZ,KAAK,EAAE,2CAA2C;YAClD,IAAI,EAAE,2CAA2C;SACjD,CAAA;QAED,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;aACX;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAKF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,6BAA6B;aAClC;SACD,CAAC;IACH,CAAC;CAAA;AAxCD,4BAwCC"}
@@ -0,0 +1,9 @@
1
+ import type { Icon, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class ApifyOAuth2Api implements ICredentialType {
3
+ name: string;
4
+ extends: string[];
5
+ displayName: string;
6
+ icon: Icon;
7
+ documentationUrl: string;
8
+ properties: INodeProperties[];
9
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApifyOAuth2Api = void 0;
4
+ const scopes = ['profile', 'full_api_access'];
5
+ class ApifyOAuth2Api {
6
+ constructor() {
7
+ this.name = 'apifyOAuth2Api';
8
+ this.extends = ['oAuth2Api'];
9
+ this.displayName = 'Apify OAuth2 API';
10
+ this.icon = {
11
+ light: "file:../nodes/ApifyTiktokUserApi/logo.svg",
12
+ dark: "file:../nodes/ApifyTiktokUserApi/logo.svg",
13
+ };
14
+ this.documentationUrl = 'https://docs.apify.com/api/v2';
15
+ this.properties = [
16
+ {
17
+ displayName: 'Grant Type',
18
+ name: 'grantType',
19
+ type: 'hidden',
20
+ default: 'pkce',
21
+ },
22
+ {
23
+ displayName: 'Authorization URL',
24
+ name: 'authUrl',
25
+ type: 'hidden',
26
+ default: 'https://console.apify.com/authorize/oauth',
27
+ },
28
+ {
29
+ displayName: 'Access Token URL',
30
+ name: 'accessTokenUrl',
31
+ type: 'hidden',
32
+ default: 'https://console-backend.apify.com/oauth/apps/token',
33
+ },
34
+ {
35
+ displayName: 'Scope',
36
+ name: 'scope',
37
+ type: 'hidden',
38
+ default: `${scopes.join(' ')}`,
39
+ },
40
+ {
41
+ displayName: 'Auth URI Query Parameters',
42
+ name: 'authQueryParameters',
43
+ type: 'hidden',
44
+ default: '',
45
+ },
46
+ {
47
+ displayName: 'Authentication',
48
+ name: 'authentication',
49
+ type: 'hidden',
50
+ default: 'header',
51
+ },
52
+ {
53
+ displayName: 'Client ID',
54
+ name: 'clientId',
55
+ type: 'hidden',
56
+ default: '',
57
+ },
58
+ {
59
+ displayName: 'Client Secret',
60
+ name: 'clientSecret',
61
+ type: 'hidden',
62
+ default: '',
63
+ typeOptions: { password: true },
64
+ },
65
+ ];
66
+ }
67
+ }
68
+ exports.ApifyOAuth2Api = ApifyOAuth2Api;
69
+ //# sourceMappingURL=ApifyOAuth2Api.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApifyOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/ApifyOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;AAE9C,MAAa,cAAc;IAA3B;QACC,SAAI,GAAG,gBAAgB,CAAC;QAExB,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QAExB,gBAAW,GAAG,kBAAkB,CAAC;QAEjC,SAAI,GAAS;YACZ,KAAK,EAAE,2CAA2C;YAClD,IAAI,EAAE,2CAA2C;SACjD,CAAA;QAGD,qBAAgB,GAAG,+BAA+B,CAAC;QAEnD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;aACf;YACD;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,2CAA2C;aACpD;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,oDAAoD;aAC7D;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;aAC9B;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,QAAQ;aACjB;YACD;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;aAC/B;SACD,CAAC;IACH,CAAC;CAAA;AAlED,wCAkEC"}
@@ -0,0 +1,5 @@
1
+ <svg width="150" height="150" viewBox="0 0 150 150" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M86.0214 0H147.727C148.982 0 150 1.01753 150 2.27273V96.5744C150 98.8332 147.062 99.7089 145.826 97.8188L84.1196 3.51714C83.1305 2.00559 84.215 0 86.0214 0Z" fill="#246DFF"/>
3
+ <path d="M63.9786 0H2.27273C1.01753 0 0 1.01753 0 2.27273V96.5744C0 98.8332 2.93774 99.7089 4.1745 97.8188L65.8804 3.51714C66.8695 2.00559 65.785 0 63.9786 0Z" fill="#20A34E"/>
4
+ <path d="M73.9429 75.5012L3.84485 146.126C2.42137 147.56 3.43724 150 5.45792 150H144.6C146.612 150 147.632 147.578 146.225 146.139L77.1811 75.5135C76.2942 74.6063 74.8365 74.6008 73.9429 75.5012Z" fill="#F86606"/>
5
+ </svg>
@@ -0,0 +1,13 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare const ACTOR_ID: string;
3
+ export declare const PACKAGE_NAME: string;
4
+ export declare const CLASS_NAME: string;
5
+ export declare const ClassNameCamel: string;
6
+ export declare const X_PLATFORM_HEADER_ID: string;
7
+ export declare const X_PLATFORM_APP_HEADER_ID: string;
8
+ export declare const DISPLAY_NAME: string;
9
+ export declare const DESCRIPTION: string;
10
+ export declare class ApifyTiktokUserApi implements INodeType {
11
+ description: INodeTypeDescription;
12
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
13
+ }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApifyTiktokUserApi = exports.DESCRIPTION = exports.DISPLAY_NAME = exports.X_PLATFORM_APP_HEADER_ID = exports.X_PLATFORM_HEADER_ID = exports.ClassNameCamel = exports.CLASS_NAME = exports.PACKAGE_NAME = exports.ACTOR_ID = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const ApifyTiktokUserApi_properties_1 = require("./ApifyTiktokUserApi.properties");
6
+ const executeActor_1 = require("./helpers/executeActor");
7
+ exports.ACTOR_ID = 'NuuzTdDmiVlszIVwB';
8
+ exports.PACKAGE_NAME = 'n8n-nodes-tiktok-user-api';
9
+ exports.CLASS_NAME = 'ApifyTiktokUserApi';
10
+ exports.ClassNameCamel = exports.CLASS_NAME.charAt(0).toLowerCase() + exports.CLASS_NAME.slice(1);
11
+ exports.X_PLATFORM_HEADER_ID = 'n8n';
12
+ exports.X_PLATFORM_APP_HEADER_ID = 'tiktok-user-api-app';
13
+ exports.DISPLAY_NAME = 'Apify TikTok Profile Videos API';
14
+ exports.DESCRIPTION = 'Scrape TikTok Profile feeds with NO watermarks! Get video URLs, descriptions, music, stats, and more. Extract data by username, URL, or User ID. Control output with a limit. #tiktok #scraper #nowatermark';
15
+ class ApifyTiktokUserApi {
16
+ constructor() {
17
+ this.description = {
18
+ displayName: exports.DISPLAY_NAME,
19
+ name: exports.ClassNameCamel,
20
+ icon: { light: 'file:logo.svg', dark: 'file:logo.svg' },
21
+ group: ['transform'],
22
+ version: [1],
23
+ defaultVersion: 1,
24
+ subtitle: 'Run Scraper',
25
+ description: exports.DESCRIPTION,
26
+ defaults: {
27
+ name: exports.DISPLAY_NAME,
28
+ },
29
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
30
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
31
+ usableAsTool: true,
32
+ credentials: [
33
+ {
34
+ displayName: 'Apify API key connection',
35
+ name: 'apifyApi',
36
+ required: false,
37
+ displayOptions: {
38
+ show: {
39
+ authentication: ['apifyApi'],
40
+ },
41
+ },
42
+ },
43
+ {
44
+ displayName: 'Apify OAuth2 connection',
45
+ name: 'apifyOAuth2Api',
46
+ required: false,
47
+ displayOptions: {
48
+ show: {
49
+ authentication: ['apifyOAuth2Api'],
50
+ },
51
+ },
52
+ },
53
+ ],
54
+ properties: ApifyTiktokUserApi_properties_1.properties,
55
+ };
56
+ }
57
+ async execute() {
58
+ const items = this.getInputData();
59
+ const returnData = [];
60
+ for (let i = 0; i < items.length; i++) {
61
+ try {
62
+ const data = await executeActor_1.runActor.call(this, i);
63
+ const addPairedItem = (item) => ({
64
+ ...item,
65
+ pairedItem: { item: i },
66
+ });
67
+ returnData.push(...data.map(addPairedItem));
68
+ }
69
+ catch (error) {
70
+ if (this.continueOnFail()) {
71
+ returnData.push({
72
+ json: { error: error.message },
73
+ pairedItem: { item: i },
74
+ });
75
+ continue;
76
+ }
77
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
78
+ }
79
+ }
80
+ return [returnData];
81
+ }
82
+ }
83
+ exports.ApifyTiktokUserApi = ApifyTiktokUserApi;
84
+ //# sourceMappingURL=ApifyTiktokUserApi.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApifyTiktokUserApi.node.js","sourceRoot":"","sources":["../../../nodes/ApifyTiktokUserApi/ApifyTiktokUserApi.node.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AACtB,mFAA6D;AAC7D,yDAAkD;AAGrC,QAAA,QAAQ,GAAG,mBAA6B,CAAC;AAEzC,QAAA,YAAY,GAAG,2BAAqC,CAAC;AACrD,QAAA,UAAU,GAAG,oBAA8B,CAAC;AAC5C,QAAA,cAAc,GAAG,kBAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE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,GAAyB,EAAE,CAAC;QAE5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,IAAI,CAAC;gBACJ,MAAM,IAAI,GAAG,MAAM,uBAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;gBAE1C,MAAM,aAAa,GAAG,CAAC,IAAwB,EAAE,EAAE,CAAC,CAAC;oBACpD,GAAG,IAAI;oBACP,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;iBACvB,CAAC,CAAC;gBAEH,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;YAC7C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE;wBAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACvB,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAc,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;YAChF,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA7ED,gDA6EC"}
@@ -0,0 +1,38 @@
1
+ {
2
+ "node": "n8n-nodes-tiktok-user-api",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": [
6
+ "Development",
7
+ "Marketing & Content",
8
+ "Sales",
9
+ "Analytics",
10
+ "Utility",
11
+ "Data & Storage"
12
+ ],
13
+ "resources": {
14
+ "credentialDocumentation": [
15
+ {
16
+ "url": "https://docs.apify.com/platform/integrations/n8n"
17
+ }
18
+ ],
19
+ "primaryDocumentation": [
20
+ {
21
+ "url": "https://docs.apify.com/"
22
+ }
23
+ ]
24
+ },
25
+ "alias": [
26
+ "apify",
27
+ "actor",
28
+ "serp",
29
+ "llm",
30
+ "ai agent",
31
+ "scrape",
32
+ "crawler",
33
+ "web",
34
+ "dataset",
35
+ "search",
36
+ "data extraction"
37
+ ]
38
+ }
@@ -0,0 +1,4 @@
1
+ import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
2
+ export declare function buildActorInput(context: IExecuteFunctions, itemIndex: number): Record<string, any>;
3
+ export declare const actorProperties: INodeProperties[];
4
+ export declare const properties: INodeProperties[];
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.properties = exports.actorProperties = void 0;
4
+ exports.buildActorInput = buildActorInput;
5
+ function getFixedCollectionParam(context, paramName, itemIndex, optionName, transformType) {
6
+ var _a;
7
+ const param = context.getNodeParameter(paramName, itemIndex, {});
8
+ if (!((_a = param === null || param === void 0 ? void 0 : param[optionName]) === null || _a === void 0 ? void 0 : _a.length))
9
+ return {};
10
+ let result = param[optionName];
11
+ if (transformType === 'mapValues') {
12
+ result = result.map((item) => item.value).filter((value) => value !== '');
13
+ }
14
+ return result.length ? { [paramName]: result } : {};
15
+ }
16
+ function buildActorInput(context, itemIndex) {
17
+ return {
18
+ ...getFixedCollectionParam(context, 'usernames', itemIndex, 'values', 'mapValues'),
19
+ ...getFixedCollectionParam(context, 'userIds', itemIndex, 'values', 'mapValues'),
20
+ ...getFixedCollectionParam(context, 'urls', itemIndex, 'values', 'mapValues'),
21
+ limit: context.getNodeParameter('limit', itemIndex),
22
+ };
23
+ }
24
+ const authenticationProperties = [
25
+ {
26
+ displayName: 'Authentication',
27
+ name: 'authentication',
28
+ type: 'options',
29
+ options: [
30
+ {
31
+ name: 'API Key',
32
+ value: 'apifyApi',
33
+ },
34
+ {
35
+ name: 'OAuth2',
36
+ value: 'apifyOAuth2Api',
37
+ },
38
+ ],
39
+ default: 'apifyApi',
40
+ description: 'Choose which authentication method to use',
41
+ },
42
+ ];
43
+ exports.actorProperties = [
44
+ {
45
+ "displayName": "Username(s)",
46
+ "name": "usernames",
47
+ "description": "Username(s) of TikTok users to scrape. Ex: nike",
48
+ "required": false,
49
+ "default": {},
50
+ "type": "fixedCollection",
51
+ "typeOptions": {
52
+ "multipleValues": true
53
+ },
54
+ "options": [
55
+ {
56
+ "name": "values",
57
+ "displayName": "Values",
58
+ "values": [
59
+ {
60
+ "displayName": "Value",
61
+ "name": "value",
62
+ "type": "string",
63
+ "default": "",
64
+ "placeholder": "nike"
65
+ }
66
+ ]
67
+ }
68
+ ]
69
+ },
70
+ {
71
+ "displayName": "User's ID(s)",
72
+ "name": "userIds",
73
+ "description": "User ID, get from other TikTok API data. Ex: 6714563164218679553",
74
+ "required": false,
75
+ "default": {},
76
+ "type": "fixedCollection",
77
+ "typeOptions": {
78
+ "multipleValues": true
79
+ },
80
+ "options": [
81
+ {
82
+ "name": "values",
83
+ "displayName": "Values",
84
+ "values": [
85
+ {
86
+ "displayName": "Value",
87
+ "name": "value",
88
+ "type": "string",
89
+ "default": ""
90
+ }
91
+ ]
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ "displayName": "User's URL(s)",
97
+ "name": "urls",
98
+ "description": "User URL from TikTok. Ex: https://www.tiktok.com/@nickiminaj",
99
+ "required": false,
100
+ "default": {},
101
+ "type": "fixedCollection",
102
+ "typeOptions": {
103
+ "multipleValues": true
104
+ },
105
+ "options": [
106
+ {
107
+ "name": "values",
108
+ "displayName": "Values",
109
+ "values": [
110
+ {
111
+ "displayName": "Value",
112
+ "name": "value",
113
+ "type": "string",
114
+ "default": ""
115
+ }
116
+ ]
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ "displayName": "limit",
122
+ "name": "limit",
123
+ "description": "Soft limit of each userId, username, url. If actual result size >= limit. The scraper will stop.",
124
+ "required": true,
125
+ "default": 20,
126
+ "type": "number",
127
+ "typeOptions": {}
128
+ }
129
+ ];
130
+ exports.properties = [...exports.actorProperties, ...authenticationProperties];
131
+ //# sourceMappingURL=ApifyTiktokUserApi.properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApifyTiktokUserApi.properties.js","sourceRoot":"","sources":["../../../nodes/ApifyTiktokUserApi/ApifyTiktokUserApi.properties.ts"],"names":[],"mappings":";;;AAmBA,0CAWC;AA5BD,SAAS,uBAAuB,CAC/B,OAA0B,EAC1B,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,aAA0C;;IAE1C,MAAM,KAAK,GAAG,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAA6B,CAAC;IAC7F,IAAI,CAAC,CAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,UAAU,CAAC,0CAAE,MAAM,CAAA;QAAE,OAAO,EAAE,CAAC;IAE5C,IAAI,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;IAC/B,IAAI,aAAa,KAAK,WAAW,EAAE,CAAC;QACnC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACrF,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACrD,CAAC;AAED,SAAgB,eAAe,CAAC,OAA0B,EAAE,SAAiB;IAC5E,OAAO;QAEN,GAAG,uBAAuB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC;QAElF,GAAG,uBAAuB,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC;QAEhF,GAAG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AAE,QAAQ;gBACvB,QAAQ,EAAE;oBACR;wBACE,aAAa,EAAE,OAAO;wBACtB,MAAM,EAAE,OAAO;wBACf,MAAM,EAAE,QAAQ;wBAChB,SAAS,EAAE,EAAE;qBACd;iBACF;aACF;SACF;KACF;IACD;QACE,aAAa,EAAE,eAAe;QAC9B,MAAM,EAAE,MAAM;QACd,aAAa,EAAE,8DAA8D;QAC7E,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,EAAE;QACb,MAAM,EAAE,iBAAiB;QACzB,aAAa,EAAE;YACb,gBAAgB,EAAE,IAAI;SACvB;QACD,SAAS,EAAE;YACT;gBACE,MAAM,EAAE,QAAQ;gBAChB,aAAa,EAAE,QAAQ;gBACvB,QAAQ,EAAE;oBACR;wBACE,aAAa,EAAE,OAAO;wBACtB,MAAM,EAAE,OAAO;wBACf,MAAM,EAAE,QAAQ;wBAChB,SAAS,EAAE,EAAE;qBACd;iBACF;aACF;SACF;KACF;IACD;QACE,aAAa,EAAE,OAAO;QACtB,MAAM,EAAE,OAAO;QACf,aAAa,EAAE,kGAAkG;QACjH,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,EAAE;QACb,MAAM,EAAE,QAAQ;QAChB,aAAa,EAAE,EAAE;KAClB;CACF,CAAC;AAEW,QAAA,UAAU,GAAsB,CAAC,GAAG,uBAAe,EAAE,GAAG,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function runActorApi(this: IExecuteFunctions, actorId: string, input: Record<string, any>): Promise<any>;
3
+ export declare function runActor(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runActorApi = runActorApi;
4
+ exports.runActor = runActor;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const genericFunctions_1 = require("./genericFunctions");
7
+ const ApifyTiktokUserApi_node_1 = require("../ApifyTiktokUserApi.node");
8
+ const ApifyTiktokUserApi_properties_1 = require("../ApifyTiktokUserApi.properties");
9
+ async function runActorApi(actorId, input) {
10
+ return await genericFunctions_1.apiRequest.call(this, {
11
+ method: 'POST',
12
+ uri: `/v2/acts/${actorId}/runs`,
13
+ body: input,
14
+ });
15
+ }
16
+ function assertRunSucceeded(run, items) {
17
+ var _a;
18
+ if ((run === null || run === void 0 ? void 0 : run.status) === 'SUCCEEDED' || items.length > 0)
19
+ return;
20
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
21
+ message: `Actor run ${run === null || run === void 0 ? void 0 : run.id} finished with status ${run === null || run === void 0 ? void 0 : run.status}`,
22
+ description: (_a = run === null || run === void 0 ? void 0 : run.statusMessage) !== null && _a !== void 0 ? _a : `See https://console.apify.com/actors/runs/${run === null || run === void 0 ? void 0 : run.id}`,
23
+ });
24
+ }
25
+ async function runActor(i) {
26
+ var _a;
27
+ const run = await runActorApi.call(this, ApifyTiktokUserApi_node_1.ACTOR_ID, (0, ApifyTiktokUserApi_properties_1.buildActorInput)(this, i));
28
+ if (!((_a = run === null || run === void 0 ? void 0 : run.data) === null || _a === void 0 ? void 0 : _a.id)) {
29
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
30
+ message: `Run ID not found after running the Actor`,
31
+ });
32
+ }
33
+ const finishedRun = await genericFunctions_1.pollRunStatus.call(this, run.data.id);
34
+ const items = await genericFunctions_1.getResults.call(this, run.data.defaultDatasetId);
35
+ assertRunSucceeded.call(this, finishedRun, items);
36
+ return items;
37
+ }
38
+ //# sourceMappingURL=executeActor.js.map