@seranking/n8n-nodes-seranking 1.5.7 → 1.5.9

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/README.md CHANGED
@@ -90,8 +90,8 @@ Open `http://localhost:5678` and add the SE Ranking node to your workflow.
90
90
 
91
91
  1. Add SE Ranking node
92
92
  2. Click "Create New Credential"
93
- 3. Enter your API Token
94
- 4. Select "Data API" as API Type
93
+ 3. Enter your **Data API Token** (required)
94
+ 4. Enter your **Project API Token** (optional — only if using Project API resources)
95
95
  5. Save
96
96
 
97
97
  ### Docker Installation
@@ -164,15 +164,13 @@ To use this node, you need:
164
164
 
165
165
  1. Open any workflow and add the **SE Ranking** node
166
166
  2. Click on **Create New Credential**
167
- 3. Enter your **API Token**
168
- 4. Select **API Type**:
169
- - **Data API** — SEO research data (domains, keywords, backlinks, SERP)
170
- - **Project API** — Project management, tracking, audits, sub-accounts
167
+ 3. Enter your **API Token (Data API)** — required
168
+ 4. Enter your **API Token (Project API)** — optional, only needed for Project API resources
171
169
  5. Click **Save**
172
170
 
173
- The node will automatically test your credentials by making a test request to the SE Ranking API.
171
+ The node will automatically test your Data API credentials by making a test request to the SE Ranking API.
174
172
 
175
- > **Note:** Data API and Project API use different tokens. Data API tokens are UUID format; Project API tokens are 40-character hex format. Get both from your [SE Ranking API Dashboard](https://online.seranking.com/admin.api.dashboard.html).
173
+ > **Note:** Data API and Project API use different tokens. Data API tokens are UUID format; Project API tokens are 40-character hex format. Get both from your [SE Ranking API Dashboard](https://online.seranking.com/admin.api.dashboard.html). The node automatically routes to the correct API based on the resource you select.
176
174
 
177
175
  ---
178
176
 
@@ -184,7 +182,7 @@ The node will automatically test your credentials by making a test request to th
184
182
 
185
183
  ## Operations
186
184
 
187
- This node provides access to **20 SE Ranking resources** with **171 total operations** across two API types:
185
+ This node provides access to **20 SE Ranking resources** with **172 total operations** across two API types:
188
186
 
189
187
  ### Data API (6 resources, 65 operations)
190
188
 
@@ -274,7 +272,7 @@ This node provides access to **20 SE Ranking resources** with **171 total operat
274
272
 
275
273
  ---
276
274
 
277
- ### Project API (14 resources, 106 operations)
275
+ ### Project API (14 resources, 107 operations)
278
276
 
279
277
  ### Project Management (17 operations)
280
278
 
@@ -304,7 +302,7 @@ This node provides access to **20 SE Ranking resources** with **171 total operat
304
302
  - Delete Group - Remove a project group
305
303
  - Move Projects to Group - Move projects into a group
306
304
 
307
- ### AI Result Tracker (13 operations)
305
+ ### AI Result Tracker (14 operations)
308
306
 
309
307
  - Get Site Brand - Get brand name for a site
310
308
  - Save Site Brand - Set brand name for a site
@@ -319,6 +317,7 @@ This node provides access to **20 SE Ranking resources** with **171 total operat
319
317
  - Add Prompts - Add keywords/prompts to LLM engine
320
318
  - Delete Prompts - Remove prompts from LLM engine
321
319
  - Get Prompt Rankings - Prompt ranking data over time
320
+ - Get Prompt Answer - Full AI answer text, cited sources, detected brands, and organic URLs (Google AI Overview) for a tracked prompt on a given date
322
321
 
323
322
  ### Keyword Groups (5 operations)
324
323
 
@@ -718,7 +717,12 @@ For detailed API specifications, visit [SE Ranking API Documentation](https://se
718
717
 
719
718
  ## Version History
720
719
 
721
- ### v1.3.6 (Current)
720
+ ### v1.5.8 (Current)
721
+
722
+ * ✅ **NEW: Get Prompt Answer (AI Result Tracker)** - Returns full AI answer text, cited source URLs, detected brand mentions, and (for Google AI Overview) top organic URLs for a tracked prompt on a given date. Cost: 0 credits.
723
+ * 📝 **Note on SE Ranking docs quirk** - The endpoint's path param is documented as `keyword_id` but actually requires `k2site_llm_id` from `List Prompts`. The node field is labeled accordingly.
724
+
725
+ ### v1.3.6
722
726
 
723
727
  * 🔧 **FIX: Rate limiting compatibility** - Replaced setTimeout with n8n-workflow sleep function for n8n verified node compliance
724
728
 
@@ -793,7 +797,7 @@ For detailed API specifications, visit [SE Ranking API Documentation](https://se
793
797
 
794
798
  ## Features
795
799
 
796
- ✅ **171 Operations** - Comprehensive coverage across 20 resources (Data API + Project API)
800
+ ✅ **172 Operations** - Comprehensive coverage across 20 resources (Data API + Project API)
797
801
 
798
802
  ✅ **Pingback Webhooks** - Event-driven notifications for SERP task completion
799
803
 
@@ -876,7 +880,7 @@ For more details, see [n8n's rate limiting documentation](https://docs.n8n.io/in
876
880
  **Solution**:
877
881
 
878
882
  1. Verify API token is correct (copy from SE Ranking dashboard)
879
- 2. Ensure API Type is set to "Data API"
883
+ 2. For Project API resources, ensure the Project API Token field is filled
880
884
  3. Check token hasn't expired
881
885
  4. Regenerate token in SE Ranking dashboard if needed
882
886
  5. Test credentials using the "Test" button in n8n
@@ -1,9 +1,8 @@
1
- import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
1
+ import { ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
2
  export declare class SeRankingApi implements ICredentialType {
3
3
  name: string;
4
4
  displayName: string;
5
5
  documentationUrl: string;
6
6
  properties: INodeProperties[];
7
- authenticate: IAuthenticateGeneric;
8
7
  test: ICredentialTestRequest;
9
8
  }
@@ -8,7 +8,7 @@ class SeRankingApi {
8
8
  this.documentationUrl = 'https://seranking.com/api-google-organic.html';
9
9
  this.properties = [
10
10
  {
11
- displayName: 'API Token',
11
+ displayName: 'API Token (Data API)',
12
12
  name: 'apiToken',
13
13
  type: 'string',
14
14
  typeOptions: {
@@ -16,41 +16,27 @@ class SeRankingApi {
16
16
  },
17
17
  default: '',
18
18
  required: true,
19
- description: 'Your SE Ranking API token from the API Dashboard',
19
+ description: 'Token for Data API domain analysis, keywords, backlinks, SERP, etc.',
20
20
  },
21
21
  {
22
- displayName: 'API Type',
23
- name: 'apiType',
24
- type: 'options',
25
- options: [
26
- {
27
- name: 'Data API',
28
- value: 'data',
29
- description: 'Used for positions, rankings, keyword data.',
30
- },
31
- {
32
- name: 'Project API',
33
- value: 'project',
34
- description: 'Used for managing sites, accounts, etc.',
35
- },
36
- ],
37
- default: 'data',
38
- description: 'Choose which SE Ranking API you want to connect to',
39
- },
40
- ];
41
- this.authenticate = {
42
- type: 'generic',
43
- properties: {
44
- headers: {
45
- 'Authorization': '=Token {{$credentials.apiToken}}',
22
+ displayName: 'API Token (Project API)',
23
+ name: 'projectApiToken',
24
+ type: 'string',
25
+ typeOptions: {
26
+ password: true,
46
27
  },
28
+ default: '',
29
+ description: 'Token for Project API — project management, competitors, audit, etc. Leave empty if not using Project API resources.',
47
30
  },
48
- };
31
+ ];
49
32
  this.test = {
50
33
  request: {
51
- baseURL: '={{$credentials.apiType === "project" ? "https://api4.seranking.com" : "https://api.seranking.com/v1"}}',
52
- url: '={{$credentials.apiType === "project" ? "/sites" : "/account/subscription"}}',
34
+ baseURL: 'https://api.seranking.com/v1',
35
+ url: '/account/subscription',
53
36
  method: 'GET',
37
+ headers: {
38
+ 'Authorization': '=Token {{$credentials.apiToken}}',
39
+ },
54
40
  },
55
41
  };
56
42
  }
@@ -50,7 +50,7 @@ class SeRanking {
50
50
  icon: 'file:seranking.svg',
51
51
  group: ['transform'],
52
52
  version: 1,
53
- subtitle: '={{$parameter["apiType"] === "projectApi" ? "Project" : "Data"}} — {{$parameter["resource"] + ": " + $parameter["operation"]}}',
53
+ subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
54
54
  description: 'Interact with SE Ranking API for SEO data',
55
55
  defaults: {
56
56
  name: 'SE Ranking',
@@ -66,76 +66,70 @@ class SeRanking {
66
66
  ],
67
67
  properties: [
68
68
  {
69
- displayName: 'API Type',
70
- name: 'apiType',
69
+ displayName: 'Resource',
70
+ name: 'resource',
71
71
  type: 'options',
72
72
  noDataExpression: true,
73
73
  options: [
74
74
  {
75
- name: 'Data API',
76
- value: 'dataApi',
77
- description: 'SEO research data (domains, keywords, backlinks, etc.)',
75
+ name: 'Account System',
76
+ value: 'accountSystem',
77
+ description: 'Account balance, profile, and subscription info',
78
78
  },
79
79
  {
80
- name: 'Project API',
81
- value: 'projectApi',
82
- description: 'Project management, groups, and AI result tracking',
80
+ name: 'AI Result Tracker',
81
+ value: 'aiResultTracker',
82
+ description: 'Track brand visibility across AI search engines',
83
83
  },
84
- ],
85
- default: 'dataApi',
86
- },
87
- {
88
- displayName: 'Resource',
89
- name: 'resource',
90
- type: 'options',
91
- noDataExpression: true,
92
- displayOptions: {
93
- show: { apiType: ['dataApi'] },
94
- },
95
- options: [
96
84
  {
97
85
  name: 'AI Search',
98
86
  value: 'aiSearch',
99
87
  description: 'LLM visibility and AI search data',
100
88
  },
89
+ {
90
+ name: 'Analytics Traffic',
91
+ value: 'analyticsTraffic',
92
+ description: 'Google Search Console data and SEO potential',
93
+ },
94
+ {
95
+ name: 'Backlink Checker',
96
+ value: 'backlinkChecker',
97
+ description: 'Backlink monitoring, disavow, and groups',
98
+ },
101
99
  {
102
100
  name: 'Backlinks',
103
101
  value: 'backlinks',
104
102
  description: 'Backlink analysis and authority metrics',
105
103
  },
104
+ {
105
+ name: 'Competitors',
106
+ value: 'competitors',
107
+ description: 'Manage competitors and retrieve ranking data',
108
+ },
106
109
  {
107
110
  name: 'Domain Analysis',
108
111
  value: 'domainAnalysis',
109
112
  description: 'Domain keyword rankings and competitor analysis',
110
113
  },
111
114
  {
112
- name: 'Keyword Research',
113
- value: 'keywordResearch',
114
- description: 'Keyword metrics, volume, CPC, and related keywords',
115
+ name: 'General Data',
116
+ value: 'generalData',
117
+ description: 'System search engines, languages, regions, and keyword volume',
115
118
  },
116
119
  {
117
- name: 'SERP Classic',
118
- value: 'serpClassic',
119
- description: 'SERP tracking and results retrieval',
120
+ name: 'Keyword Groups',
121
+ value: 'keywordGroups',
122
+ description: 'Manage keyword groups within a project',
120
123
  },
121
124
  {
122
- name: 'Website Audit',
123
- value: 'websiteAudit',
124
- description: 'Site crawling, technical SEO, and on-page analysis',
125
+ name: 'Keyword Research',
126
+ value: 'keywordResearch',
127
+ description: 'Keyword metrics, volume, CPC, and related keywords',
125
128
  },
126
- ],
127
- default: 'domainAnalysis',
128
- },
129
- {
130
- displayName: 'Resource',
131
- name: 'resource',
132
- type: 'options',
133
- noDataExpression: true,
134
- options: [
135
129
  {
136
- name: 'Project Management',
137
- value: 'projectManagement',
138
- description: 'Manage projects and search engine configurations',
130
+ name: 'Marketing Plan',
131
+ value: 'marketingPlan',
132
+ description: 'Marketing plan checklists and tasks',
139
133
  },
140
134
  {
141
135
  name: 'Project Groups',
@@ -143,34 +137,19 @@ class SeRanking {
143
137
  description: 'Manage project groups within the account',
144
138
  },
145
139
  {
146
- name: 'AI Result Tracker',
147
- value: 'aiResultTracker',
148
- description: 'Track brand visibility across AI search engines',
149
- },
150
- {
151
- name: 'Keyword Groups',
152
- value: 'keywordGroups',
153
- description: 'Manage keyword groups within a project',
154
- },
155
- {
156
- name: 'Competitors',
157
- value: 'competitors',
158
- description: 'Manage competitors and retrieve ranking data',
159
- },
160
- {
161
- name: 'URL Tags',
162
- value: 'urlTags',
163
- description: 'Manage landing page tags within a site',
140
+ name: 'Project Management',
141
+ value: 'projectManagement',
142
+ description: 'Manage projects and search engine configurations',
164
143
  },
165
144
  {
166
- name: 'Analytics Traffic',
167
- value: 'analyticsTraffic',
168
- description: 'Google Search Console data and SEO potential',
145
+ name: 'Search Volume',
146
+ value: 'searchVolume',
147
+ description: 'Keyword search volume check requests',
169
148
  },
170
149
  {
171
- name: 'Account System',
172
- value: 'accountSystem',
173
- description: 'Account balance, profile, and subscription info',
150
+ name: 'SERP Classic',
151
+ value: 'serpClassic',
152
+ description: 'SERP tracking and results retrieval',
174
153
  },
175
154
  {
176
155
  name: 'Sub-Account Management',
@@ -178,32 +157,22 @@ class SeRanking {
178
157
  description: 'Manage sub-accounts, sharing, and permissions',
179
158
  },
180
159
  {
181
- name: 'General Data',
182
- value: 'generalData',
183
- description: 'System search engines, languages, regions, and keyword volume',
160
+ name: 'URL Tags',
161
+ value: 'urlTags',
162
+ description: 'Manage landing page tags within a site',
184
163
  },
185
164
  {
186
- name: 'Marketing Plan',
187
- value: 'marketingPlan',
188
- description: 'Marketing plan checklists and tasks',
165
+ name: 'Website Audit (Data)',
166
+ value: 'websiteAudit',
167
+ description: 'Site crawling, technical SEO, and on-page analysis',
189
168
  },
190
169
  {
191
- name: 'Website Audit',
170
+ name: 'Website Audit (Project)',
192
171
  value: 'websiteAuditProject',
193
172
  description: 'Technical SEO audits lifecycle management',
194
173
  },
195
- {
196
- name: 'Backlink Checker',
197
- value: 'backlinkChecker',
198
- description: 'Backlink monitoring, disavow, and groups',
199
- },
200
- {
201
- name: 'Search Volume',
202
- value: 'searchVolume',
203
- description: 'Keyword search volume check requests',
204
- },
205
174
  ],
206
- default: 'projectManagement',
175
+ default: 'domainAnalysis',
207
176
  },
208
177
  ...AiSearchDescription_1.aiSearchOperations,
209
178
  ...AiSearchDescription_1.aiSearchFields,
@@ -55,6 +55,12 @@ exports.aiResultTrackerOperations = [
55
55
  description: 'Get tracking status and progress for an LLM engine',
56
56
  action: 'Get LLM status',
57
57
  },
58
+ {
59
+ name: 'Get Prompt Answer',
60
+ value: 'getPromptAnswer',
61
+ description: 'Get the full AI answer text, sources, brands, and organic URLs for a tracked prompt',
62
+ action: 'Get prompt answer',
63
+ },
58
64
  {
59
65
  name: 'Get Prompt Rankings',
60
66
  value: 'getPromptRankings',
@@ -127,6 +133,7 @@ exports.aiResultTrackerFields = [
127
133
  'addPrompts',
128
134
  'deletePrompts',
129
135
  'getPromptRankings',
136
+ 'getPromptAnswer',
130
137
  ],
131
138
  },
132
139
  },
@@ -262,7 +269,7 @@ exports.aiResultTrackerFields = [
262
269
  name: 'from',
263
270
  type: 'string',
264
271
  default: '',
265
- placeholder: '2024-01-01',
272
+ placeholder: '2026-01-01',
266
273
  description: 'Start date (YYYY-MM-DD). Defaults to current date.',
267
274
  },
268
275
  {
@@ -270,7 +277,7 @@ exports.aiResultTrackerFields = [
270
277
  name: 'to',
271
278
  type: 'string',
272
279
  default: '',
273
- placeholder: '2024-01-31',
280
+ placeholder: '2026-01-31',
274
281
  description: 'End date (YYYY-MM-DD). Defaults to current date.',
275
282
  },
276
283
  {
@@ -359,7 +366,7 @@ exports.aiResultTrackerFields = [
359
366
  name: 'dateFrom',
360
367
  type: 'string',
361
368
  default: '',
362
- placeholder: '2024-01-01',
369
+ placeholder: '2026-01-01',
363
370
  description: 'Start date (YYYY-MM-DD). Defaults to current date.',
364
371
  },
365
372
  {
@@ -367,7 +374,7 @@ exports.aiResultTrackerFields = [
367
374
  name: 'dateTo',
368
375
  type: 'string',
369
376
  default: '',
370
- placeholder: '2024-01-31',
377
+ placeholder: '2026-01-31',
371
378
  description: 'End date (YYYY-MM-DD). Defaults to current date.',
372
379
  },
373
380
  {
@@ -386,4 +393,41 @@ exports.aiResultTrackerFields = [
386
393
  },
387
394
  ],
388
395
  },
396
+ {
397
+ displayName: 'Keyword-LLM Link ID',
398
+ name: 'k2siteLlmId',
399
+ type: 'number',
400
+ required: true,
401
+ displayOptions: {
402
+ show: {
403
+ resource: ['aiResultTracker'],
404
+ operation: ['getPromptAnswer'],
405
+ },
406
+ },
407
+ default: 0,
408
+ description: 'Value of the <code>k2site_llm_id</code> field from List Prompts (the SE Ranking docs call this parameter <code>keyword_id</code>, but the endpoint actually expects <code>k2site_llm_id</code>)',
409
+ },
410
+ {
411
+ displayName: 'Additional Fields',
412
+ name: 'additionalFields',
413
+ type: 'collection',
414
+ placeholder: 'Add Field',
415
+ default: {},
416
+ displayOptions: {
417
+ show: {
418
+ resource: ['aiResultTracker'],
419
+ operation: ['getPromptAnswer'],
420
+ },
421
+ },
422
+ options: [
423
+ {
424
+ displayName: 'Date',
425
+ name: 'date',
426
+ type: 'string',
427
+ default: '',
428
+ placeholder: '2026-04-01',
429
+ description: 'Date of the cached answer (YYYY-MM-DD). Defaults to current date. Full text retained for last 30 days only.',
430
+ },
431
+ ],
432
+ },
389
433
  ];
@@ -108,6 +108,15 @@ async function AiResultTrackerOperations(index) {
108
108
  query.offset = additionalFields.offset;
109
109
  return await apiRequest_1.apiRequest.call(this, 'GET', `/sites/${siteId}/airt/llm/${llmId}/prompts/rankings`, {}, query, index);
110
110
  }
111
+ case 'getPromptAnswer': {
112
+ const llmId = this.getNodeParameter('llmId', index);
113
+ const k2siteLlmId = this.getNodeParameter('k2siteLlmId', index);
114
+ const additionalFields = this.getNodeParameter('additionalFields', index, {});
115
+ const query = {};
116
+ if (additionalFields.date)
117
+ query.date = additionalFields.date;
118
+ return await apiRequest_1.apiRequest.call(this, 'GET', `/sites/${siteId}/airt/llm/${llmId}/prompts/${k2siteLlmId}/answer`, {}, query, index);
119
+ }
111
120
  default:
112
121
  throw new Error(`Unknown AI Result Tracker operation: ${operation}`);
113
122
  }
@@ -13,12 +13,39 @@ async function apiRequest(method, endpoint, body = {}, query = {}, itemIndex = 0
13
13
  await (0, n8n_workflow_1.sleep)(waitTime);
14
14
  }
15
15
  lastRequestTime = Date.now();
16
+ const DATA_API_RESOURCES = new Set([
17
+ 'aiSearch',
18
+ 'backlinks',
19
+ 'domainAnalysis',
20
+ 'keywordResearch',
21
+ 'serpClassic',
22
+ 'websiteAudit',
23
+ ]);
24
+ let resource;
25
+ try {
26
+ resource = this.getNodeParameter('resource', itemIndex);
27
+ }
28
+ catch {
29
+ resource = '';
30
+ }
31
+ const isDataApi = DATA_API_RESOURCES.has(resource);
16
32
  const credentials = await this.getCredentials('seRankingApi');
33
+ const token = isDataApi
34
+ ? credentials.apiToken
35
+ : credentials.projectApiToken;
36
+ if (!token) {
37
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), isDataApi
38
+ ? 'Data API token not configured. Add your Data API token in the SE Ranking credentials.'
39
+ : 'Project API token not configured. Add your Project API token in the SE Ranking credentials.', { itemIndex });
40
+ }
17
41
  const httpMethod = method.toUpperCase();
18
42
  const options = {
19
43
  method: httpMethod,
20
44
  timeout: 60000,
21
45
  url: '',
46
+ headers: {
47
+ 'Authorization': `Token ${token}`,
48
+ },
22
49
  };
23
50
  if (query._fullUrl) {
24
51
  options.url = endpoint;
@@ -28,16 +55,9 @@ async function apiRequest(method, endpoint, body = {}, query = {}, itemIndex = 0
28
55
  options.json = false;
29
56
  }
30
57
  else {
31
- let baseUrl;
32
- if (endpoint.startsWith('/site-audit/') || endpoint.startsWith('/backlinks/') || endpoint.startsWith('/ai-search/') || endpoint.startsWith('/domain/') || endpoint.startsWith('/keywords/')) {
33
- baseUrl = 'https://api.seranking.com/v1';
34
- }
35
- else if (credentials.apiType === 'project') {
36
- baseUrl = 'https://api4.seranking.com';
37
- }
38
- else {
39
- baseUrl = 'https://api.seranking.com/v1';
40
- }
58
+ const baseUrl = isDataApi
59
+ ? 'https://api.seranking.com/v1'
60
+ : 'https://api4.seranking.com';
41
61
  options.url = `${baseUrl}${endpoint}`;
42
62
  options.json = true;
43
63
  }
@@ -97,7 +117,7 @@ async function apiRequest(method, endpoint, body = {}, query = {}, itemIndex = 0
97
117
  }
98
118
  }
99
119
  try {
100
- const response = await this.helpers.httpRequestWithAuthentication.call(this, 'seRankingApi', options);
120
+ const response = await this.helpers.httpRequest(options);
101
121
  return response;
102
122
  }
103
123
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seranking/n8n-nodes-seranking",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "description": "n8n connector for SE Ranking API - AI Search, Backlinks, Domain Analysis, Keyword Research, Website Audit, Project Management, Project Groups, AI Result Tracker, Keyword Groups, Competitors, URL Tags, Analytics Traffic, Account System, Sub-Account Management, General Data, Marketing Plan, Backlink Checker, Search Volume",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/seranking/n8n-nodes-seranking",
@@ -79,6 +79,5 @@
79
79
  "engines": {
80
80
  "node": ">=18.0.0"
81
81
  },
82
- "dependencies": {
83
- }
82
+ "dependencies": {}
84
83
  }