@adobe/mysticat-shared-seo-client 1.2.3 → 1.3.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 +6 -0
- package/package.json +1 -1
- package/src/client.js +26 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [@adobe/mysticat-shared-seo-client-v1.3.0](https://github.com/adobe/spacecat-shared/compare/@adobe/mysticat-shared-seo-client-v1.2.3...@adobe/mysticat-shared-seo-client-v1.3.0) (2026-04-28)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **seo-client:** return keywords[] array from getPaidPages() ([#1564](https://github.com/adobe/spacecat-shared/issues/1564)) ([71be968](https://github.com/adobe/spacecat-shared/commit/71be968ac133fc3c0d547d70e9663fcf2fe90437))
|
|
6
|
+
|
|
1
7
|
## [@adobe/mysticat-shared-seo-client-v1.2.3](https://github.com/adobe/spacecat-shared/compare/@adobe/mysticat-shared-seo-client-v1.2.2...@adobe/mysticat-shared-seo-client-v1.2.3) (2026-04-15)
|
|
2
8
|
|
|
3
9
|
### Bug Fixes
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -340,6 +340,23 @@ export default class SeoClient {
|
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
+
/**
|
|
344
|
+
* Fetch paid (PPC) pages and their keyword data from Semrush.
|
|
345
|
+
*
|
|
346
|
+
* Per-keyword CPC is returned as float dollars (e.g., 3.95) with null for unknown.
|
|
347
|
+
* This deliberately differs from getOrganicKeywords() which returns CPC as integer
|
|
348
|
+
* cents (e.g., 395) with 0 for unknown. The float-dollars convention was chosen for
|
|
349
|
+
* the keywords[] array because downstream consumers (import-worker, Mystique) expect
|
|
350
|
+
* dollars and the per-keyword CPC should not go through the cents round-trip used by
|
|
351
|
+
* the aggregate `value` field.
|
|
352
|
+
*
|
|
353
|
+
* @param {string} url - Domain to query
|
|
354
|
+
* @param {Object} [opts] - Options
|
|
355
|
+
* @param {string} [opts.date] - Report date
|
|
356
|
+
* @param {number} [opts.limit=200] - Max pages to return
|
|
357
|
+
* @param {string} [opts.region] - Limit to specific region
|
|
358
|
+
* @returns {Promise<{result: {pages: Array}, fullAuditRef: string}>}
|
|
359
|
+
*/
|
|
343
360
|
async getPaidPages(url, opts = {}) {
|
|
344
361
|
if (typeof opts !== 'object' || opts === null) {
|
|
345
362
|
throw new Error('Second argument must be an options object, not a positional value');
|
|
@@ -420,6 +437,15 @@ export default class SeoClient {
|
|
|
420
437
|
),
|
|
421
438
|
0,
|
|
422
439
|
),
|
|
440
|
+
keywords: page.keywords.map((kw) => ({
|
|
441
|
+
keyword: kw.Ph,
|
|
442
|
+
traffic: kw.kwTraffic,
|
|
443
|
+
cpc: coerceValue(kw.Cp, 'float') ?? null,
|
|
444
|
+
serp_title: kw.Tt || null,
|
|
445
|
+
position: coerceValue(kw.Po, 'int') ?? null,
|
|
446
|
+
volume: coerceValue(kw.Nq, 'int') ?? null,
|
|
447
|
+
country: kw.db.toUpperCase(),
|
|
448
|
+
})),
|
|
423
449
|
};
|
|
424
450
|
});
|
|
425
451
|
|