@adobe/spacecat-shared-ahrefs-client 1.7.1 → 1.8.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.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/index.js +16 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-ahrefs-client-v1.8.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.7.1...@adobe/spacecat-shared-ahrefs-client-v1.8.0) (2025-06-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* more fields from ahref for organic keywords ([#780](https://github.com/adobe/spacecat-shared/issues/780)) ([fd1bc34](https://github.com/adobe/spacecat-shared/commit/fd1bc3424def73bb944928d445bdf7f9df1fe933))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-ahrefs-client-v1.7.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.7.0...@adobe/spacecat-shared-ahrefs-client-v1.7.1) (2025-05-31)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -20,6 +20,21 @@ export const { fetch } = process.env.HELIX_FETCH_FORCE_HTTP1
|
|
|
20
20
|
|
|
21
21
|
const getLimit = (limit, upperLimit) => Math.min(limit, upperLimit);
|
|
22
22
|
|
|
23
|
+
export const ORGANIC_KEYWORDS_FIELDS = /** @type {const} */ ([
|
|
24
|
+
'keyword',
|
|
25
|
+
'sum_traffic',
|
|
26
|
+
'volume',
|
|
27
|
+
'best_position',
|
|
28
|
+
'cpc',
|
|
29
|
+
'last_update',
|
|
30
|
+
'is_branded',
|
|
31
|
+
'is_navigational',
|
|
32
|
+
'is_informational',
|
|
33
|
+
'is_commercial',
|
|
34
|
+
'is_transactional',
|
|
35
|
+
'serp_features_merged',
|
|
36
|
+
]);
|
|
37
|
+
|
|
23
38
|
export default class AhrefsAPIClient {
|
|
24
39
|
static createFrom(context) {
|
|
25
40
|
const { AHREFS_API_BASE_URL: apiBaseUrl, AHREFS_API_KEY: apiKey } = context.env;
|
|
@@ -207,14 +222,7 @@ export default class AhrefsAPIClient {
|
|
|
207
222
|
const queryParams = {
|
|
208
223
|
country,
|
|
209
224
|
date: new Date().toISOString().split('T')[0],
|
|
210
|
-
select:
|
|
211
|
-
'keyword',
|
|
212
|
-
'sum_traffic',
|
|
213
|
-
'volume',
|
|
214
|
-
'best_position',
|
|
215
|
-
'cpc',
|
|
216
|
-
'is_branded',
|
|
217
|
-
].join(','),
|
|
225
|
+
select: ORGANIC_KEYWORDS_FIELDS.join(','),
|
|
218
226
|
order_by: 'sum_traffic:desc',
|
|
219
227
|
target: url,
|
|
220
228
|
limit: getLimit(limit, 100),
|