semrush-api-client 0.1.25 → 1.0.3
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/dist/backlinks/backlinksOverview.d.ts +4 -3
- package/dist/backlinks/backlinksOverview.js +5 -4
- package/dist/backlinks/getAnchors.d.ts +6 -4
- package/dist/backlinks/getAnchors.js +7 -5
- package/dist/backlinks/getBacklinks.d.ts +7 -4
- package/dist/backlinks/getBacklinks.js +8 -5
- package/dist/backlinks/getIndexedPages.d.ts +6 -4
- package/dist/backlinks/getIndexedPages.js +7 -5
- package/dist/backlinks/getReferringDomains.d.ts +7 -4
- package/dist/backlinks/getReferringDomains.js +8 -5
- package/dist/domain/getAdsCopies.d.ts +10 -3
- package/dist/domain/getAdsCopies.js +13 -3
- package/dist/domain/getDomainOrganicSearchKeywords.d.ts +12 -5
- package/dist/domain/getDomainOrganicSearchKeywords.js +14 -4
- package/dist/domain/getDomainOverview.d.ts +8 -4
- package/dist/domain/getDomainOverview.js +12 -5
- package/dist/domain/getDomainPaidSearchKeywords.d.ts +11 -4
- package/dist/domain/getDomainPaidSearchKeywords.js +14 -4
- package/dist/domain/getDomainRank.d.ts +9 -0
- package/dist/domain/getDomainRank.js +13 -0
- package/dist/keyword/getBroadMatchKeywords.d.ts +7 -3
- package/dist/keyword/getBroadMatchKeywords.js +7 -3
- package/dist/keyword/getKeywordDifficulty.d.ts +4 -2
- package/dist/keyword/getKeywordDifficulty.js +4 -3
- package/dist/keyword/getKeywordOrganic.d.ts +9 -4
- package/dist/keyword/getKeywordOrganic.js +8 -4
- package/dist/keyword/getKeywordOverview.d.ts +5 -2
- package/dist/keyword/getKeywordOverview.js +9 -3
- package/dist/keyword/getPhrase.d.ts +9 -0
- package/dist/keyword/getPhrase.js +12 -0
- package/dist/keyword/getPhraseQuestions.d.ts +7 -3
- package/dist/keyword/getPhraseQuestions.js +7 -3
- package/dist/keyword/getRelatedKeywords.d.ts +7 -3
- package/dist/keyword/getRelatedKeywords.js +8 -4
- package/dist/overview/getRankDifference.d.ts +9 -3
- package/dist/overview/getRankDifference.js +13 -4
- package/dist/overview/getSemrushRank.d.ts +8 -3
- package/dist/overview/getSemrushRank.js +12 -3
- package/dist/trend/getTrafficSummary.d.ts +5 -2
- package/dist/trend/getTrafficSummary.js +10 -4
- package/dist/url/getUrlOrganicSearchKeywords.d.ts +9 -4
- package/dist/url/getUrlOrganicSearchKeywords.js +14 -5
- package/dist/url/getUrlOverview.d.ts +6 -5
- package/dist/url/getUrlOverview.js +11 -6
- package/dist/url/getUrlPaidSearchKeywords.d.ts +9 -4
- package/dist/url/getUrlPaidSearchKeywords.js +14 -5
- package/dist/utils/displayDateValidator.d.ts +1 -0
- package/dist/utils/displayDateValidator.js +9 -0
- package/package.json +4 -3
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SemrushAPIClient } from "../client";
|
|
2
2
|
export type BacklinksTargetType = "root_domain" | "domain" | "url";
|
|
3
3
|
export type BacklinkstExportColumns = "ascore" | "total" | "domains_num" | "urls_num" | "ips_num" | "ipclassc_num" | "follows_num" | "nofollows_num" | "sponsored_num" | "ugc_num" | "texts_num" | "images_num" | "forms_num" | "frames_num";
|
|
4
|
-
export declare function getBacklinksOverview(this: SemrushAPIClient, { target,
|
|
4
|
+
export declare function getBacklinksOverview(this: SemrushAPIClient, { target, targetType, exportColumns, exportEscape, outputObj, }: {
|
|
5
5
|
target: string;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
targetType?: BacklinksTargetType;
|
|
7
|
+
exportColumns?: BacklinkstExportColumns[];
|
|
8
|
+
exportEscape?: 1;
|
|
8
9
|
outputObj?: boolean;
|
|
9
10
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBacklinksOverview = getBacklinksOverview;
|
|
4
|
-
async function getBacklinksOverview({ target,
|
|
4
|
+
async function getBacklinksOverview({ target, targetType = "domain", exportColumns = [
|
|
5
5
|
"ascore",
|
|
6
6
|
"total",
|
|
7
7
|
"domains_num",
|
|
@@ -16,12 +16,13 @@ async function getBacklinksOverview({ target, target_type = "domain", export_col
|
|
|
16
16
|
"images_num",
|
|
17
17
|
"forms_num",
|
|
18
18
|
"frames_num",
|
|
19
|
-
], outputObj = true, }) {
|
|
19
|
+
], exportEscape, outputObj = true, }) {
|
|
20
20
|
const params = {
|
|
21
21
|
type: "backlinks_overview",
|
|
22
22
|
target,
|
|
23
|
-
target_type,
|
|
24
|
-
export_columns:
|
|
23
|
+
target_type: targetType,
|
|
24
|
+
export_columns: exportColumns.join(","),
|
|
25
|
+
export_escape: exportEscape,
|
|
25
26
|
};
|
|
26
27
|
return this.get(this.ANALYTICS_URL + "v1/", params, outputObj);
|
|
27
28
|
}
|
|
@@ -2,11 +2,13 @@ import { SemrushAPIClient } from "../client";
|
|
|
2
2
|
export type AnchorsTargetType = "root_domain" | "domain" | "url";
|
|
3
3
|
export type AnchorsExportColumns = "anchor" | "domains_num" | "backlinks_num" | "first_seen" | "last_seen";
|
|
4
4
|
export type DisplaySort = "page_ascore_asc" | "page_ascore_desc" | "domains_num_asc" | "domains_num_desc" | "backlinks_num_asc" | "backlinks_num_desc" | "first_seen_asc" | "first_seen_desc" | "last_seen_asc" | "last_seen_desc";
|
|
5
|
-
export declare function getAnchors(this: SemrushAPIClient, { target,
|
|
5
|
+
export declare function getAnchors(this: SemrushAPIClient, { target, targetType, exportColumns, displaySort, displayLimit, displayOffset, exportEscape, outputObj, }: {
|
|
6
6
|
target: string;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
targetType?: AnchorsTargetType;
|
|
8
|
+
exportColumns?: AnchorsExportColumns[];
|
|
9
9
|
displaySort?: DisplaySort;
|
|
10
|
+
displayLimit?: number;
|
|
11
|
+
displayOffset?: number;
|
|
12
|
+
exportEscape?: 1;
|
|
10
13
|
outputObj?: boolean;
|
|
11
|
-
display_limit?: number;
|
|
12
14
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAnchors = getAnchors;
|
|
4
|
-
async function getAnchors({ target,
|
|
4
|
+
async function getAnchors({ target, targetType = "domain", exportColumns = [
|
|
5
5
|
"anchor",
|
|
6
6
|
"domains_num",
|
|
7
7
|
"backlinks_num",
|
|
8
8
|
"first_seen",
|
|
9
9
|
"last_seen",
|
|
10
|
-
], displaySort = "backlinks_num_desc",
|
|
10
|
+
], displaySort = "backlinks_num_desc", displayLimit = 10, displayOffset, exportEscape, outputObj = true, }) {
|
|
11
11
|
const params = {
|
|
12
12
|
type: "backlinks_anchors",
|
|
13
13
|
target,
|
|
14
|
-
target_type,
|
|
14
|
+
target_type: targetType,
|
|
15
15
|
display_sort: displaySort,
|
|
16
|
-
display_limit,
|
|
17
|
-
|
|
16
|
+
display_limit: displayLimit,
|
|
17
|
+
display_offset: displayOffset,
|
|
18
|
+
export_escape: exportEscape,
|
|
19
|
+
export_columns: exportColumns.join(","),
|
|
18
20
|
};
|
|
19
21
|
return this.get(this.ANALYTICS_URL + "v1/", params, outputObj);
|
|
20
22
|
}
|
|
@@ -2,11 +2,14 @@ import { SemrushAPIClient } from "../client";
|
|
|
2
2
|
export type BacklinksTargetType = "root_domain" | "domain" | "url";
|
|
3
3
|
export type BacklinkstExportColumns = "page_ascore" | "response_code" | "source_size" | "external_num" | "internal_num" | "redirect_url" | "source_url" | "source_title" | "image_url" | "target_url" | "target_title" | "anchor" | "image_alt" | "last_seen" | "first_seen" | "nofollow" | "form" | "frame" | "image" | "sitewide" | "newlink" | "lostlink";
|
|
4
4
|
export type DisplaySort = "page_ascore_asc" | "page_ascore_desc" | "last_seen_asc" | "last_seen_desc" | "first_seen_asc" | "first_seen_desc";
|
|
5
|
-
export declare function getBacklinks(this: SemrushAPIClient, { target,
|
|
5
|
+
export declare function getBacklinks(this: SemrushAPIClient, { target, targetType, exportColumns, displaySort, displayLimit, displayOffset, displayFilter, exportEscape, outputObj, }: {
|
|
6
6
|
target: string;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
targetType?: BacklinksTargetType;
|
|
8
|
+
exportColumns?: BacklinkstExportColumns[];
|
|
9
9
|
displaySort?: DisplaySort;
|
|
10
|
+
displayLimit?: number;
|
|
11
|
+
displayOffset?: number;
|
|
12
|
+
displayFilter?: string;
|
|
13
|
+
exportEscape?: 1;
|
|
10
14
|
outputObj?: boolean;
|
|
11
|
-
display_limit?: number;
|
|
12
15
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBacklinks = getBacklinks;
|
|
4
|
-
async function getBacklinks({ target,
|
|
4
|
+
async function getBacklinks({ target, targetType = "domain", exportColumns = [
|
|
5
5
|
"page_ascore",
|
|
6
6
|
"response_code",
|
|
7
7
|
"source_size",
|
|
@@ -24,14 +24,17 @@ async function getBacklinks({ target, target_type = "domain", export_columns = [
|
|
|
24
24
|
"sitewide",
|
|
25
25
|
"newlink",
|
|
26
26
|
"lostlink",
|
|
27
|
-
], displaySort = "page_ascore_desc",
|
|
27
|
+
], displaySort = "page_ascore_desc", displayLimit = 10, displayOffset, displayFilter, exportEscape, outputObj = true, }) {
|
|
28
28
|
const params = {
|
|
29
29
|
type: "backlinks",
|
|
30
30
|
target,
|
|
31
|
-
target_type,
|
|
31
|
+
target_type: targetType,
|
|
32
32
|
display_sort: displaySort,
|
|
33
|
-
display_limit,
|
|
34
|
-
|
|
33
|
+
display_limit: displayLimit,
|
|
34
|
+
display_offset: displayOffset,
|
|
35
|
+
display_filter: displayFilter,
|
|
36
|
+
export_escape: exportEscape,
|
|
37
|
+
export_columns: exportColumns.join(","),
|
|
35
38
|
};
|
|
36
39
|
return this.get(this.ANALYTICS_URL + "v1/", params, outputObj);
|
|
37
40
|
}
|
|
@@ -2,11 +2,13 @@ import { SemrushAPIClient } from "../client";
|
|
|
2
2
|
export type IndexedPageTargetType = "root_domain" | "domain" | "url";
|
|
3
3
|
export type ExportColumns = "source_url" | "source_title" | "response_code" | "backlinks_num" | "domains_num" | "last_seen" | "external_num" | "internal_num";
|
|
4
4
|
export type DisplaySort = "backlinks_num_asc" | "backlinks_num_desc" | "domains_num_asc" | "domains_num_desc" | "last_seen_asc" | "last_seen_desc";
|
|
5
|
-
export declare function getIndexedPages(this: SemrushAPIClient, { target,
|
|
5
|
+
export declare function getIndexedPages(this: SemrushAPIClient, { target, targetType, exportColumns, displaySort, displayLimit, displayOffset, exportEscape, outputObj, }: {
|
|
6
6
|
target: string;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
targetType?: IndexedPageTargetType;
|
|
8
|
+
exportColumns?: ExportColumns[];
|
|
9
9
|
displaySort?: DisplaySort;
|
|
10
|
+
displayLimit?: number;
|
|
11
|
+
displayOffset?: number;
|
|
12
|
+
exportEscape?: 1;
|
|
10
13
|
outputObj?: boolean;
|
|
11
|
-
display_limit?: number;
|
|
12
14
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getIndexedPages = getIndexedPages;
|
|
4
|
-
async function getIndexedPages({ target,
|
|
4
|
+
async function getIndexedPages({ target, targetType = "domain", exportColumns = [
|
|
5
5
|
"source_url",
|
|
6
6
|
"source_title",
|
|
7
7
|
"response_code",
|
|
@@ -10,14 +10,16 @@ async function getIndexedPages({ target, target_type = "domain", export_columns
|
|
|
10
10
|
"last_seen",
|
|
11
11
|
"external_num",
|
|
12
12
|
"internal_num",
|
|
13
|
-
], displaySort = "backlinks_num_desc",
|
|
13
|
+
], displaySort = "backlinks_num_desc", displayLimit = 10, displayOffset, exportEscape, outputObj = true, }) {
|
|
14
14
|
const params = {
|
|
15
15
|
type: "backlinks_pages",
|
|
16
16
|
target,
|
|
17
|
-
target_type,
|
|
17
|
+
target_type: targetType,
|
|
18
18
|
display_sort: displaySort,
|
|
19
|
-
display_limit,
|
|
20
|
-
|
|
19
|
+
display_limit: displayLimit,
|
|
20
|
+
display_offset: displayOffset,
|
|
21
|
+
export_escape: exportEscape,
|
|
22
|
+
export_columns: exportColumns.join(","),
|
|
21
23
|
};
|
|
22
24
|
return this.get(this.ANALYTICS_URL + "v1/", params, outputObj);
|
|
23
25
|
}
|
|
@@ -2,11 +2,14 @@ import { SemrushAPIClient } from "../client";
|
|
|
2
2
|
export type TargetType = "root_domain" | "domain" | "url";
|
|
3
3
|
export type ExportColumns = "domain_ascore" | "domain_score" | "domain" | "backlinks_num" | "domain_trust_score" | "ip" | "country" | "first_seen" | "last_seen";
|
|
4
4
|
export type DisplaySort = "domain_ascore_asc" | "domain_ascore_desc" | "backlinks_num_asc" | "backlinks_num_desc" | "last_seen_asc" | "last_seen_desc" | "first_seen_asc" | "first_seen_desc";
|
|
5
|
-
export declare function getReferringDomains(this: SemrushAPIClient, { target,
|
|
5
|
+
export declare function getReferringDomains(this: SemrushAPIClient, { target, targetType, exportColumns, displaySort, displayLimit, displayOffset, displayFilter, exportEscape, outputObj, }: {
|
|
6
6
|
target: string;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
targetType?: TargetType;
|
|
8
|
+
exportColumns?: ExportColumns[];
|
|
9
9
|
displaySort?: DisplaySort;
|
|
10
|
+
displayLimit?: number;
|
|
11
|
+
displayOffset?: number;
|
|
12
|
+
displayFilter?: string;
|
|
13
|
+
exportEscape?: 1;
|
|
10
14
|
outputObj?: boolean;
|
|
11
|
-
display_limit?: number;
|
|
12
15
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getReferringDomains = getReferringDomains;
|
|
4
|
-
async function getReferringDomains({ target,
|
|
4
|
+
async function getReferringDomains({ target, targetType = "domain", exportColumns = [
|
|
5
5
|
"domain_ascore",
|
|
6
6
|
"domain_score",
|
|
7
7
|
"domain",
|
|
@@ -11,14 +11,17 @@ async function getReferringDomains({ target, target_type = "domain", export_colu
|
|
|
11
11
|
"country",
|
|
12
12
|
"first_seen",
|
|
13
13
|
"last_seen",
|
|
14
|
-
], displaySort = "backlinks_num_desc",
|
|
14
|
+
], displaySort = "backlinks_num_desc", displayLimit = 10, displayOffset, displayFilter, exportEscape, outputObj = true, }) {
|
|
15
15
|
const params = {
|
|
16
16
|
type: "backlinks_refdomains",
|
|
17
17
|
target,
|
|
18
|
-
target_type,
|
|
18
|
+
target_type: targetType,
|
|
19
19
|
display_sort: displaySort,
|
|
20
|
-
display_limit,
|
|
21
|
-
|
|
20
|
+
display_limit: displayLimit,
|
|
21
|
+
display_offset: displayOffset,
|
|
22
|
+
display_filter: displayFilter,
|
|
23
|
+
export_escape: exportEscape,
|
|
24
|
+
export_columns: exportColumns.join(","),
|
|
22
25
|
};
|
|
23
26
|
return this.get(this.ANALYTICS_URL + "v1/", params, outputObj);
|
|
24
27
|
}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { SemrushAPIClient } from "../client";
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
type ExportColumns = "Tt" | "Ds" | "Vu" | "Ur" | "Pc" | "Un";
|
|
4
|
-
export
|
|
4
|
+
export type AdsCopiesDisplaySort = "tr_asc" | "tr_desc" | "tc_asc" | "tc_desc";
|
|
5
|
+
export declare function getAdsCopies(this: SemrushAPIClient, { domain, exportColumns, database, displayLimit, displayOffset, displaySort, displayFilter, displayDate, exportEscape, exportDecode, outputObj, }: {
|
|
5
6
|
domain: string;
|
|
6
|
-
|
|
7
|
+
exportColumns?: ExportColumns[];
|
|
7
8
|
database?: Database;
|
|
9
|
+
displayLimit?: number;
|
|
10
|
+
displayOffset?: number;
|
|
11
|
+
displaySort?: AdsCopiesDisplaySort;
|
|
12
|
+
displayFilter?: string;
|
|
13
|
+
displayDate?: string;
|
|
14
|
+
exportEscape?: 1;
|
|
15
|
+
exportDecode?: 0 | 1;
|
|
8
16
|
outputObj?: boolean;
|
|
9
|
-
display_limit?: number;
|
|
10
17
|
}): Promise<Record<string, string>[]>;
|
|
11
18
|
export {};
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAdsCopies = getAdsCopies;
|
|
4
|
-
|
|
4
|
+
const displayDateValidator_1 = require("../utils/displayDateValidator");
|
|
5
|
+
async function getAdsCopies({ domain, exportColumns = ["Tt", "Ds", "Vu", "Ur", "Pc", "Un"], database = "us", displayLimit = 10, displayOffset, displaySort, displayFilter, displayDate, exportEscape, exportDecode, outputObj = true, }) {
|
|
6
|
+
if (displayDate && !(0, displayDateValidator_1.displayDateValidator)(displayDate)) {
|
|
7
|
+
throw new Error("Invalid displayDate format. Format: YYYYMM15");
|
|
8
|
+
}
|
|
5
9
|
const params = {
|
|
6
10
|
type: "domain_adwords_unique",
|
|
7
|
-
export_columns:
|
|
11
|
+
export_columns: exportColumns.join(","),
|
|
8
12
|
domain,
|
|
9
13
|
database,
|
|
10
|
-
display_limit,
|
|
14
|
+
display_limit: displayLimit,
|
|
15
|
+
display_offset: displayOffset,
|
|
16
|
+
display_sort: displaySort,
|
|
17
|
+
display_filter: displayFilter,
|
|
18
|
+
display_date: displayDate,
|
|
19
|
+
export_escape: exportEscape,
|
|
20
|
+
export_decode: exportDecode,
|
|
11
21
|
};
|
|
12
22
|
return this.get(this.BASE_URL, params, outputObj);
|
|
13
23
|
}
|
|
@@ -3,13 +3,20 @@ import { Database } from "../type/general/database";
|
|
|
3
3
|
type ExportColumns = "Ph" | "Po" | "Pp" | "Pd" | "Nq" | "Cp" | "Ur" | "Tr" | "Tg" | "Tc" | "Co" | "Nr" | "Td" | "Kd" | "Fp" | "Fk" | "Ts" | "In" | "Pt";
|
|
4
4
|
type displayPositions = "new" | "lost" | "rise" | "fall";
|
|
5
5
|
type displayPositionType = "organic" | "all" | "serp_features";
|
|
6
|
-
export
|
|
6
|
+
export type DomainOrganicDisplaySort = "po_asc" | "po_desc" | "tr_asc" | "tr_desc" | "tc_asc" | "tc_desc" | "nq_asc" | "nq_desc" | "cp_asc" | "cp_desc" | "co_asc" | "co_desc" | "kd_asc" | "kd_desc";
|
|
7
|
+
export declare function getDomainOrganicSearchKeywords(this: SemrushAPIClient, { domain, exportColumns, database, displayPosition, displayPositionsType, displayLimit, displayOffset, displaySort, displayFilter, displayDate, exportEscape, exportDecode, outputObj, }: {
|
|
7
8
|
domain: string;
|
|
8
|
-
|
|
9
|
-
displayPosition?: displayPositions;
|
|
9
|
+
exportColumns?: ExportColumns[];
|
|
10
10
|
database?: Database;
|
|
11
|
-
|
|
11
|
+
displayPosition?: displayPositions;
|
|
12
12
|
displayPositionsType?: displayPositionType;
|
|
13
|
-
|
|
13
|
+
displayLimit?: number;
|
|
14
|
+
displayOffset?: number;
|
|
15
|
+
displaySort?: DomainOrganicDisplaySort;
|
|
16
|
+
displayFilter?: string;
|
|
17
|
+
displayDate?: string;
|
|
18
|
+
exportEscape?: 1;
|
|
19
|
+
exportDecode?: 0 | 1;
|
|
20
|
+
outputObj?: boolean;
|
|
14
21
|
}): Promise<Record<string, string>[]>;
|
|
15
22
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDomainOrganicSearchKeywords = getDomainOrganicSearchKeywords;
|
|
4
|
-
|
|
4
|
+
const displayDateValidator_1 = require("../utils/displayDateValidator");
|
|
5
|
+
async function getDomainOrganicSearchKeywords({ domain, exportColumns = [
|
|
5
6
|
"Ph",
|
|
6
7
|
"Po",
|
|
7
8
|
"Pp",
|
|
@@ -14,15 +15,24 @@ async function getDomainOrganicSearchKeywords({ domain, export_columns = [
|
|
|
14
15
|
"Co",
|
|
15
16
|
"Nr",
|
|
16
17
|
"Td",
|
|
17
|
-
], database = "us", displayPosition, displayPositionsType,
|
|
18
|
+
], database = "us", displayPosition, displayPositionsType, displayLimit = 10, displayOffset, displaySort, displayFilter, displayDate, exportEscape, exportDecode, outputObj = true, }) {
|
|
19
|
+
if (displayDate && !(0, displayDateValidator_1.displayDateValidator)(displayDate)) {
|
|
20
|
+
throw new Error("Invalid displayDate format. Format: YYYYMM15");
|
|
21
|
+
}
|
|
18
22
|
const params = {
|
|
19
23
|
type: "domain_organic",
|
|
20
|
-
export_columns:
|
|
24
|
+
export_columns: exportColumns.join(","),
|
|
21
25
|
domain,
|
|
22
26
|
database,
|
|
23
27
|
display_position: displayPosition,
|
|
24
28
|
display_positions_type: displayPositionsType,
|
|
25
|
-
display_limit,
|
|
29
|
+
display_limit: displayLimit,
|
|
30
|
+
display_offset: displayOffset,
|
|
31
|
+
display_sort: displaySort,
|
|
32
|
+
display_filter: displayFilter,
|
|
33
|
+
display_date: displayDate,
|
|
34
|
+
export_escape: exportEscape,
|
|
35
|
+
export_decode: exportDecode,
|
|
26
36
|
};
|
|
27
37
|
return this.get(this.BASE_URL, params, outputObj);
|
|
28
38
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { SemrushAPIClient } from "../client";
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
import { ExportColumns } from "../type/general/exportColumns";
|
|
4
|
-
export
|
|
4
|
+
export type DomainOverviewDisplaySort = "rk_asc" | "rk_desc" | "or_asc" | "or_desc" | "ot_asc" | "ot_desc" | "oc_asc" | "oc_desc" | "ad_asc" | "ad_desc" | "at_asc" | "at_desc" | "ac_asc" | "ac_desc";
|
|
5
|
+
export declare function getDomainOverview(this: SemrushAPIClient, { domain, exportColumns, database, displayDate, displayLimit, displayOffset, displaySort, exportEscape, outputObj, }: {
|
|
5
6
|
domain: string;
|
|
6
|
-
|
|
7
|
+
exportColumns?: ExportColumns[];
|
|
7
8
|
database?: Database;
|
|
8
|
-
display_limit?: number;
|
|
9
|
-
outputObj?: boolean;
|
|
10
9
|
displayDate?: string;
|
|
10
|
+
displayLimit?: number;
|
|
11
|
+
displayOffset?: number;
|
|
12
|
+
displaySort?: DomainOverviewDisplaySort;
|
|
13
|
+
exportEscape?: 1;
|
|
14
|
+
outputObj?: boolean;
|
|
11
15
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDomainOverview = getDomainOverview;
|
|
4
|
-
|
|
4
|
+
const displayDateValidator_1 = require("../utils/displayDateValidator");
|
|
5
|
+
async function getDomainOverview({ domain, exportColumns = [
|
|
5
6
|
"Db",
|
|
6
7
|
"Dt",
|
|
7
8
|
"Dn",
|
|
@@ -23,14 +24,20 @@ async function getDomainOverview({ domain, export_columns = [
|
|
|
23
24
|
"Sc",
|
|
24
25
|
"Srn",
|
|
25
26
|
"Srl",
|
|
26
|
-
], database = "us", displayDate,
|
|
27
|
+
], database = "us", displayDate, displayLimit = 10, displayOffset, displaySort, exportEscape, outputObj = true, }) {
|
|
28
|
+
if (displayDate && !(0, displayDateValidator_1.displayDateValidator)(displayDate)) {
|
|
29
|
+
throw new Error("Invalid displayDate format. Format: YYYYMM15");
|
|
30
|
+
}
|
|
27
31
|
const params = {
|
|
28
32
|
type: "domain_ranks",
|
|
29
|
-
export_columns:
|
|
33
|
+
export_columns: exportColumns.join(","),
|
|
30
34
|
domain,
|
|
31
35
|
database,
|
|
32
|
-
|
|
33
|
-
display_limit,
|
|
36
|
+
display_date: displayDate,
|
|
37
|
+
display_limit: displayLimit,
|
|
38
|
+
display_offset: displayOffset,
|
|
39
|
+
display_sort: displaySort,
|
|
40
|
+
export_escape: exportEscape,
|
|
34
41
|
};
|
|
35
42
|
return this.get(this.BASE_URL, params, outputObj);
|
|
36
43
|
}
|
|
@@ -2,12 +2,19 @@ import { SemrushAPIClient } from "../client";
|
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
type ExportColumns = "Ph" | "Po" | "Pp" | "Pd" | "Ab" | "Nq" | "Cp" | "Ur" | "Tr" | "Tg" | "Tc" | "Co" | "Nr" | "Td" | "Tt" | "Ds" | "Vu" | "Ur" | "Ts" | "Un";
|
|
4
4
|
type displayPositions = "new" | "lost" | "rise" | "fall";
|
|
5
|
-
export
|
|
5
|
+
export type DomainPaidDisplaySort = "po_asc" | "po_desc" | "tr_asc" | "tr_desc" | "tc_asc" | "tc_desc" | "nq_asc" | "nq_desc" | "cp_asc" | "cp_desc" | "co_asc" | "co_desc";
|
|
6
|
+
export declare function getDomainPaidSearchKeywords(this: SemrushAPIClient, { domain, exportColumns, database, displayPosition, displayLimit, displayOffset, displaySort, displayFilter, displayDate, exportEscape, exportDecode, outputObj, }: {
|
|
6
7
|
domain: string;
|
|
7
|
-
|
|
8
|
-
displayPosition?: displayPositions;
|
|
8
|
+
exportColumns?: ExportColumns[];
|
|
9
9
|
database?: Database;
|
|
10
|
+
displayPosition?: displayPositions;
|
|
11
|
+
displayLimit?: number;
|
|
12
|
+
displayOffset?: number;
|
|
13
|
+
displaySort?: DomainPaidDisplaySort;
|
|
14
|
+
displayFilter?: string;
|
|
15
|
+
displayDate?: string;
|
|
16
|
+
exportEscape?: 1;
|
|
17
|
+
exportDecode?: 0 | 1;
|
|
10
18
|
outputObj?: boolean;
|
|
11
|
-
display_limit?: number;
|
|
12
19
|
}): Promise<Record<string, string>[]>;
|
|
13
20
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDomainPaidSearchKeywords = getDomainPaidSearchKeywords;
|
|
4
|
-
|
|
4
|
+
const displayDateValidator_1 = require("../utils/displayDateValidator");
|
|
5
|
+
async function getDomainPaidSearchKeywords({ domain, exportColumns = [
|
|
5
6
|
"Ph",
|
|
6
7
|
"Po",
|
|
7
8
|
"Pp",
|
|
@@ -14,14 +15,23 @@ async function getDomainPaidSearchKeywords({ domain, export_columns = [
|
|
|
14
15
|
"Co",
|
|
15
16
|
"Nr",
|
|
16
17
|
"Td",
|
|
17
|
-
], database = "us", displayPosition,
|
|
18
|
+
], database = "us", displayPosition, displayLimit = 1000, displayOffset, displaySort, displayFilter, displayDate, exportEscape, exportDecode, outputObj = true, }) {
|
|
19
|
+
if (displayDate && !(0, displayDateValidator_1.displayDateValidator)(displayDate)) {
|
|
20
|
+
throw new Error("Invalid displayDate format. Format: YYYYMM15");
|
|
21
|
+
}
|
|
18
22
|
const params = {
|
|
19
23
|
type: "domain_adwords",
|
|
20
|
-
export_columns:
|
|
24
|
+
export_columns: exportColumns.join(","),
|
|
21
25
|
domain,
|
|
22
26
|
database,
|
|
23
27
|
display_position: displayPosition,
|
|
24
|
-
display_limit,
|
|
28
|
+
display_limit: displayLimit,
|
|
29
|
+
display_offset: displayOffset,
|
|
30
|
+
display_sort: displaySort,
|
|
31
|
+
display_filter: displayFilter,
|
|
32
|
+
display_date: displayDate,
|
|
33
|
+
export_escape: exportEscape,
|
|
34
|
+
export_decode: exportDecode,
|
|
25
35
|
};
|
|
26
36
|
return this.get(this.BASE_URL, params, outputObj);
|
|
27
37
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
import { Database } from "../type/general/database";
|
|
3
|
+
import { ExportColumns } from "../type/general/exportColumns";
|
|
4
|
+
export declare function getDomainRank(this: SemrushAPIClient, { domain, export_columns, database, display_limit, }: {
|
|
5
|
+
domain: string;
|
|
6
|
+
export_columns?: ExportColumns[];
|
|
7
|
+
database?: Database;
|
|
8
|
+
display_limit?: number;
|
|
9
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDomainRank = getDomainRank;
|
|
4
|
+
async function getDomainRank({ domain, export_columns = ["Dn", "Or", "Rk", "Ot", "Oc"], database = "us", display_limit = 1000, }) {
|
|
5
|
+
const params = {
|
|
6
|
+
type: "domain_ranks",
|
|
7
|
+
export_columns: export_columns.join(","),
|
|
8
|
+
domain,
|
|
9
|
+
database,
|
|
10
|
+
display_limit,
|
|
11
|
+
};
|
|
12
|
+
return this.get("", params);
|
|
13
|
+
}
|
|
@@ -2,11 +2,15 @@ import { SemrushAPIClient } from "../client";
|
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
export type ExportColumns = "Ph" | "Nq" | "Cp" | "Co" | "Nr" | "Td" | "Fk" | "In" | "Kd";
|
|
4
4
|
export type DisplaySort = "nq_asc" | "nq_desc" | "cp_asc" | "cp_desc" | "co_asc" | "co_desc" | "nr_asc" | "nr_desc" | "kd_asc" | "kd_desc";
|
|
5
|
-
export declare function getBroadMatchKeywords(this: SemrushAPIClient, { phrase,
|
|
5
|
+
export declare function getBroadMatchKeywords(this: SemrushAPIClient, { phrase, exportColumns, database, displaySort, displayLimit, displayOffset, displayFilter, exportEscape, exportDecode, outputObj, }: {
|
|
6
6
|
phrase: string;
|
|
7
7
|
database?: Database;
|
|
8
|
-
|
|
8
|
+
exportColumns?: ExportColumns[];
|
|
9
9
|
displaySort?: DisplaySort;
|
|
10
|
+
displayLimit?: number;
|
|
11
|
+
displayOffset?: number;
|
|
12
|
+
displayFilter?: string;
|
|
13
|
+
exportEscape?: 1;
|
|
14
|
+
exportDecode?: 0 | 1;
|
|
10
15
|
outputObj?: boolean;
|
|
11
|
-
display_limit?: number;
|
|
12
16
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBroadMatchKeywords = getBroadMatchKeywords;
|
|
4
|
-
async function getBroadMatchKeywords({ phrase,
|
|
4
|
+
async function getBroadMatchKeywords({ phrase, exportColumns = ["Ph", "Nq", "Cp", "Co", "Nr", "Td", "In", "Kd"], database = "us", displaySort = "nq_desc", displayLimit = 10, displayOffset, displayFilter, exportEscape, exportDecode, outputObj = true, }) {
|
|
5
5
|
const params = {
|
|
6
6
|
type: "phrase_fullsearch",
|
|
7
7
|
phrase,
|
|
8
8
|
database,
|
|
9
9
|
display_sort: displaySort,
|
|
10
|
-
display_limit,
|
|
11
|
-
|
|
10
|
+
display_limit: displayLimit,
|
|
11
|
+
display_offset: displayOffset,
|
|
12
|
+
display_filter: displayFilter,
|
|
13
|
+
export_escape: exportEscape,
|
|
14
|
+
export_decode: exportDecode,
|
|
15
|
+
export_columns: exportColumns.join(","),
|
|
12
16
|
};
|
|
13
17
|
return this.get(this.ANALYTICS_URL, params, outputObj);
|
|
14
18
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { SemrushAPIClient } from "../client";
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
type ExportColumns = "Ph" | "Kd";
|
|
4
|
-
export declare function getKeywordDifficulty(this: SemrushAPIClient, { phrases,
|
|
4
|
+
export declare function getKeywordDifficulty(this: SemrushAPIClient, { phrases, exportColumns, database, exportEscape, exportDecode, outputObj, }: {
|
|
5
5
|
phrases: string[];
|
|
6
|
-
|
|
6
|
+
exportColumns?: ExportColumns[];
|
|
7
7
|
database?: Database;
|
|
8
|
+
exportEscape?: 1;
|
|
9
|
+
exportDecode?: 0 | 1;
|
|
8
10
|
outputObj?: boolean;
|
|
9
11
|
}): Promise<Record<string, string>[]>;
|
|
10
12
|
export {};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getKeywordDifficulty = getKeywordDifficulty;
|
|
4
|
-
async function getKeywordDifficulty({ phrases,
|
|
5
|
-
}) {
|
|
4
|
+
async function getKeywordDifficulty({ phrases, exportColumns = ["Ph", "Kd"], database = "us", exportEscape, exportDecode, outputObj = true, }) {
|
|
6
5
|
const params = {
|
|
7
6
|
type: "phrase_kdi",
|
|
8
|
-
export_columns:
|
|
7
|
+
export_columns: exportColumns.join(","),
|
|
9
8
|
phrase: phrases.join(";"),
|
|
10
9
|
database,
|
|
10
|
+
export_escape: exportEscape,
|
|
11
|
+
export_decode: exportDecode,
|
|
11
12
|
};
|
|
12
13
|
return this.get(this.BASE_URL, params, outputObj);
|
|
13
14
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { SemrushAPIClient } from "../client";
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
type KeywordExportColumns = "Po" | "Pt" | "Dn" | "Ur" | "Fk" | "Fp" | "Fl";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
display_limit?: number;
|
|
4
|
+
export type KeywordOrganicDisplaySort = "po_asc" | "po_desc" | "tr_asc" | "tr_desc";
|
|
5
|
+
export declare function getKeywordOrganic(this: SemrushAPIClient, { phrase, exportColumns, database, displayLimit, displayOffset, displaySort, displayFilter, exportEscape, exportDecode, outputObj, }: {
|
|
7
6
|
phrase: string;
|
|
8
|
-
|
|
7
|
+
exportColumns?: KeywordExportColumns[];
|
|
9
8
|
database?: Database;
|
|
9
|
+
displayLimit?: number;
|
|
10
|
+
displayOffset?: number;
|
|
11
|
+
displaySort?: KeywordOrganicDisplaySort;
|
|
12
|
+
displayFilter?: string;
|
|
13
|
+
exportEscape?: 1;
|
|
14
|
+
exportDecode?: 0 | 1;
|
|
10
15
|
outputObj?: boolean;
|
|
11
16
|
}): Promise<Record<string, string>[]>;
|
|
12
17
|
export {};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getKeywordOrganic = getKeywordOrganic;
|
|
4
|
-
async function getKeywordOrganic({ phrase,
|
|
5
|
-
display_limit = 10, }) {
|
|
4
|
+
async function getKeywordOrganic({ phrase, exportColumns = ["Po", "Pt", "Dn", "Ur", "Fk", "Fp", "Fl"], database = "us", displayLimit = 10, displayOffset, displaySort, displayFilter, exportEscape, exportDecode, outputObj = true, }) {
|
|
6
5
|
const params = {
|
|
7
6
|
type: "phrase_organic",
|
|
8
|
-
export_columns:
|
|
7
|
+
export_columns: exportColumns.join(","),
|
|
9
8
|
phrase,
|
|
10
9
|
database,
|
|
11
|
-
display_limit,
|
|
10
|
+
display_limit: displayLimit,
|
|
11
|
+
display_offset: displayOffset,
|
|
12
|
+
display_sort: displaySort,
|
|
13
|
+
display_filter: displayFilter,
|
|
14
|
+
export_escape: exportEscape,
|
|
15
|
+
export_decode: exportDecode,
|
|
12
16
|
};
|
|
13
17
|
return this.get(this.BASE_URL, params, outputObj);
|
|
14
18
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { SemrushAPIClient } from "../client";
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
type KeywordExportColumns = "Dt" | "Db" | "Ph" | "Nq" | "Cp" | "Co" | "Nr" | "In" | "Kd";
|
|
4
|
-
export declare function getKeywordOverview(this: SemrushAPIClient, { phrase,
|
|
4
|
+
export declare function getKeywordOverview(this: SemrushAPIClient, { phrase, exportColumns, database, displayDate, exportEscape, exportDecode, outputObj, }: {
|
|
5
5
|
phrase: string;
|
|
6
|
-
|
|
6
|
+
exportColumns?: KeywordExportColumns[];
|
|
7
7
|
database?: Database;
|
|
8
|
+
displayDate?: string;
|
|
9
|
+
exportEscape?: 1;
|
|
10
|
+
exportDecode?: 0 | 1;
|
|
8
11
|
outputObj?: boolean;
|
|
9
12
|
}): Promise<Record<string, string>[]>;
|
|
10
13
|
export {};
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getKeywordOverview = getKeywordOverview;
|
|
4
|
-
|
|
5
|
-
}) {
|
|
4
|
+
const displayDateValidator_1 = require("../utils/displayDateValidator");
|
|
5
|
+
async function getKeywordOverview({ phrase, exportColumns = ["Dt", "Db", "Ph", "Nq", "Cp", "Co", "Nr", "In", "Kd"], database = "us", displayDate, exportEscape, exportDecode, outputObj = true, }) {
|
|
6
|
+
if (displayDate && !(0, displayDateValidator_1.displayDateValidator)(displayDate)) {
|
|
7
|
+
throw new Error("Invalid displayDate format. Format: YYYYMM15");
|
|
8
|
+
}
|
|
6
9
|
const params = {
|
|
7
10
|
type: "phrase_all",
|
|
8
|
-
export_columns:
|
|
11
|
+
export_columns: exportColumns.join(","),
|
|
9
12
|
phrase,
|
|
10
13
|
database,
|
|
14
|
+
display_date: displayDate,
|
|
15
|
+
export_escape: exportEscape,
|
|
16
|
+
export_decode: exportDecode,
|
|
11
17
|
};
|
|
12
18
|
return this.get(this.BASE_URL, params, outputObj);
|
|
13
19
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
import { Database } from "../type/general/database";
|
|
3
|
+
type KeywordExportColumns = "Dt" | "Db" | "Ph" | "Nq" | "Cp" | "Co" | "Nr" | "In" | "Kd";
|
|
4
|
+
export declare function getPhraseAll(this: SemrushAPIClient, { phrase, export_columns, database, }: {
|
|
5
|
+
phrase: string;
|
|
6
|
+
export_columns?: KeywordExportColumns[];
|
|
7
|
+
database?: Database;
|
|
8
|
+
}): Promise<string>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPhraseAll = getPhraseAll;
|
|
4
|
+
async function getPhraseAll({ phrase, export_columns = ["Dt", "Db", "Ph", "Nq", "Cp", "Co", "Nr"], database = "us", }) {
|
|
5
|
+
const params = {
|
|
6
|
+
type: "phrase_all",
|
|
7
|
+
export_columns: export_columns.join(","),
|
|
8
|
+
phrase,
|
|
9
|
+
database,
|
|
10
|
+
};
|
|
11
|
+
return this.get("", params);
|
|
12
|
+
}
|
|
@@ -2,11 +2,15 @@ import { SemrushAPIClient } from "../client";
|
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
export type ExportColumns = "Ph" | "Nq" | "Cp" | "Co" | "Nr" | "Td" | "In" | "Kd";
|
|
4
4
|
export type DisplaySort = "nq_asc" | "nq_desc" | "cp_asc" | "cp_desc" | "co_asc" | "co_desc" | "nr_asc" | "nr_desc" | "kd_asc" | "kd_desc";
|
|
5
|
-
export declare function getPhraseQuestions(this: SemrushAPIClient, { phrase,
|
|
5
|
+
export declare function getPhraseQuestions(this: SemrushAPIClient, { phrase, exportColumns, database, displaySort, displayLimit, displayOffset, displayFilter, exportEscape, exportDecode, outputObj, }: {
|
|
6
6
|
phrase: string;
|
|
7
7
|
database?: Database;
|
|
8
|
-
|
|
8
|
+
exportColumns?: ExportColumns[];
|
|
9
9
|
displaySort?: DisplaySort;
|
|
10
|
+
displayLimit?: number;
|
|
11
|
+
displayOffset?: number;
|
|
12
|
+
displayFilter?: string;
|
|
13
|
+
exportEscape?: 1;
|
|
14
|
+
exportDecode?: 0 | 1;
|
|
10
15
|
outputObj?: boolean;
|
|
11
|
-
display_limit?: number;
|
|
12
16
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getPhraseQuestions = getPhraseQuestions;
|
|
4
|
-
async function getPhraseQuestions({ phrase,
|
|
4
|
+
async function getPhraseQuestions({ phrase, exportColumns = ["Ph", "Nq", "Cp", "Co", "Nr", "Td", "In", "Kd"], database = "us", displaySort = "nq_desc", displayLimit = 10, displayOffset, displayFilter, exportEscape, exportDecode, outputObj = true, }) {
|
|
5
5
|
const params = {
|
|
6
6
|
type: "phrase_questions",
|
|
7
7
|
phrase,
|
|
8
8
|
database,
|
|
9
9
|
display_sort: displaySort,
|
|
10
|
-
display_limit,
|
|
11
|
-
|
|
10
|
+
display_limit: displayLimit,
|
|
11
|
+
display_offset: displayOffset,
|
|
12
|
+
display_filter: displayFilter,
|
|
13
|
+
export_escape: exportEscape,
|
|
14
|
+
export_decode: exportDecode,
|
|
15
|
+
export_columns: exportColumns.join(","),
|
|
12
16
|
};
|
|
13
17
|
return this.get(this.ANALYTICS_URL, params, outputObj);
|
|
14
18
|
}
|
|
@@ -2,11 +2,15 @@ import { SemrushAPIClient } from "../client";
|
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
export type ExportColumns = "Ph" | "Nq" | "Cp" | "Co" | "Nr" | "Td" | "Rr" | "Fk" | "In" | "Kd";
|
|
4
4
|
export type DisplaySort = "nq_asc" | "nq_desc" | "cp_asc" | "cp_desc" | "co_asc" | "co_desc" | "nr_asc" | "nr_desc" | "rr_asc" | "rr_desc" | "kd_asc" | "kd_desc";
|
|
5
|
-
export declare function getRelatedKeywords(this: SemrushAPIClient, { phrase,
|
|
5
|
+
export declare function getRelatedKeywords(this: SemrushAPIClient, { phrase, exportColumns, database, displaySort, displayLimit, displayOffset, displayFilter, exportEscape, exportDecode, outputObj, }: {
|
|
6
6
|
phrase: string;
|
|
7
7
|
database?: Database;
|
|
8
|
-
|
|
8
|
+
exportColumns?: ExportColumns[];
|
|
9
9
|
displaySort?: DisplaySort;
|
|
10
|
+
displayLimit?: number;
|
|
11
|
+
displayOffset?: number;
|
|
12
|
+
displayFilter?: string;
|
|
13
|
+
exportEscape?: 1;
|
|
14
|
+
exportDecode?: 0 | 1;
|
|
10
15
|
outputObj?: boolean;
|
|
11
|
-
display_limit?: number;
|
|
12
16
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRelatedKeywords = getRelatedKeywords;
|
|
4
|
-
async function getRelatedKeywords({ phrase,
|
|
4
|
+
async function getRelatedKeywords({ phrase, exportColumns = [
|
|
5
5
|
"Ph",
|
|
6
6
|
"Nq",
|
|
7
7
|
"Cp",
|
|
@@ -12,14 +12,18 @@ async function getRelatedKeywords({ phrase, export_columns = [
|
|
|
12
12
|
"Fk",
|
|
13
13
|
"In",
|
|
14
14
|
"Kd",
|
|
15
|
-
], database = "us", displaySort = "nq_desc",
|
|
15
|
+
], database = "us", displaySort = "nq_desc", displayLimit = 10, displayOffset, displayFilter, exportEscape, exportDecode, outputObj = true, }) {
|
|
16
16
|
const params = {
|
|
17
17
|
type: "phrase_related",
|
|
18
18
|
phrase,
|
|
19
19
|
database,
|
|
20
20
|
display_sort: displaySort,
|
|
21
|
-
display_limit,
|
|
22
|
-
|
|
21
|
+
display_limit: displayLimit,
|
|
22
|
+
display_offset: displayOffset,
|
|
23
|
+
display_filter: displayFilter,
|
|
24
|
+
export_escape: exportEscape,
|
|
25
|
+
export_decode: exportDecode,
|
|
26
|
+
export_columns: exportColumns.join(","),
|
|
23
27
|
};
|
|
24
28
|
return this.get(this.ANALYTICS_URL, params, outputObj);
|
|
25
29
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { SemrushAPIClient } from "../client";
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
type ExportColumns = "Db" | "Dt" | "Dn" | "Rk" | "Or" | "Ot" | "Oc" | "Ad" | "At" | "Ac" | "Sh" | "Sv" | "FKn" | "FPn" | "Sr" | "Srb" | "St" | "Stb" | "Sc" | "Srn" | "Srl";
|
|
4
|
-
export
|
|
4
|
+
export type RankDifferenceDisplaySort = "rk_asc" | "rk_desc" | "or_asc" | "or_desc" | "ot_asc" | "ot_desc" | "oc_asc" | "oc_desc" | "ad_asc" | "ad_desc" | "at_asc" | "at_desc" | "ac_asc" | "ac_desc";
|
|
5
|
+
export declare function getRankDifference(this: SemrushAPIClient, { domain, exportColumns, database, displayLimit, displayOffset, displaySort, displayDate, exportEscape, exportDecode, outputObj, }: {
|
|
5
6
|
domain: string;
|
|
6
|
-
|
|
7
|
+
exportColumns?: ExportColumns[];
|
|
7
8
|
database?: Database;
|
|
8
|
-
|
|
9
|
+
displayLimit?: number;
|
|
10
|
+
displayOffset?: number;
|
|
11
|
+
displaySort?: RankDifferenceDisplaySort;
|
|
12
|
+
displayDate?: string;
|
|
13
|
+
exportEscape?: 1;
|
|
14
|
+
exportDecode?: 0 | 1;
|
|
9
15
|
outputObj?: boolean;
|
|
10
16
|
}): Promise<Record<string, string>[]>;
|
|
11
17
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRankDifference = getRankDifference;
|
|
4
|
-
|
|
4
|
+
const displayDateValidator_1 = require("../utils/displayDateValidator");
|
|
5
|
+
async function getRankDifference({ domain, exportColumns = [
|
|
5
6
|
"Db",
|
|
6
7
|
"Dn",
|
|
7
8
|
"Rk",
|
|
@@ -12,13 +13,21 @@ async function getRankDifference({ domain, export_columns = [
|
|
|
12
13
|
"At",
|
|
13
14
|
"Ac",
|
|
14
15
|
"Sh",
|
|
15
|
-
], database = "us",
|
|
16
|
+
], database = "us", displayLimit = 1000, displayOffset, displaySort, displayDate, exportEscape, exportDecode, outputObj = true, }) {
|
|
17
|
+
if (displayDate && !(0, displayDateValidator_1.displayDateValidator)(displayDate)) {
|
|
18
|
+
throw new Error("Invalid displayDate format. Format: YYYYMM15");
|
|
19
|
+
}
|
|
16
20
|
const params = {
|
|
17
21
|
type: "rank_difference",
|
|
18
|
-
export_columns:
|
|
22
|
+
export_columns: exportColumns.join(","),
|
|
19
23
|
domain,
|
|
20
24
|
database,
|
|
21
|
-
display_limit,
|
|
25
|
+
display_limit: displayLimit,
|
|
26
|
+
display_offset: displayOffset,
|
|
27
|
+
display_sort: displaySort,
|
|
28
|
+
display_date: displayDate,
|
|
29
|
+
export_escape: exportEscape,
|
|
30
|
+
export_decode: exportDecode,
|
|
22
31
|
};
|
|
23
32
|
return this.get(this.BASE_URL, params, outputObj);
|
|
24
33
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { SemrushAPIClient } from "../client";
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
type ExportColumns = "Dn" | "Rk" | "Or" | "Ot" | "Oc" | "Ad" | "At" | "Ac" | "Sr" | "St" | "Sc";
|
|
4
|
-
export declare function getSemrushRank(this: SemrushAPIClient, {
|
|
5
|
-
|
|
4
|
+
export declare function getSemrushRank(this: SemrushAPIClient, { exportColumns, database, displayLimit, displayOffset, displayFilter, displayDate, exportEscape, exportDecode, outputObj, }: {
|
|
5
|
+
exportColumns?: ExportColumns[];
|
|
6
6
|
database?: Database;
|
|
7
|
-
|
|
7
|
+
displayLimit?: number;
|
|
8
|
+
displayOffset?: number;
|
|
9
|
+
displayFilter?: string;
|
|
10
|
+
displayDate?: string;
|
|
11
|
+
exportEscape?: 1;
|
|
12
|
+
exportDecode?: 0 | 1;
|
|
8
13
|
outputObj?: boolean;
|
|
9
14
|
}): Promise<Record<string, string>[]>;
|
|
10
15
|
export {};
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSemrushRank = getSemrushRank;
|
|
4
|
-
|
|
4
|
+
const displayDateValidator_1 = require("../utils/displayDateValidator");
|
|
5
|
+
async function getSemrushRank({ exportColumns = ["Dn", "Rk", "Or", "Ot", "Oc", "Ad", "At", "Ac"], database = "us", displayLimit = 10, displayOffset, displayFilter, displayDate, exportEscape, exportDecode, outputObj = true, }) {
|
|
6
|
+
if (displayDate && !(0, displayDateValidator_1.displayDateValidator)(displayDate)) {
|
|
7
|
+
throw new Error("Invalid displayDate format. Format: YYYYMM15");
|
|
8
|
+
}
|
|
5
9
|
const params = {
|
|
6
10
|
type: "rank",
|
|
7
|
-
export_columns:
|
|
11
|
+
export_columns: exportColumns.join(","),
|
|
8
12
|
database,
|
|
9
|
-
display_limit,
|
|
13
|
+
display_limit: displayLimit,
|
|
14
|
+
display_offset: displayOffset,
|
|
15
|
+
display_filter: displayFilter,
|
|
16
|
+
display_date: displayDate,
|
|
17
|
+
export_escape: exportEscape,
|
|
18
|
+
export_decode: exportDecode,
|
|
10
19
|
};
|
|
11
20
|
return this.get(this.BASE_URL, params, outputObj);
|
|
12
21
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { SemrushAPIClient } from "../client";
|
|
2
2
|
import { Country } from "../type/general/country";
|
|
3
3
|
export type ExportColumns = "target" | "rank" | "visits" | "categories" | "desktop_visits" | "mobile_visits" | "users" | "desktop_users" | "mobile_users" | "direct" | "referral" | "social" | "search" | "paid" | "search_organic" | "search_paid" | "social_organic" | "social_paid" | "mail" | "display_ad" | "unknown_channel" | "time_on_site" | "desktop_time_on_site" | "mobile_time_on_site" | "pages_per_visit" | "desktop_pages_per_visit" | "mobile_pages_per_visit" | "bounce_rate" | "desktop_bounce_rate" | "mobile_bounce_rate" | "desktop_share" | "mobile_share" | "accuracy" | "display_date" | "country" | "device_type" | "desktop_hits" | "mobile_hits";
|
|
4
|
-
export declare function getTrafficSummary(this: SemrushAPIClient, { domains,
|
|
4
|
+
export declare function getTrafficSummary(this: SemrushAPIClient, { domains, exportColumns, country, displayDate, displayLimit, displayOffset, outputObj, }: {
|
|
5
5
|
domains: string[];
|
|
6
|
-
|
|
6
|
+
exportColumns?: ExportColumns[];
|
|
7
7
|
country?: Country;
|
|
8
|
+
displayDate?: string;
|
|
9
|
+
displayLimit?: number;
|
|
10
|
+
displayOffset?: number;
|
|
8
11
|
outputObj?: boolean;
|
|
9
12
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTrafficSummary = getTrafficSummary;
|
|
4
|
-
|
|
5
|
-
}) {
|
|
4
|
+
const displayDateValidator_1 = require("../utils/displayDateValidator");
|
|
5
|
+
function getTrafficSummary({ domains, exportColumns = ["target", "visits", "users"], country, displayDate, displayLimit, displayOffset, outputObj = true, }) {
|
|
6
|
+
if (displayDate && !(0, displayDateValidator_1.displayDateValidator)(displayDate)) {
|
|
7
|
+
throw new Error("Invalid displayDate format. Format: YYYYMM15");
|
|
8
|
+
}
|
|
6
9
|
const params = {
|
|
7
10
|
targets: domains.join(","),
|
|
8
|
-
export_columns:
|
|
9
|
-
country
|
|
11
|
+
export_columns: exportColumns.join(","),
|
|
12
|
+
country,
|
|
13
|
+
display_date: displayDate,
|
|
14
|
+
display_limit: displayLimit,
|
|
15
|
+
display_offset: displayOffset,
|
|
10
16
|
};
|
|
11
17
|
return this.get(this.ANALYTICS_URL + "ta/api/v3/summary", params, outputObj);
|
|
12
18
|
}
|
|
@@ -2,11 +2,16 @@ import { SemrushAPIClient } from "../client";
|
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
export type ExportColumns = "Ph" | "Po" | "Pp" | "Nq" | "Cp" | "Co" | "Kd" | "Tr" | "Tg" | "Tc" | "Nr" | "Td" | "Fp" | "Fk" | "Ts" | "In" | "Pt";
|
|
4
4
|
export type DisplaySort = "po_asc" | "po_desc" | "tg_asc" | "tg_desc" | "tr_asc" | "tr_desc" | "tc_asc" | "tc_desc" | "nq_asc" | "nq_desc";
|
|
5
|
-
export declare function getUrlOrganicSearchKeywords(this: SemrushAPIClient, { url,
|
|
5
|
+
export declare function getUrlOrganicSearchKeywords(this: SemrushAPIClient, { url, exportColumns, database, displayLimit, displayOffset, displaySort, displayFilter, displayDate, exportEscape, exportDecode, outputObj, }: {
|
|
6
6
|
url: string;
|
|
7
|
-
|
|
7
|
+
exportColumns?: ExportColumns[];
|
|
8
8
|
database?: Database;
|
|
9
|
+
displayLimit?: number;
|
|
10
|
+
displayOffset?: number;
|
|
11
|
+
displaySort?: DisplaySort;
|
|
12
|
+
displayFilter?: string;
|
|
13
|
+
displayDate?: string;
|
|
14
|
+
exportEscape?: 1;
|
|
15
|
+
exportDecode?: 0 | 1;
|
|
9
16
|
outputObj?: boolean;
|
|
10
|
-
display_limit?: number;
|
|
11
|
-
display_sort?: DisplaySort;
|
|
12
17
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUrlOrganicSearchKeywords = getUrlOrganicSearchKeywords;
|
|
4
|
-
|
|
4
|
+
const displayDateValidator_1 = require("../utils/displayDateValidator");
|
|
5
|
+
function getUrlOrganicSearchKeywords({ url, exportColumns = [
|
|
5
6
|
"Ph",
|
|
6
7
|
"Po",
|
|
7
8
|
"Pp",
|
|
@@ -19,14 +20,22 @@ function getUrlOrganicSearchKeywords({ url, export_columns = [
|
|
|
19
20
|
"Ts",
|
|
20
21
|
"In",
|
|
21
22
|
"Pt",
|
|
22
|
-
], database = "us",
|
|
23
|
+
], database = "us", displayLimit = 10, displayOffset, displaySort, displayFilter, displayDate, exportEscape, exportDecode, outputObj = true, }) {
|
|
24
|
+
if (displayDate && !(0, displayDateValidator_1.displayDateValidator)(displayDate)) {
|
|
25
|
+
throw new Error("Invalid displayDate format. Format: YYYYMM15");
|
|
26
|
+
}
|
|
23
27
|
const params = {
|
|
24
28
|
url,
|
|
25
29
|
type: "url_organic",
|
|
26
|
-
export_columns:
|
|
30
|
+
export_columns: exportColumns.join(","),
|
|
27
31
|
database,
|
|
28
|
-
display_limit,
|
|
29
|
-
|
|
32
|
+
display_limit: displayLimit,
|
|
33
|
+
display_offset: displayOffset,
|
|
34
|
+
display_sort: displaySort,
|
|
35
|
+
display_filter: displayFilter,
|
|
36
|
+
display_date: displayDate,
|
|
37
|
+
export_escape: exportEscape,
|
|
38
|
+
export_decode: exportDecode,
|
|
30
39
|
};
|
|
31
40
|
return this.get(this.BASE_URL, params, outputObj);
|
|
32
41
|
}
|
|
@@ -2,12 +2,13 @@ import { SemrushAPIClient } from "../client";
|
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
export type ExportColumns = "Dn" | "Or" | "Xn" | "Ot" | "Oc" | "Ad" | "At" | "Ac" | "FKn" | "FPn" | "Ipu" | "Ip0" | "Ip1" | "Ip2" | "Ip3" | "Itu" | "It0" | "It1" | "It2" | "It3" | "Icu" | "Ic0" | "Ic1" | "Ic2" | "Ic3" | "Sr" | "Srb" | "St" | "Stb" | "Sc" | "Srn" | "Srl" | "Rk";
|
|
4
4
|
export type DisplaySort = "po_asc" | "po_desc" | "tg_asc" | "tg_desc" | "tr_asc" | "tr_desc" | "tc_asc" | "tc_desc" | "nq_asc" | "nq_desc" | "rk_asc" | "rk_desc" | "or_asc" | "or_desc" | "ot_asc" | "ot_desc" | "oc_asc" | "oc_desc" | "ad_asc" | "ad_desc" | "at_asc" | "at_desc" | "ac_asc" | "ac_desc";
|
|
5
|
-
export declare function getUrlOverview(this: SemrushAPIClient, { url,
|
|
6
|
-
database, outputObj, // Default to true for output object
|
|
7
|
-
display_sort, }: {
|
|
5
|
+
export declare function getUrlOverview(this: SemrushAPIClient, { url, exportColumns, database, displaySort, displayDate, exportEscape, exportDecode, outputObj, }: {
|
|
8
6
|
url: string;
|
|
9
|
-
|
|
7
|
+
exportColumns?: ExportColumns[];
|
|
10
8
|
database?: Database;
|
|
9
|
+
displaySort?: DisplaySort;
|
|
10
|
+
displayDate?: string;
|
|
11
|
+
exportEscape?: 1;
|
|
12
|
+
exportDecode?: 0 | 1;
|
|
11
13
|
outputObj?: boolean;
|
|
12
|
-
display_sort?: DisplaySort;
|
|
13
14
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUrlOverview = getUrlOverview;
|
|
4
|
-
|
|
4
|
+
const displayDateValidator_1 = require("../utils/displayDateValidator");
|
|
5
|
+
function getUrlOverview({ url, exportColumns = [
|
|
5
6
|
"Dn",
|
|
6
7
|
"Or",
|
|
7
8
|
"Xn",
|
|
@@ -35,15 +36,19 @@ function getUrlOverview({ url, export_columns = [
|
|
|
35
36
|
"Srn",
|
|
36
37
|
"Srl",
|
|
37
38
|
"Rk",
|
|
38
|
-
],
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
], database = "us", displaySort, displayDate, exportEscape, exportDecode, outputObj = true, }) {
|
|
40
|
+
if (displayDate && !(0, displayDateValidator_1.displayDateValidator)(displayDate)) {
|
|
41
|
+
throw new Error("Invalid displayDate format. Format: YYYYMM15");
|
|
42
|
+
}
|
|
41
43
|
const params = {
|
|
42
44
|
url,
|
|
43
45
|
type: "url_rank",
|
|
44
|
-
export_columns:
|
|
46
|
+
export_columns: exportColumns.join(","),
|
|
45
47
|
database,
|
|
46
|
-
display_sort,
|
|
48
|
+
display_sort: displaySort,
|
|
49
|
+
display_date: displayDate,
|
|
50
|
+
export_escape: exportEscape,
|
|
51
|
+
export_decode: exportDecode,
|
|
47
52
|
};
|
|
48
53
|
return this.get(this.BASE_URL, params, outputObj);
|
|
49
54
|
}
|
|
@@ -2,11 +2,16 @@ import { SemrushAPIClient } from "../client";
|
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
export type ExportColumns = "Ph" | "Po" | "Nq" | "Cp" | "Co" | "Tg" | "Tr" | "Tc" | "Nr" | "Td" | "Tt" | "Ds" | "Ts";
|
|
4
4
|
export type DisplaySort = "po_asc" | "po_desc" | "tg_asc" | "tg_desc" | "tr_asc" | "tr_desc" | "tc_asc" | "tc_desc" | "nq_asc" | "nq_desc";
|
|
5
|
-
export declare function getUrlPaidSearchKeywords(this: SemrushAPIClient, { url,
|
|
5
|
+
export declare function getUrlPaidSearchKeywords(this: SemrushAPIClient, { url, exportColumns, database, displayLimit, displayOffset, displaySort, displayFilter, displayDate, exportEscape, exportDecode, outputObj, }: {
|
|
6
6
|
url: string;
|
|
7
|
-
|
|
7
|
+
exportColumns?: ExportColumns[];
|
|
8
8
|
database?: Database;
|
|
9
|
-
|
|
9
|
+
displayLimit?: number;
|
|
10
|
+
displayOffset?: number;
|
|
11
|
+
displaySort?: DisplaySort;
|
|
12
|
+
displayFilter?: string;
|
|
13
|
+
displayDate?: string;
|
|
14
|
+
exportEscape?: 1;
|
|
15
|
+
exportDecode?: 0 | 1;
|
|
10
16
|
outputObj?: boolean;
|
|
11
|
-
display_limit?: number;
|
|
12
17
|
}): Promise<Record<string, string>[]>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUrlPaidSearchKeywords = getUrlPaidSearchKeywords;
|
|
4
|
-
|
|
4
|
+
const displayDateValidator_1 = require("../utils/displayDateValidator");
|
|
5
|
+
function getUrlPaidSearchKeywords({ url, exportColumns = [
|
|
5
6
|
"Ph",
|
|
6
7
|
"Po",
|
|
7
8
|
"Nq",
|
|
@@ -15,14 +16,22 @@ function getUrlPaidSearchKeywords({ url, export_columns = [
|
|
|
15
16
|
"Tt",
|
|
16
17
|
"Ds",
|
|
17
18
|
"Ts",
|
|
18
|
-
], database = "us",
|
|
19
|
+
], database = "us", displayLimit = 10, displayOffset, displaySort, displayFilter, displayDate, exportEscape, exportDecode, outputObj = true, }) {
|
|
20
|
+
if (displayDate && !(0, displayDateValidator_1.displayDateValidator)(displayDate)) {
|
|
21
|
+
throw new Error("Invalid displayDate format. Format: YYYYMM15");
|
|
22
|
+
}
|
|
19
23
|
const params = {
|
|
20
24
|
url,
|
|
21
25
|
type: "url_adwords",
|
|
22
|
-
export_columns:
|
|
26
|
+
export_columns: exportColumns.join(","),
|
|
23
27
|
database,
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
display_limit: displayLimit,
|
|
29
|
+
display_offset: displayOffset,
|
|
30
|
+
display_sort: displaySort,
|
|
31
|
+
display_filter: displayFilter,
|
|
32
|
+
display_date: displayDate,
|
|
33
|
+
export_escape: exportEscape,
|
|
34
|
+
export_decode: exportDecode,
|
|
26
35
|
};
|
|
27
36
|
return this.get(this.BASE_URL, params, outputObj);
|
|
28
37
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function displayDateValidator(displayDate?: string): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.displayDateValidator = displayDateValidator;
|
|
4
|
+
function displayDateValidator(displayDate) {
|
|
5
|
+
if (!displayDate)
|
|
6
|
+
return true;
|
|
7
|
+
const regex = /^\d{4}(0[1-9]|1[0-2])15$/;
|
|
8
|
+
return regex.test(displayDate);
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semrush-api-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^22.15.30"
|
|
36
|
+
"@types/node": "^22.15.30",
|
|
37
|
+
"typescript": "^5.9.3"
|
|
37
38
|
}
|
|
38
|
-
}
|
|
39
|
+
}
|