semrush-api-client 0.1.17 → 0.1.19

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.
@@ -6,4 +6,4 @@ export declare function getBacklinksOverview(this: SemrushAPIClient, { target, t
6
6
  target_type?: BacklinksTargetType;
7
7
  export_columns?: BacklinkstExportColumns[];
8
8
  outputObj?: boolean;
9
- }): Promise<string | Record<string, string>[]>;
9
+ }): Promise<Record<string, string>[]>;
@@ -9,4 +9,4 @@ export declare function getAnchors(this: SemrushAPIClient, { target, target_type
9
9
  displaySort?: DisplaySort;
10
10
  outputObj?: boolean;
11
11
  display_limit?: number;
12
- }): Promise<string | Record<string, string>[]>;
12
+ }): Promise<Record<string, string>[]>;
@@ -7,7 +7,7 @@ async function getAnchors({ target, target_type = "domain", export_columns = [
7
7
  "backlinks_num",
8
8
  "first_seen",
9
9
  "last_seen",
10
- ], displaySort = "backlinks_num_desc", display_limit = 1000, outputObj = true, }) {
10
+ ], displaySort = "backlinks_num_desc", display_limit = 10, outputObj = true, }) {
11
11
  const params = {
12
12
  type: "backlinks_anchors",
13
13
  target,
@@ -9,4 +9,4 @@ export declare function getBacklinks(this: SemrushAPIClient, { target, target_ty
9
9
  displaySort?: DisplaySort;
10
10
  outputObj?: boolean;
11
11
  display_limit?: number;
12
- }): Promise<string | Record<string, string>[]>;
12
+ }): Promise<Record<string, string>[]>;
@@ -24,7 +24,7 @@ async function getBacklinks({ target, target_type = "domain", export_columns = [
24
24
  "sitewide",
25
25
  "newlink",
26
26
  "lostlink",
27
- ], displaySort = "page_ascore_desc", display_limit = 1000, outputObj = true, }) {
27
+ ], displaySort = "page_ascore_desc", display_limit = 10, outputObj = true, }) {
28
28
  const params = {
29
29
  type: "backlinks",
30
30
  target,
@@ -9,4 +9,4 @@ export declare function getIndexedPages(this: SemrushAPIClient, { target, target
9
9
  displaySort?: DisplaySort;
10
10
  outputObj?: boolean;
11
11
  display_limit?: number;
12
- }): Promise<string | Record<string, string>[]>;
12
+ }): Promise<Record<string, string>[]>;
@@ -10,7 +10,7 @@ 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", display_limit = 1000, outputObj = true, }) {
13
+ ], displaySort = "backlinks_num_desc", display_limit = 10, outputObj = true, }) {
14
14
  const params = {
15
15
  type: "backlinks_pages",
16
16
  target,
@@ -9,4 +9,4 @@ export declare function getReferringDomains(this: SemrushAPIClient, { target, ta
9
9
  displaySort?: DisplaySort;
10
10
  outputObj?: boolean;
11
11
  display_limit?: number;
12
- }): Promise<string | Record<string, string>[]>;
12
+ }): Promise<Record<string, string>[]>;
@@ -11,7 +11,7 @@ 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", display_limit = 1000, outputObj = true, }) {
14
+ ], displaySort = "backlinks_num_desc", display_limit = 10, outputObj = true, }) {
15
15
  const params = {
16
16
  type: "backlinks_refdomains",
17
17
  target,
@@ -60,7 +60,7 @@ class SemrushAPIClient {
60
60
  }
61
61
  catch (error) {
62
62
  if (axios_1.default.isAxiosError(error)) {
63
- throw new Error(`API request failed: ${error.message}`);
63
+ throw new Error(`API request failed: ${error.message}${error.code ? ` (code: ${error.code})` : ""}${error.response?.status ? ` (status: ${error.response.status})` : ""}`);
64
64
  }
65
65
  else {
66
66
  throw new Error(`Unexpected error: ${error}`);
@@ -7,5 +7,5 @@ export declare function getAdsCopies(this: SemrushAPIClient, { domain, export_co
7
7
  database?: Database;
8
8
  outputObj?: boolean;
9
9
  display_limit?: number;
10
- }): Promise<string | Record<string, string>[]>;
10
+ }): Promise<Record<string, string>[]>;
11
11
  export {};
@@ -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 = "us", display_limit = 10, outputObj = true, }) {
5
5
  const params = {
6
6
  type: "domain_adwords_unique",
7
7
  export_columns: export_columns.join(","),
@@ -11,5 +11,5 @@ export declare function getDomainOrganicSearchKeywords(this: SemrushAPIClient, {
11
11
  outputObj?: boolean;
12
12
  displayPositionsType?: displayPositionType;
13
13
  display_limit?: number;
14
- }): Promise<string | Record<string, string>[]>;
14
+ }): Promise<Record<string, string>[]>;
15
15
  export {};
@@ -14,7 +14,7 @@ async function getDomainOrganicSearchKeywords({ domain, export_columns = [
14
14
  "Co",
15
15
  "Nr",
16
16
  "Td",
17
- ], database = "us", displayPosition, displayPositionsType, display_limit = 1000, outputObj = true, }) {
17
+ ], database = "us", displayPosition, displayPositionsType, display_limit = 10, outputObj = true, }) {
18
18
  const params = {
19
19
  type: "domain_organic",
20
20
  export_columns: export_columns.join(","),
@@ -8,4 +8,4 @@ export declare function getDomainOverview(this: SemrushAPIClient, { domain, expo
8
8
  display_limit?: number;
9
9
  outputObj?: boolean;
10
10
  displayDate?: string;
11
- }): Promise<string | Record<string, string>[]>;
11
+ }): Promise<Record<string, string>[]>;
@@ -23,7 +23,7 @@ async function getDomainOverview({ domain, export_columns = [
23
23
  "Sc",
24
24
  "Srn",
25
25
  "Srl",
26
- ], database = "us", displayDate, display_limit = 1000, outputObj = true, }) {
26
+ ], database = "us", displayDate, display_limit = 10, outputObj = true, }) {
27
27
  const params = {
28
28
  type: "domain_ranks",
29
29
  export_columns: export_columns.join(","),
@@ -9,5 +9,5 @@ export declare function getDomainPaidSearchKeywords(this: SemrushAPIClient, { do
9
9
  database?: Database;
10
10
  outputObj?: boolean;
11
11
  display_limit?: number;
12
- }): Promise<string | Record<string, string>[]>;
12
+ }): Promise<Record<string, string>[]>;
13
13
  export {};
@@ -9,4 +9,4 @@ export declare function getBroadMatchKeywords(this: SemrushAPIClient, { phrase,
9
9
  displaySort?: DisplaySort;
10
10
  outputObj?: boolean;
11
11
  display_limit?: number;
12
- }): Promise<string | Record<string, string>[]>;
12
+ }): Promise<Record<string, string>[]>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getBroadMatchKeywords = getBroadMatchKeywords;
4
- async function getBroadMatchKeywords({ phrase, export_columns = ["Ph", "Nq", "Cp", "Co", "Nr", "Td", "In", "Kd"], database = "us", displaySort = "nq_desc", display_limit = 1000, outputObj = true, }) {
4
+ async function getBroadMatchKeywords({ phrase, export_columns = ["Ph", "Nq", "Cp", "Co", "Nr", "Td", "In", "Kd"], database = "us", displaySort = "nq_desc", display_limit = 10, outputObj = true, }) {
5
5
  const params = {
6
6
  type: "phrase_fullsearch",
7
7
  phrase,
@@ -6,5 +6,5 @@ export declare function getKeywordDifficulty(this: SemrushAPIClient, { phrases,
6
6
  export_columns?: ExportColumns[];
7
7
  database?: Database;
8
8
  outputObj?: boolean;
9
- }): Promise<string | Record<string, string>[]>;
9
+ }): Promise<Record<string, string>[]>;
10
10
  export {};
@@ -6,5 +6,5 @@ export declare function getKeywordOverview(this: SemrushAPIClient, { phrase, exp
6
6
  export_columns?: KeywordExportColumns[];
7
7
  database?: Database;
8
8
  outputObj?: boolean;
9
- }): Promise<string | Record<string, string>[]>;
9
+ }): Promise<Record<string, string>[]>;
10
10
  export {};
@@ -9,4 +9,4 @@ export declare function getPhraseQuestions(this: SemrushAPIClient, { phrase, exp
9
9
  displaySort?: DisplaySort;
10
10
  outputObj?: boolean;
11
11
  display_limit?: number;
12
- }): Promise<string | Record<string, string>[]>;
12
+ }): Promise<Record<string, string>[]>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPhraseQuestions = getPhraseQuestions;
4
- async function getPhraseQuestions({ phrase, export_columns = ["Ph", "Nq", "Cp", "Co", "Nr", "Td", "In", "Kd"], database = "us", displaySort = "nq_desc", display_limit = 1000, outputObj = true, }) {
4
+ async function getPhraseQuestions({ phrase, export_columns = ["Ph", "Nq", "Cp", "Co", "Nr", "Td", "In", "Kd"], database = "us", displaySort = "nq_desc", display_limit = 10, outputObj = true, }) {
5
5
  const params = {
6
6
  type: "phrase_questions",
7
7
  phrase,
@@ -1,6 +1,5 @@
1
1
  import { SemrushAPIClient } from "../client";
2
2
  import { Database } from "../type/general/database";
3
- export type IndexedPagephraseType = "root_domain" | "domain" | "url";
4
3
  export type ExportColumns = "Ph" | "Nq" | "Cp" | "Co" | "Nr" | "Td" | "Rr" | "Fk" | "In" | "Kd";
5
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";
6
5
  export declare function getRelatedKeywords(this: SemrushAPIClient, { phrase, export_columns, database, displaySort, display_limit, outputObj, }: {
@@ -10,4 +9,4 @@ export declare function getRelatedKeywords(this: SemrushAPIClient, { phrase, exp
10
9
  displaySort?: DisplaySort;
11
10
  outputObj?: boolean;
12
11
  display_limit?: number;
13
- }): Promise<string | Record<string, string>[]>;
12
+ }): Promise<Record<string, string>[]>;
@@ -12,7 +12,7 @@ async function getRelatedKeywords({ phrase, export_columns = [
12
12
  "Fk",
13
13
  "In",
14
14
  "Kd",
15
- ], database = "us", displaySort = "nq_desc", display_limit = 1000, outputObj = true, }) {
15
+ ], database = "us", displaySort = "nq_desc", display_limit = 10, outputObj = true, }) {
16
16
  const params = {
17
17
  type: "phrase_related",
18
18
  phrase,
@@ -7,5 +7,5 @@ export declare function getRankDifference(this: SemrushAPIClient, { domain, expo
7
7
  database?: Database;
8
8
  display_limit?: number;
9
9
  outputObj?: boolean;
10
- }): Promise<string | Record<string, string>[]>;
10
+ }): Promise<Record<string, string>[]>;
11
11
  export {};
@@ -6,5 +6,5 @@ export declare function getSemrushRank(this: SemrushAPIClient, { export_columns,
6
6
  database?: Database;
7
7
  display_limit?: number;
8
8
  outputObj?: boolean;
9
- }): Promise<string | Record<string, string>[]>;
9
+ }): Promise<Record<string, string>[]>;
10
10
  export {};
@@ -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 = "us", display_limit = 10, outputObj = true, }) {
5
5
  const params = {
6
6
  type: "rank",
7
7
  export_columns: export_columns.join(","),
@@ -6,4 +6,4 @@ export declare function getTrafficSummary(this: SemrushAPIClient, { domains, exp
6
6
  export_columns?: ExportColumns[];
7
7
  country?: Country;
8
8
  outputObj?: boolean;
9
- }): Promise<string | Record<string, string>[]>;
9
+ }): Promise<Record<string, string>[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semrush-api-client",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",