semrush-api-client 0.1.11 → 0.1.12
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 +1 -1
- package/dist/backlinks/backlinksOverview.js +2 -2
- package/dist/backlinks/getAnchors.d.ts +12 -0
- package/dist/backlinks/getAnchors.js +20 -0
- package/dist/backlinks/getBacklinks.d.ts +12 -0
- package/dist/backlinks/getBacklinks.js +37 -0
- package/dist/client/index.d.ts +6 -2
- package/dist/client/index.js +5 -1
- package/dist/overview/getDomainOverview.js +23 -2
- package/package.json +1 -1
- package/dist/domain/getDomainRank.d.ts +0 -0
- package/dist/domain/getDomainRank.js +0 -1
|
@@ -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
|
|
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.
|
|
4
|
-
async function
|
|
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
|
+
}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getDomainOverview } from "../overview/getDomainOverview";
|
|
2
2
|
import { getKeywordOverview } from "../keyword/getKeywordOverview";
|
|
3
|
-
import {
|
|
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,8 @@ 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";
|
|
11
13
|
export declare class SemrushAPIClient {
|
|
12
14
|
private client;
|
|
13
15
|
private api_key;
|
|
@@ -20,7 +22,7 @@ export declare class SemrushAPIClient {
|
|
|
20
22
|
get<T>(url: string, params?: Record<string, any>, outputObj?: boolean): Promise<T>;
|
|
21
23
|
getDomainOverview: typeof getDomainOverview;
|
|
22
24
|
getKeywordOverview: typeof getKeywordOverview;
|
|
23
|
-
|
|
25
|
+
getBacklinksOverview: typeof getBacklinksOverview;
|
|
24
26
|
getRankDifference: typeof getRankDifference;
|
|
25
27
|
getSemrushRank: typeof getSemrushRank;
|
|
26
28
|
getDomainOrganic: typeof getDomainOrganic;
|
|
@@ -28,4 +30,6 @@ export declare class SemrushAPIClient {
|
|
|
28
30
|
getAdsCopies: typeof getAdsCopies;
|
|
29
31
|
getTrafficSummary: typeof getTrafficSummary;
|
|
30
32
|
getKeywordDifficulty: typeof getKeywordDifficulty;
|
|
33
|
+
getBacklinks: typeof getBacklinks;
|
|
34
|
+
getAnchors: typeof getAnchors;
|
|
31
35
|
}
|
package/dist/client/index.js
CHANGED
|
@@ -15,6 +15,8 @@ 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");
|
|
18
20
|
class SemrushAPIClient {
|
|
19
21
|
client;
|
|
20
22
|
api_key;
|
|
@@ -62,7 +64,7 @@ class SemrushAPIClient {
|
|
|
62
64
|
}
|
|
63
65
|
getDomainOverview = getDomainOverview_1.getDomainOverview;
|
|
64
66
|
getKeywordOverview = getKeywordOverview_1.getKeywordOverview;
|
|
65
|
-
|
|
67
|
+
getBacklinksOverview = backlinksOverview_1.getBacklinksOverview;
|
|
66
68
|
getRankDifference = getRankDifference_1.getRankDifference;
|
|
67
69
|
getSemrushRank = getSemrushRank_1.getSemrushRank;
|
|
68
70
|
getDomainOrganic = getDomainOrganic_1.getDomainOrganic;
|
|
@@ -70,5 +72,7 @@ class SemrushAPIClient {
|
|
|
70
72
|
getAdsCopies = getAdsCopies_1.getAdsCopies;
|
|
71
73
|
getTrafficSummary = getTrafficSummary_1.getTrafficSummary;
|
|
72
74
|
getKeywordDifficulty = getKeywordDifficulty_1.getKeywordDifficulty;
|
|
75
|
+
getBacklinks = getBacklinks_1.getBacklinks;
|
|
76
|
+
getAnchors = getAnchors_1.getAnchors;
|
|
73
77
|
}
|
|
74
78
|
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 = [
|
|
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
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|