semrush-api-client 0.1.12 → 0.1.14
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/getIndexedPages.d.ts +12 -0
- package/dist/backlinks/getIndexedPages.js +23 -0
- package/dist/backlinks/getReferringDomains.d.ts +12 -0
- package/dist/backlinks/getReferringDomains.js +24 -0
- package/dist/client/index.d.ts +8 -0
- package/dist/client/index.js +8 -0
- package/dist/domain/getAdsCopies.js +1 -1
- package/dist/domain/getDomainOrganic.js +1 -1
- package/dist/domain/getDomainPaidSearchKeywords.js +1 -1
- package/dist/keyword/getKeywordDifficulty.js +1 -1
- package/dist/keyword/getKeywordOverview.js +1 -1
- package/dist/keyword/getPhraseQuestions.d.ts +13 -0
- package/dist/keyword/getPhraseQuestions.js +14 -0
- package/dist/keyword/getRelatedKeywords.d.ts +13 -0
- package/dist/keyword/getRelatedKeywords.js +25 -0
- package/dist/overview/getDomainOverview.js +1 -1
- package/dist/overview/getRankDifference.js +1 -1
- package/dist/overview/getSemrushRank.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
export type IndexedPageTargetType = "root_domain" | "domain" | "url";
|
|
3
|
+
export type ExportColumns = "source_url" | "source_title" | "response_code" | "backlinks_num" | "domains_num" | "last_seen" | "external_num" | "internal_num";
|
|
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, target_type, export_columns, displaySort, display_limit, outputObj, }: {
|
|
6
|
+
target: string;
|
|
7
|
+
target_type?: IndexedPageTargetType;
|
|
8
|
+
export_columns?: ExportColumns[];
|
|
9
|
+
displaySort?: DisplaySort;
|
|
10
|
+
outputObj?: boolean;
|
|
11
|
+
display_limit?: number;
|
|
12
|
+
}): Promise<string | Record<string, string>[]>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIndexedPages = getIndexedPages;
|
|
4
|
+
async function getIndexedPages({ target, target_type = "domain", export_columns = [
|
|
5
|
+
"source_url",
|
|
6
|
+
"source_title",
|
|
7
|
+
"response_code",
|
|
8
|
+
"backlinks_num",
|
|
9
|
+
"domains_num",
|
|
10
|
+
"last_seen",
|
|
11
|
+
"external_num",
|
|
12
|
+
"internal_num",
|
|
13
|
+
], displaySort = "backlinks_num_desc", display_limit = 1000, outputObj = true, }) {
|
|
14
|
+
const params = {
|
|
15
|
+
type: "backlinks_pages",
|
|
16
|
+
target,
|
|
17
|
+
target_type,
|
|
18
|
+
display_sort: displaySort,
|
|
19
|
+
display_limit,
|
|
20
|
+
export_columns: export_columns.join(","),
|
|
21
|
+
};
|
|
22
|
+
return this.get(this.ANALYTICS_URL + "v1/", params, outputObj);
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
export type TargetType = "root_domain" | "domain" | "url";
|
|
3
|
+
export type ExportColumns = "domain_ascore" | "domain_score" | "domain" | "backlinks_num" | "domain_trust_score" | "ip" | "country" | "first_seen" | "last_seen";
|
|
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, target_type, export_columns, displaySort, display_limit, outputObj, }: {
|
|
6
|
+
target: string;
|
|
7
|
+
target_type?: TargetType;
|
|
8
|
+
export_columns?: ExportColumns[];
|
|
9
|
+
displaySort?: DisplaySort;
|
|
10
|
+
outputObj?: boolean;
|
|
11
|
+
display_limit?: number;
|
|
12
|
+
}): Promise<string | Record<string, string>[]>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReferringDomains = getReferringDomains;
|
|
4
|
+
async function getReferringDomains({ target, target_type = "domain", export_columns = [
|
|
5
|
+
"domain_ascore",
|
|
6
|
+
"domain_score",
|
|
7
|
+
"domain",
|
|
8
|
+
"backlinks_num",
|
|
9
|
+
"domain_trust_score",
|
|
10
|
+
"ip",
|
|
11
|
+
"country",
|
|
12
|
+
"first_seen",
|
|
13
|
+
"last_seen",
|
|
14
|
+
], displaySort = "backlinks_num_desc", display_limit = 1000, outputObj = true, }) {
|
|
15
|
+
const params = {
|
|
16
|
+
type: "backlinks_refdomains",
|
|
17
|
+
target,
|
|
18
|
+
target_type,
|
|
19
|
+
display_sort: displaySort,
|
|
20
|
+
display_limit,
|
|
21
|
+
export_columns: export_columns.join(","),
|
|
22
|
+
};
|
|
23
|
+
return this.get(this.ANALYTICS_URL + "v1/", params, outputObj);
|
|
24
|
+
}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ import { getSemrushRank } from "../overview/getSemrushRank";
|
|
|
10
10
|
import { getKeywordDifficulty } from "../keyword/getKeywordDifficulty";
|
|
11
11
|
import { getBacklinks } from "../backlinks/getBacklinks";
|
|
12
12
|
import { getAnchors } from "../backlinks/getAnchors";
|
|
13
|
+
import { getIndexedPages } from "../backlinks/getIndexedPages";
|
|
14
|
+
import { getReferringDomains } from "../backlinks/getReferringDomains";
|
|
15
|
+
import { getRelatedKeywords } from "../keyword/getRelatedKeywords";
|
|
16
|
+
import { getPhraseQuestions } from "../keyword/getPhraseQuestions";
|
|
13
17
|
export declare class SemrushAPIClient {
|
|
14
18
|
private client;
|
|
15
19
|
private api_key;
|
|
@@ -32,4 +36,8 @@ export declare class SemrushAPIClient {
|
|
|
32
36
|
getKeywordDifficulty: typeof getKeywordDifficulty;
|
|
33
37
|
getBacklinks: typeof getBacklinks;
|
|
34
38
|
getAnchors: typeof getAnchors;
|
|
39
|
+
getIndexedPages: typeof getIndexedPages;
|
|
40
|
+
getReferringDomains: typeof getReferringDomains;
|
|
41
|
+
getRelatedKeywords: typeof getRelatedKeywords;
|
|
42
|
+
getPhraseQuestions: typeof getPhraseQuestions;
|
|
35
43
|
}
|
package/dist/client/index.js
CHANGED
|
@@ -17,6 +17,10 @@ const getSemrushRank_1 = require("../overview/getSemrushRank");
|
|
|
17
17
|
const getKeywordDifficulty_1 = require("../keyword/getKeywordDifficulty");
|
|
18
18
|
const getBacklinks_1 = require("../backlinks/getBacklinks");
|
|
19
19
|
const getAnchors_1 = require("../backlinks/getAnchors");
|
|
20
|
+
const getIndexedPages_1 = require("../backlinks/getIndexedPages");
|
|
21
|
+
const getReferringDomains_1 = require("../backlinks/getReferringDomains");
|
|
22
|
+
const getRelatedKeywords_1 = require("../keyword/getRelatedKeywords");
|
|
23
|
+
const getPhraseQuestions_1 = require("../keyword/getPhraseQuestions");
|
|
20
24
|
class SemrushAPIClient {
|
|
21
25
|
client;
|
|
22
26
|
api_key;
|
|
@@ -74,5 +78,9 @@ class SemrushAPIClient {
|
|
|
74
78
|
getKeywordDifficulty = getKeywordDifficulty_1.getKeywordDifficulty;
|
|
75
79
|
getBacklinks = getBacklinks_1.getBacklinks;
|
|
76
80
|
getAnchors = getAnchors_1.getAnchors;
|
|
81
|
+
getIndexedPages = getIndexedPages_1.getIndexedPages;
|
|
82
|
+
getReferringDomains = getReferringDomains_1.getReferringDomains;
|
|
83
|
+
getRelatedKeywords = getRelatedKeywords_1.getRelatedKeywords;
|
|
84
|
+
getPhraseQuestions = getPhraseQuestions_1.getPhraseQuestions;
|
|
77
85
|
}
|
|
78
86
|
exports.SemrushAPIClient = SemrushAPIClient;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAdsCopies = getAdsCopies;
|
|
4
|
-
async function getAdsCopies({ domain, export_columns = ["Tt", "Ds", "Vu", "Ur", "Pc", "Un"], database
|
|
4
|
+
async function getAdsCopies({ domain, export_columns = ["Tt", "Ds", "Vu", "Ur", "Pc", "Un"], database, display_limit = 1000, outputObj = true, }) {
|
|
5
5
|
const params = {
|
|
6
6
|
type: "domain_adwords_unique",
|
|
7
7
|
export_columns: export_columns.join(","),
|
|
@@ -14,7 +14,7 @@ async function getDomainOrganic({ domain, export_columns = [
|
|
|
14
14
|
"Co",
|
|
15
15
|
"Nr",
|
|
16
16
|
"Td",
|
|
17
|
-
], database
|
|
17
|
+
], database, displayPosition, displayPositionsType, display_limit = 1000, outputObj = true, }) {
|
|
18
18
|
const params = {
|
|
19
19
|
type: "domain_organic",
|
|
20
20
|
export_columns: export_columns.join(","),
|
|
@@ -14,7 +14,7 @@ async function getDomainPaidSearchKeywords({ domain, export_columns = [
|
|
|
14
14
|
"Co",
|
|
15
15
|
"Nr",
|
|
16
16
|
"Td",
|
|
17
|
-
], database
|
|
17
|
+
], database, displayPosition, display_limit = 1000, outputObj = true, }) {
|
|
18
18
|
const params = {
|
|
19
19
|
type: "domain_adwords",
|
|
20
20
|
export_columns: export_columns.join(","),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getKeywordDifficulty = getKeywordDifficulty;
|
|
4
|
-
async function getKeywordDifficulty({ phrases, export_columns = ["Ph", "Kd"], database
|
|
4
|
+
async function getKeywordDifficulty({ phrases, export_columns = ["Ph", "Kd"], database, outputObj = true, // Default to true for output object
|
|
5
5
|
}) {
|
|
6
6
|
const params = {
|
|
7
7
|
type: "phrase_kdi",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getKeywordOverview = getKeywordOverview;
|
|
4
|
-
async function getKeywordOverview({ phrase, export_columns = ["Dt", "Db", "Ph", "Nq", "Cp", "Co", "Nr"], database
|
|
4
|
+
async function getKeywordOverview({ phrase, export_columns = ["Dt", "Db", "Ph", "Nq", "Cp", "Co", "Nr"], database, outputObj = true, // Default to true for output object
|
|
5
5
|
}) {
|
|
6
6
|
const params = {
|
|
7
7
|
type: "phrase_all",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
import { Database } from "../type/general/database";
|
|
3
|
+
export type IndexedPagephraseType = "root_domain" | "domain" | "url";
|
|
4
|
+
export type ExportColumns = "Ph" | "Nq" | "Cp" | "Co" | "Nr" | "Td" | "In" | "Kd";
|
|
5
|
+
export type DisplaySort = "nq_asc" | "nq_desc" | "cp_asc" | "cp_desc" | "co_asc" | "co_desc" | "nr_asc" | "nr_desc" | "kd_asc" | "kd_desc";
|
|
6
|
+
export declare function getPhraseQuestions(this: SemrushAPIClient, { phrase, export_columns, database, displaySort, display_limit, outputObj, }: {
|
|
7
|
+
phrase: string;
|
|
8
|
+
database?: Database;
|
|
9
|
+
export_columns?: ExportColumns[];
|
|
10
|
+
displaySort?: DisplaySort;
|
|
11
|
+
outputObj?: boolean;
|
|
12
|
+
display_limit?: number;
|
|
13
|
+
}): Promise<string | Record<string, string>[]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPhraseQuestions = getPhraseQuestions;
|
|
4
|
+
async function getPhraseQuestions({ phrase, export_columns = ["Ph", "Nq", "Cp", "Co", "Nr", "Td", "In", "Kd"], database, displaySort = "nq_desc", display_limit = 1000, outputObj = true, }) {
|
|
5
|
+
const params = {
|
|
6
|
+
type: "phrase_questions",
|
|
7
|
+
phrase,
|
|
8
|
+
database,
|
|
9
|
+
display_sort: displaySort,
|
|
10
|
+
display_limit,
|
|
11
|
+
export_columns: export_columns.join(","),
|
|
12
|
+
};
|
|
13
|
+
return this.get(this.ANALYTICS_URL, params, outputObj);
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
import { Database } from "../type/general/database";
|
|
3
|
+
export type IndexedPagephraseType = "root_domain" | "domain" | "url";
|
|
4
|
+
export type ExportColumns = "Ph" | "Nq" | "Cp" | "Co" | "Nr" | "Td" | "Rr" | "Fk" | "In" | "Kd";
|
|
5
|
+
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";
|
|
6
|
+
export declare function getRelatedKeywords(this: SemrushAPIClient, { phrase, export_columns, database, displaySort, display_limit, outputObj, }: {
|
|
7
|
+
phrase: string;
|
|
8
|
+
database?: Database;
|
|
9
|
+
export_columns?: ExportColumns[];
|
|
10
|
+
displaySort?: DisplaySort;
|
|
11
|
+
outputObj?: boolean;
|
|
12
|
+
display_limit?: number;
|
|
13
|
+
}): Promise<string | Record<string, string>[]>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRelatedKeywords = getRelatedKeywords;
|
|
4
|
+
async function getRelatedKeywords({ phrase, export_columns = [
|
|
5
|
+
"Ph",
|
|
6
|
+
"Nq",
|
|
7
|
+
"Cp",
|
|
8
|
+
"Co",
|
|
9
|
+
"Nr",
|
|
10
|
+
"Td",
|
|
11
|
+
"Rr",
|
|
12
|
+
"Fk",
|
|
13
|
+
"In",
|
|
14
|
+
"Kd",
|
|
15
|
+
], database, displaySort = "nq_desc", display_limit = 1000, outputObj = true, }) {
|
|
16
|
+
const params = {
|
|
17
|
+
type: "phrase_related",
|
|
18
|
+
phrase,
|
|
19
|
+
database,
|
|
20
|
+
display_sort: displaySort,
|
|
21
|
+
display_limit,
|
|
22
|
+
export_columns: export_columns.join(","),
|
|
23
|
+
};
|
|
24
|
+
return this.get(this.ANALYTICS_URL, params, outputObj);
|
|
25
|
+
}
|
|
@@ -23,7 +23,7 @@ async function getDomainOverview({ domain, export_columns = [
|
|
|
23
23
|
"Sc",
|
|
24
24
|
"Srn",
|
|
25
25
|
"Srl",
|
|
26
|
-
], database
|
|
26
|
+
], database, display_limit = 1000, outputObj = true, }) {
|
|
27
27
|
const params = {
|
|
28
28
|
type: "domain_ranks",
|
|
29
29
|
export_columns: export_columns.join(","),
|
|
@@ -12,7 +12,7 @@ async function getRankDifference({ domain, export_columns = [
|
|
|
12
12
|
"At",
|
|
13
13
|
"Ac",
|
|
14
14
|
"Sh",
|
|
15
|
-
], database
|
|
15
|
+
], database, display_limit = 1000, outputObj = true, }) {
|
|
16
16
|
const params = {
|
|
17
17
|
type: "rank_difference",
|
|
18
18
|
export_columns: export_columns.join(","),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSemrushRank = getSemrushRank;
|
|
4
|
-
async function getSemrushRank({ export_columns = ["Dn", "Rk", "Or", "Ot", "Oc", "Ad", "At", "Ac"], database
|
|
4
|
+
async function getSemrushRank({ export_columns = ["Dn", "Rk", "Or", "Ot", "Oc", "Ad", "At", "Ac"], database, display_limit = 1000, outputObj = true, }) {
|
|
5
5
|
const params = {
|
|
6
6
|
type: "rank",
|
|
7
7
|
export_columns: export_columns.join(","),
|