semrush-api-client 0.1.13 → 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.
@@ -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
+ }
@@ -11,6 +11,9 @@ import { getKeywordDifficulty } from "../keyword/getKeywordDifficulty";
11
11
  import { getBacklinks } from "../backlinks/getBacklinks";
12
12
  import { getAnchors } from "../backlinks/getAnchors";
13
13
  import { getIndexedPages } from "../backlinks/getIndexedPages";
14
+ import { getReferringDomains } from "../backlinks/getReferringDomains";
15
+ import { getRelatedKeywords } from "../keyword/getRelatedKeywords";
16
+ import { getPhraseQuestions } from "../keyword/getPhraseQuestions";
14
17
  export declare class SemrushAPIClient {
15
18
  private client;
16
19
  private api_key;
@@ -34,4 +37,7 @@ export declare class SemrushAPIClient {
34
37
  getBacklinks: typeof getBacklinks;
35
38
  getAnchors: typeof getAnchors;
36
39
  getIndexedPages: typeof getIndexedPages;
40
+ getReferringDomains: typeof getReferringDomains;
41
+ getRelatedKeywords: typeof getRelatedKeywords;
42
+ getPhraseQuestions: typeof getPhraseQuestions;
37
43
  }
@@ -18,6 +18,9 @@ const getKeywordDifficulty_1 = require("../keyword/getKeywordDifficulty");
18
18
  const getBacklinks_1 = require("../backlinks/getBacklinks");
19
19
  const getAnchors_1 = require("../backlinks/getAnchors");
20
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");
21
24
  class SemrushAPIClient {
22
25
  client;
23
26
  api_key;
@@ -76,5 +79,8 @@ class SemrushAPIClient {
76
79
  getBacklinks = getBacklinks_1.getBacklinks;
77
80
  getAnchors = getAnchors_1.getAnchors;
78
81
  getIndexedPages = getIndexedPages_1.getIndexedPages;
82
+ getReferringDomains = getReferringDomains_1.getReferringDomains;
83
+ getRelatedKeywords = getRelatedKeywords_1.getRelatedKeywords;
84
+ getPhraseQuestions = getPhraseQuestions_1.getPhraseQuestions;
79
85
  }
80
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 = "us", display_limit = 1000, outputObj = true, }) {
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 = "us", displayPosition, displayPositionsType, display_limit = 1000, outputObj = true, }) {
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 = "us", displayPosition, display_limit = 1000, outputObj = true, }) {
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 = "us", outputObj = true, // Default to true for output object
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 = "us", outputObj = true, // Default to true for output object
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 = "us", display_limit = 1000, outputObj = true, }) {
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 = "us", display_limit = 1000, outputObj = true, }) {
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 = "us", display_limit = 1000, outputObj = true, }) {
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(","),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semrush-api-client",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",