semrush-api-client 0.1.6 → 0.1.7
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/client/index.d.ts +4 -0
- package/dist/client/index.js +5 -1
- package/dist/domain/getAdsCopies.d.ts +11 -0
- package/dist/domain/getAdsCopies.js +13 -0
- package/dist/domain/getDomainOrganic.d.ts +2 -2
- package/dist/domain/getDomainPaidSearchKeywords.d.ts +13 -0
- package/dist/domain/getDomainPaidSearchKeywords.js +27 -0
- package/package.json +5 -2
package/dist/client/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { getPhraseAll } from "../keyword/getPhrase";
|
|
|
3
3
|
import { backlinksOverview } from "../backlinks/backlinksOverview";
|
|
4
4
|
import { getRankDifference } from "../overview/getRankDifference";
|
|
5
5
|
import { getDomainOrganic } from "../domain/getDomainOrganic";
|
|
6
|
+
import { getDomainPaidSearchKeywords } from "../domain/getDomainPaidSearchKeywords";
|
|
7
|
+
import { getAdsCopies } from "../domain/getAdsCopies";
|
|
6
8
|
import { getSemrushRank } from "../overview/getSemrushRank";
|
|
7
9
|
export declare class SemrushAPIClient {
|
|
8
10
|
private client;
|
|
@@ -20,4 +22,6 @@ export declare class SemrushAPIClient {
|
|
|
20
22
|
getRankDifference: typeof getRankDifference;
|
|
21
23
|
getSemrushRank: typeof getSemrushRank;
|
|
22
24
|
getDomainOrganic: typeof getDomainOrganic;
|
|
25
|
+
getDomainPaidSearchKeywords: typeof getDomainPaidSearchKeywords;
|
|
26
|
+
getAdsCopies: typeof getAdsCopies;
|
|
23
27
|
}
|
package/dist/client/index.js
CHANGED
|
@@ -10,6 +10,8 @@ const getPhrase_1 = require("../keyword/getPhrase");
|
|
|
10
10
|
const backlinksOverview_1 = require("../backlinks/backlinksOverview");
|
|
11
11
|
const getRankDifference_1 = require("../overview/getRankDifference");
|
|
12
12
|
const getDomainOrganic_1 = require("../domain/getDomainOrganic");
|
|
13
|
+
const getDomainPaidSearchKeywords_1 = require("../domain/getDomainPaidSearchKeywords");
|
|
14
|
+
const getAdsCopies_1 = require("../domain/getAdsCopies");
|
|
13
15
|
const getSemrushRank_1 = require("../overview/getSemrushRank");
|
|
14
16
|
class SemrushAPIClient {
|
|
15
17
|
client;
|
|
@@ -19,7 +21,7 @@ class SemrushAPIClient {
|
|
|
19
21
|
constructor({ api_key }) {
|
|
20
22
|
this.api_key = api_key;
|
|
21
23
|
this.client = axios_1.default.create({
|
|
22
|
-
timeout:
|
|
24
|
+
timeout: 14000,
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
27
|
parseCsvToObjects(csvString, delimiter = ";") {
|
|
@@ -62,5 +64,7 @@ class SemrushAPIClient {
|
|
|
62
64
|
getRankDifference = getRankDifference_1.getRankDifference;
|
|
63
65
|
getSemrushRank = getSemrushRank_1.getSemrushRank;
|
|
64
66
|
getDomainOrganic = getDomainOrganic_1.getDomainOrganic;
|
|
67
|
+
getDomainPaidSearchKeywords = getDomainPaidSearchKeywords_1.getDomainPaidSearchKeywords;
|
|
68
|
+
getAdsCopies = getAdsCopies_1.getAdsCopies;
|
|
65
69
|
}
|
|
66
70
|
exports.SemrushAPIClient = SemrushAPIClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
import { Database } from "../type/general/database";
|
|
3
|
+
type ExportColumns = "Tt" | "Ds" | "Vu" | "Ur" | "Pc" | "Un";
|
|
4
|
+
export declare function getAdsCopies(this: SemrushAPIClient, { domain, export_columns, database, display_limit, outputObj, }: {
|
|
5
|
+
domain: string;
|
|
6
|
+
export_columns?: ExportColumns[];
|
|
7
|
+
database?: Database;
|
|
8
|
+
outputObj?: boolean;
|
|
9
|
+
display_limit?: number;
|
|
10
|
+
}): Promise<string>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAdsCopies = getAdsCopies;
|
|
4
|
+
async function getAdsCopies({ domain, export_columns = ["Tt", "Ds", "Vu", "Ur", "Pc", "Un"], database = "us", display_limit = 1000, outputObj = true, }) {
|
|
5
|
+
const params = {
|
|
6
|
+
type: "domain_adwords_unique",
|
|
7
|
+
export_columns: export_columns.join(","),
|
|
8
|
+
domain,
|
|
9
|
+
database,
|
|
10
|
+
display_limit,
|
|
11
|
+
};
|
|
12
|
+
return this.get(this.BASE_URL, params, outputObj);
|
|
13
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SemrushAPIClient } from "../client";
|
|
2
2
|
import { Database } from "../type/general/database";
|
|
3
3
|
type ExportColumns = "Ph" | "Po" | "Pp" | "Pd" | "Nq" | "Cp" | "Ur" | "Tr" | "Tg" | "Tc" | "Co" | "Nr" | "Td" | "Kd" | "Fp" | "Fk" | "Ts" | "In" | "Pt";
|
|
4
|
-
type
|
|
4
|
+
type displayPositions = "new" | "lost" | "rise" | "fall";
|
|
5
5
|
type displayPositionType = "organic" | "all" | "serp_features";
|
|
6
6
|
export declare function getDomainOrganic(this: SemrushAPIClient, { domain, export_columns, database, displayPosition, displayPositionsType, display_limit, outputObj, }: {
|
|
7
7
|
domain: string;
|
|
8
8
|
export_columns?: ExportColumns[];
|
|
9
|
-
displayPosition?:
|
|
9
|
+
displayPosition?: displayPositions;
|
|
10
10
|
database?: Database;
|
|
11
11
|
outputObj?: boolean;
|
|
12
12
|
displayPositionsType?: displayPositionType;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
import { Database } from "../type/general/database";
|
|
3
|
+
type ExportColumns = "Ph" | "Po" | "Pp" | "Pd" | "Ab" | "Nq" | "Cp" | "Ur" | "Tr" | "Tg" | "Tc" | "Co" | "Nr" | "Td" | "Tt" | "Ds" | "Vu" | "Ur" | "Ts" | "Un";
|
|
4
|
+
type displayPositions = "new" | "lost" | "rise" | "fall";
|
|
5
|
+
export declare function getDomainPaidSearchKeywords(this: SemrushAPIClient, { domain, export_columns, database, displayPosition, display_limit, outputObj, }: {
|
|
6
|
+
domain: string;
|
|
7
|
+
export_columns?: ExportColumns[];
|
|
8
|
+
displayPosition?: displayPositions;
|
|
9
|
+
database?: Database;
|
|
10
|
+
outputObj?: boolean;
|
|
11
|
+
display_limit?: number;
|
|
12
|
+
}): Promise<string>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDomainPaidSearchKeywords = getDomainPaidSearchKeywords;
|
|
4
|
+
async function getDomainPaidSearchKeywords({ domain, export_columns = [
|
|
5
|
+
"Ph",
|
|
6
|
+
"Po",
|
|
7
|
+
"Pp",
|
|
8
|
+
"Pd",
|
|
9
|
+
"Nq",
|
|
10
|
+
"Cp",
|
|
11
|
+
"Vu",
|
|
12
|
+
"Tr",
|
|
13
|
+
"Tc",
|
|
14
|
+
"Co",
|
|
15
|
+
"Nr",
|
|
16
|
+
"Td",
|
|
17
|
+
], database = "us", displayPosition, display_limit = 1000, outputObj = true, }) {
|
|
18
|
+
const params = {
|
|
19
|
+
type: "domain_adwords",
|
|
20
|
+
export_columns: export_columns.join(","),
|
|
21
|
+
domain,
|
|
22
|
+
database,
|
|
23
|
+
display_position: displayPosition,
|
|
24
|
+
display_limit,
|
|
25
|
+
};
|
|
26
|
+
return this.get(this.BASE_URL, params, outputObj);
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semrush-api-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": "20"
|
|
20
20
|
},
|
|
21
|
-
"keywords": [
|
|
21
|
+
"keywords": [
|
|
22
|
+
"semrush",
|
|
23
|
+
"api"
|
|
24
|
+
],
|
|
22
25
|
"author": "",
|
|
23
26
|
"type": "commonjs",
|
|
24
27
|
"dependencies": {
|