@seranking/n8n-nodes-seranking 1.5.8 → 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
 
@@ -882,7 +880,7 @@ For more details, see [n8n's rate limiting documentation](https://docs.n8n.io/in
882
880
  **Solution**:
883
881
 
884
882
  1. Verify API token is correct (copy from SE Ranking dashboard)
885
- 2. Ensure API Type is set to "Data API"
883
+ 2. For Project API resources, ensure the Project API Token field is filled
886
884
  3. Check token hasn't expired
887
885
  4. Regenerate token in SE Ranking dashboard if needed
888
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,
@@ -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.8",
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
  }