semrush-api-client 0.1.11 → 0.1.13

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.
@@ -1,7 +1,7 @@
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 backlinksOverview(this: SemrushAPIClient, { target, target_type, export_columns, outputObj, }: {
4
+ export declare function getBacklinksOverview(this: SemrushAPIClient, { target, target_type, export_columns, outputObj, }: {
5
5
  target: string;
6
6
  target_type?: BacklinksTargetType;
7
7
  export_columns?: BacklinkstExportColumns[];
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.backlinksOverview = backlinksOverview;
4
- async function backlinksOverview({ target, target_type = "domain", export_columns = [
3
+ exports.getBacklinksOverview = getBacklinksOverview;
4
+ async function getBacklinksOverview({ target, target_type = "domain", export_columns = [
5
5
  "ascore",
6
6
  "total",
7
7
  "domains_num",
@@ -0,0 +1,12 @@
1
+ import { SemrushAPIClient } from "../client";
2
+ export type AnchorsTargetType = "root_domain" | "domain" | "url";
3
+ export type AnchorsExportColumns = "anchor" | "domains_num" | "backlinks_num" | "first_seen" | "last_seen";
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, target_type, export_columns, displaySort, display_limit, outputObj, }: {
6
+ target: string;
7
+ target_type?: AnchorsTargetType;
8
+ export_columns?: AnchorsExportColumns[];
9
+ displaySort?: DisplaySort;
10
+ outputObj?: boolean;
11
+ display_limit?: number;
12
+ }): Promise<string | Record<string, string>[]>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAnchors = getAnchors;
4
+ async function getAnchors({ target, target_type = "domain", export_columns = [
5
+ "anchor",
6
+ "domains_num",
7
+ "backlinks_num",
8
+ "first_seen",
9
+ "last_seen",
10
+ ], displaySort = "backlinks_num_desc", display_limit = 1000, outputObj = true, }) {
11
+ const params = {
12
+ type: "backlinks_anchors",
13
+ target,
14
+ target_type,
15
+ display_sort: displaySort,
16
+ display_limit,
17
+ export_columns: export_columns.join(","),
18
+ };
19
+ return this.get(this.ANALYTICS_URL + "v1/", params, outputObj);
20
+ }
@@ -0,0 +1,12 @@
1
+ import { SemrushAPIClient } from "../client";
2
+ export type BacklinksTargetType = "root_domain" | "domain" | "url";
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
+ 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, target_type, export_columns, displaySort, display_limit, outputObj, }: {
6
+ target: string;
7
+ target_type?: BacklinksTargetType;
8
+ export_columns?: BacklinkstExportColumns[];
9
+ displaySort?: DisplaySort;
10
+ outputObj?: boolean;
11
+ display_limit?: number;
12
+ }): Promise<string | Record<string, string>[]>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBacklinks = getBacklinks;
4
+ async function getBacklinks({ target, target_type = "domain", export_columns = [
5
+ "page_ascore",
6
+ "response_code",
7
+ "source_size",
8
+ "external_num",
9
+ "internal_num",
10
+ "redirect_url",
11
+ "source_url",
12
+ "source_title",
13
+ "image_url",
14
+ "target_url",
15
+ "target_title",
16
+ "anchor",
17
+ "image_alt",
18
+ "last_seen",
19
+ "first_seen",
20
+ "nofollow",
21
+ "form",
22
+ "frame",
23
+ "image",
24
+ "sitewide",
25
+ "newlink",
26
+ "lostlink",
27
+ ], displaySort = "page_ascore_desc", display_limit = 1000, outputObj = true, }) {
28
+ const params = {
29
+ type: "backlinks",
30
+ target,
31
+ target_type,
32
+ display_sort: displaySort,
33
+ display_limit,
34
+ export_columns: export_columns.join(","),
35
+ };
36
+ return this.get(this.ANALYTICS_URL + "v1/", params, outputObj);
37
+ }
@@ -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
+ }
@@ -1,6 +1,6 @@
1
1
  import { getDomainOverview } from "../overview/getDomainOverview";
2
2
  import { getKeywordOverview } from "../keyword/getKeywordOverview";
3
- import { backlinksOverview } from "../backlinks/backlinksOverview";
3
+ import { getBacklinksOverview } from "../backlinks/backlinksOverview";
4
4
  import { getRankDifference } from "../overview/getRankDifference";
5
5
  import { getDomainOrganic } from "../domain/getDomainOrganic";
6
6
  import { getDomainPaidSearchKeywords } from "../domain/getDomainPaidSearchKeywords";
@@ -8,6 +8,9 @@ import { getAdsCopies } from "../domain/getAdsCopies";
8
8
  import { getTrafficSummary } from "../trend/getTrafficSummary";
9
9
  import { getSemrushRank } from "../overview/getSemrushRank";
10
10
  import { getKeywordDifficulty } from "../keyword/getKeywordDifficulty";
11
+ import { getBacklinks } from "../backlinks/getBacklinks";
12
+ import { getAnchors } from "../backlinks/getAnchors";
13
+ import { getIndexedPages } from "../backlinks/getIndexedPages";
11
14
  export declare class SemrushAPIClient {
12
15
  private client;
13
16
  private api_key;
@@ -20,7 +23,7 @@ export declare class SemrushAPIClient {
20
23
  get<T>(url: string, params?: Record<string, any>, outputObj?: boolean): Promise<T>;
21
24
  getDomainOverview: typeof getDomainOverview;
22
25
  getKeywordOverview: typeof getKeywordOverview;
23
- backlinksOverview: typeof backlinksOverview;
26
+ getBacklinksOverview: typeof getBacklinksOverview;
24
27
  getRankDifference: typeof getRankDifference;
25
28
  getSemrushRank: typeof getSemrushRank;
26
29
  getDomainOrganic: typeof getDomainOrganic;
@@ -28,4 +31,7 @@ export declare class SemrushAPIClient {
28
31
  getAdsCopies: typeof getAdsCopies;
29
32
  getTrafficSummary: typeof getTrafficSummary;
30
33
  getKeywordDifficulty: typeof getKeywordDifficulty;
34
+ getBacklinks: typeof getBacklinks;
35
+ getAnchors: typeof getAnchors;
36
+ getIndexedPages: typeof getIndexedPages;
31
37
  }
@@ -15,6 +15,9 @@ const getAdsCopies_1 = require("../domain/getAdsCopies");
15
15
  const getTrafficSummary_1 = require("../trend/getTrafficSummary");
16
16
  const getSemrushRank_1 = require("../overview/getSemrushRank");
17
17
  const getKeywordDifficulty_1 = require("../keyword/getKeywordDifficulty");
18
+ const getBacklinks_1 = require("../backlinks/getBacklinks");
19
+ const getAnchors_1 = require("../backlinks/getAnchors");
20
+ const getIndexedPages_1 = require("../backlinks/getIndexedPages");
18
21
  class SemrushAPIClient {
19
22
  client;
20
23
  api_key;
@@ -62,7 +65,7 @@ class SemrushAPIClient {
62
65
  }
63
66
  getDomainOverview = getDomainOverview_1.getDomainOverview;
64
67
  getKeywordOverview = getKeywordOverview_1.getKeywordOverview;
65
- backlinksOverview = backlinksOverview_1.backlinksOverview;
68
+ getBacklinksOverview = backlinksOverview_1.getBacklinksOverview;
66
69
  getRankDifference = getRankDifference_1.getRankDifference;
67
70
  getSemrushRank = getSemrushRank_1.getSemrushRank;
68
71
  getDomainOrganic = getDomainOrganic_1.getDomainOrganic;
@@ -70,5 +73,8 @@ class SemrushAPIClient {
70
73
  getAdsCopies = getAdsCopies_1.getAdsCopies;
71
74
  getTrafficSummary = getTrafficSummary_1.getTrafficSummary;
72
75
  getKeywordDifficulty = getKeywordDifficulty_1.getKeywordDifficulty;
76
+ getBacklinks = getBacklinks_1.getBacklinks;
77
+ getAnchors = getAnchors_1.getAnchors;
78
+ getIndexedPages = getIndexedPages_1.getIndexedPages;
73
79
  }
74
80
  exports.SemrushAPIClient = SemrushAPIClient;
@@ -1,8 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getDomainOverview = getDomainOverview;
4
- async function getDomainOverview({ domain, export_columns = ["Dn", "Or", "Rk", "Ot", "Oc"], database = "us", display_limit = 1000, outputObj = true, // Default to true for output object
5
- }) {
4
+ async function getDomainOverview({ domain, export_columns = [
5
+ "Db",
6
+ "Dt",
7
+ "Dn",
8
+ "Rk",
9
+ "Or",
10
+ "Ot",
11
+ "Oc",
12
+ "Ad",
13
+ "At",
14
+ "Ac",
15
+ "Sh",
16
+ "Sv",
17
+ "FKn",
18
+ "FPn",
19
+ "Sr",
20
+ "Srb",
21
+ "St",
22
+ "Stb",
23
+ "Sc",
24
+ "Srn",
25
+ "Srl",
26
+ ], database = "us", display_limit = 1000, outputObj = true, }) {
6
27
  const params = {
7
28
  type: "domain_ranks",
8
29
  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.11",
3
+ "version": "0.1.13",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
File without changes
@@ -1 +0,0 @@
1
- "use strict";