semrush-api-client 0.1.19 → 0.1.21
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/index.d.ts +5 -0
- package/dist/backlinks/index.js +13 -0
- package/dist/client/index.d.ts +9 -17
- package/dist/client/index.js +26 -34
- package/dist/domain/index.d.ts +4 -0
- package/dist/domain/index.js +11 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +8 -0
- package/dist/keyword/getKeywordDifficulty.js +1 -1
- package/dist/keyword/getKeywordOverview.js +1 -1
- package/dist/keyword/index.d.ts +5 -0
- package/dist/keyword/index.js +13 -0
- package/dist/overview/index.d.ts +2 -0
- package/dist/overview/index.js +7 -0
- package/dist/trend/index.d.ts +1 -0
- package/dist/trend/index.js +5 -0
- package/dist/url/getUrlOrganicSearchKeywords.d.ts +12 -0
- package/dist/url/getUrlOrganicSearchKeywords.js +32 -0
- package/dist/url/getUrlOverview.d.ts +13 -0
- package/dist/url/getUrlOverview.js +49 -0
- package/dist/url/getUrlPaidSearchKeywords.d.ts +12 -0
- package/dist/url/getUrlPaidSearchKeywords.js +28 -0
- package/dist/url/index.d.ts +3 -0
- package/dist/url/index.js +9 -0
- package/package.json +2 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReferringDomains = exports.getIndexedPages = exports.getAnchors = exports.getBacklinks = exports.getBacklinksOverview = void 0;
|
|
4
|
+
var backlinksOverview_1 = require("./backlinksOverview");
|
|
5
|
+
Object.defineProperty(exports, "getBacklinksOverview", { enumerable: true, get: function () { return backlinksOverview_1.getBacklinksOverview; } });
|
|
6
|
+
var getBacklinks_1 = require("./getBacklinks");
|
|
7
|
+
Object.defineProperty(exports, "getBacklinks", { enumerable: true, get: function () { return getBacklinks_1.getBacklinks; } });
|
|
8
|
+
var getAnchors_1 = require("./getAnchors");
|
|
9
|
+
Object.defineProperty(exports, "getAnchors", { enumerable: true, get: function () { return getAnchors_1.getAnchors; } });
|
|
10
|
+
var getIndexedPages_1 = require("./getIndexedPages");
|
|
11
|
+
Object.defineProperty(exports, "getIndexedPages", { enumerable: true, get: function () { return getIndexedPages_1.getIndexedPages; } });
|
|
12
|
+
var getReferringDomains_1 = require("./getReferringDomains");
|
|
13
|
+
Object.defineProperty(exports, "getReferringDomains", { enumerable: true, get: function () { return getReferringDomains_1.getReferringDomains; } });
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import { getDomainOverview } from "../domain
|
|
2
|
-
import { getKeywordOverview } from "../keyword
|
|
3
|
-
import { getBacklinksOverview } from "../backlinks
|
|
4
|
-
import { getRankDifference } from "../overview
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { getAdsCopies } from "../domain/getAdsCopies";
|
|
8
|
-
import { getTrafficSummary } from "../trend/getTrafficSummary";
|
|
9
|
-
import { getSemrushRank } from "../overview/getSemrushRank";
|
|
10
|
-
import { getKeywordDifficulty } from "../keyword/getKeywordDifficulty";
|
|
11
|
-
import { getBacklinks } from "../backlinks/getBacklinks";
|
|
12
|
-
import { getAnchors } from "../backlinks/getAnchors";
|
|
13
|
-
import { getIndexedPages } from "../backlinks/getIndexedPages";
|
|
14
|
-
import { getReferringDomains } from "../backlinks/getReferringDomains";
|
|
15
|
-
import { getRelatedKeywords } from "../keyword/getRelatedKeywords";
|
|
16
|
-
import { getPhraseQuestions } from "../keyword/getPhraseQuestions";
|
|
17
|
-
import { getBroadMatchKeywords } from "../keyword/getBroadMatchKeywords";
|
|
1
|
+
import { getDomainOverview, getDomainOrganicSearchKeywords, getDomainPaidSearchKeywords, getAdsCopies } from "../domain";
|
|
2
|
+
import { getKeywordOverview, getKeywordDifficulty, getRelatedKeywords, getPhraseQuestions, getBroadMatchKeywords } from "../keyword";
|
|
3
|
+
import { getBacklinksOverview, getBacklinks, getAnchors, getIndexedPages, getReferringDomains } from "../backlinks";
|
|
4
|
+
import { getRankDifference, getSemrushRank } from "../overview";
|
|
5
|
+
import { getTrafficSummary } from "../trend";
|
|
6
|
+
import { getUrlOverview, getUrlOrganicSearchKeywords, getUrlPaidSearchKeywords } from "../url";
|
|
18
7
|
export declare class SemrushAPIClient {
|
|
19
8
|
private client;
|
|
20
9
|
private api_key;
|
|
@@ -42,4 +31,7 @@ export declare class SemrushAPIClient {
|
|
|
42
31
|
getRelatedKeywords: typeof getRelatedKeywords;
|
|
43
32
|
getPhraseQuestions: typeof getPhraseQuestions;
|
|
44
33
|
getBroadMatchKeywords: typeof getBroadMatchKeywords;
|
|
34
|
+
getUrlOverview: typeof getUrlOverview;
|
|
35
|
+
getUrlOrganicSearchKeywords: typeof getUrlOrganicSearchKeywords;
|
|
36
|
+
getUrlPaidSearchKeywords: typeof getUrlPaidSearchKeywords;
|
|
45
37
|
}
|
package/dist/client/index.js
CHANGED
|
@@ -5,23 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SemrushAPIClient = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const getAdsCopies_1 = require("../domain/getAdsCopies");
|
|
15
|
-
const getTrafficSummary_1 = require("../trend/getTrafficSummary");
|
|
16
|
-
const getSemrushRank_1 = require("../overview/getSemrushRank");
|
|
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");
|
|
21
|
-
const getReferringDomains_1 = require("../backlinks/getReferringDomains");
|
|
22
|
-
const getRelatedKeywords_1 = require("../keyword/getRelatedKeywords");
|
|
23
|
-
const getPhraseQuestions_1 = require("../keyword/getPhraseQuestions");
|
|
24
|
-
const getBroadMatchKeywords_1 = require("../keyword/getBroadMatchKeywords");
|
|
8
|
+
const domain_1 = require("../domain");
|
|
9
|
+
const keyword_1 = require("../keyword");
|
|
10
|
+
const backlinks_1 = require("../backlinks");
|
|
11
|
+
const overview_1 = require("../overview");
|
|
12
|
+
const trend_1 = require("../trend");
|
|
13
|
+
const url_1 = require("../url");
|
|
25
14
|
class SemrushAPIClient {
|
|
26
15
|
client;
|
|
27
16
|
api_key;
|
|
@@ -67,22 +56,25 @@ class SemrushAPIClient {
|
|
|
67
56
|
}
|
|
68
57
|
}
|
|
69
58
|
}
|
|
70
|
-
getDomainOverview =
|
|
71
|
-
getKeywordOverview =
|
|
72
|
-
getBacklinksOverview =
|
|
73
|
-
getRankDifference =
|
|
74
|
-
getSemrushRank =
|
|
75
|
-
getDomainOrganicSearchKeywords =
|
|
76
|
-
getDomainPaidSearchKeywords =
|
|
77
|
-
getAdsCopies =
|
|
78
|
-
getTrafficSummary =
|
|
79
|
-
getKeywordDifficulty =
|
|
80
|
-
getBacklinks =
|
|
81
|
-
getAnchors =
|
|
82
|
-
getIndexedPages =
|
|
83
|
-
getReferringDomains =
|
|
84
|
-
getRelatedKeywords =
|
|
85
|
-
getPhraseQuestions =
|
|
86
|
-
getBroadMatchKeywords =
|
|
59
|
+
getDomainOverview = domain_1.getDomainOverview;
|
|
60
|
+
getKeywordOverview = keyword_1.getKeywordOverview;
|
|
61
|
+
getBacklinksOverview = backlinks_1.getBacklinksOverview;
|
|
62
|
+
getRankDifference = overview_1.getRankDifference;
|
|
63
|
+
getSemrushRank = overview_1.getSemrushRank;
|
|
64
|
+
getDomainOrganicSearchKeywords = domain_1.getDomainOrganicSearchKeywords;
|
|
65
|
+
getDomainPaidSearchKeywords = domain_1.getDomainPaidSearchKeywords;
|
|
66
|
+
getAdsCopies = domain_1.getAdsCopies;
|
|
67
|
+
getTrafficSummary = trend_1.getTrafficSummary;
|
|
68
|
+
getKeywordDifficulty = keyword_1.getKeywordDifficulty;
|
|
69
|
+
getBacklinks = backlinks_1.getBacklinks;
|
|
70
|
+
getAnchors = backlinks_1.getAnchors;
|
|
71
|
+
getIndexedPages = backlinks_1.getIndexedPages;
|
|
72
|
+
getReferringDomains = backlinks_1.getReferringDomains;
|
|
73
|
+
getRelatedKeywords = keyword_1.getRelatedKeywords;
|
|
74
|
+
getPhraseQuestions = keyword_1.getPhraseQuestions;
|
|
75
|
+
getBroadMatchKeywords = keyword_1.getBroadMatchKeywords;
|
|
76
|
+
getUrlOverview = url_1.getUrlOverview;
|
|
77
|
+
getUrlOrganicSearchKeywords = url_1.getUrlOrganicSearchKeywords;
|
|
78
|
+
getUrlPaidSearchKeywords = url_1.getUrlPaidSearchKeywords;
|
|
87
79
|
}
|
|
88
80
|
exports.SemrushAPIClient = SemrushAPIClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAdsCopies = exports.getDomainPaidSearchKeywords = exports.getDomainOrganicSearchKeywords = exports.getDomainOverview = void 0;
|
|
4
|
+
var getDomainOverview_1 = require("./getDomainOverview");
|
|
5
|
+
Object.defineProperty(exports, "getDomainOverview", { enumerable: true, get: function () { return getDomainOverview_1.getDomainOverview; } });
|
|
6
|
+
var getDomainOrganicSearchKeywords_1 = require("./getDomainOrganicSearchKeywords");
|
|
7
|
+
Object.defineProperty(exports, "getDomainOrganicSearchKeywords", { enumerable: true, get: function () { return getDomainOrganicSearchKeywords_1.getDomainOrganicSearchKeywords; } });
|
|
8
|
+
var getDomainPaidSearchKeywords_1 = require("./getDomainPaidSearchKeywords");
|
|
9
|
+
Object.defineProperty(exports, "getDomainPaidSearchKeywords", { enumerable: true, get: function () { return getDomainPaidSearchKeywords_1.getDomainPaidSearchKeywords; } });
|
|
10
|
+
var getAdsCopies_1 = require("./getAdsCopies");
|
|
11
|
+
Object.defineProperty(exports, "getAdsCopies", { enumerable: true, get: function () { return getAdsCopies_1.getAdsCopies; } });
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export * from "./client";
|
|
2
|
+
export * from "./domain";
|
|
3
|
+
export * from "./keyword";
|
|
4
|
+
export * from "./backlinks";
|
|
5
|
+
export * from "./overview";
|
|
6
|
+
export * from "./trend";
|
|
7
|
+
export * from "./url";
|
|
2
8
|
export * from "./type/general/country";
|
|
3
9
|
export * from "./type/general/exportColumns";
|
|
4
10
|
export * from "./type/general/database";
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
21
21
|
dotenv_1.default.config();
|
|
22
22
|
__exportStar(require("./client"), exports);
|
|
23
|
+
// Export all API functions by category
|
|
24
|
+
__exportStar(require("./domain"), exports);
|
|
25
|
+
__exportStar(require("./keyword"), exports);
|
|
26
|
+
__exportStar(require("./backlinks"), exports);
|
|
27
|
+
__exportStar(require("./overview"), exports);
|
|
28
|
+
__exportStar(require("./trend"), exports);
|
|
29
|
+
__exportStar(require("./url"), exports);
|
|
30
|
+
// Export types
|
|
23
31
|
__exportStar(require("./type/general/country"), exports);
|
|
24
32
|
__exportStar(require("./type/general/exportColumns"), exports);
|
|
25
33
|
__exportStar(require("./type/general/database"), exports);
|
|
@@ -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, outputObj = true, // Default to true for output object
|
|
4
|
+
async function getKeywordDifficulty({ phrases, export_columns = ["Ph", "Kd"], database = "us", 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, outputObj = true, // Default to true for output object
|
|
4
|
+
async function getKeywordOverview({ phrase, export_columns = ["Dt", "Db", "Ph", "Nq", "Cp", "Co", "Nr"], database = "us", outputObj = true, // Default to true for output object
|
|
5
5
|
}) {
|
|
6
6
|
const params = {
|
|
7
7
|
type: "phrase_all",
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { getKeywordOverview } from "./getKeywordOverview";
|
|
2
|
+
export { getKeywordDifficulty } from "./getKeywordDifficulty";
|
|
3
|
+
export { getRelatedKeywords } from "./getRelatedKeywords";
|
|
4
|
+
export { getPhraseQuestions } from "./getPhraseQuestions";
|
|
5
|
+
export { getBroadMatchKeywords } from "./getBroadMatchKeywords";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBroadMatchKeywords = exports.getPhraseQuestions = exports.getRelatedKeywords = exports.getKeywordDifficulty = exports.getKeywordOverview = void 0;
|
|
4
|
+
var getKeywordOverview_1 = require("./getKeywordOverview");
|
|
5
|
+
Object.defineProperty(exports, "getKeywordOverview", { enumerable: true, get: function () { return getKeywordOverview_1.getKeywordOverview; } });
|
|
6
|
+
var getKeywordDifficulty_1 = require("./getKeywordDifficulty");
|
|
7
|
+
Object.defineProperty(exports, "getKeywordDifficulty", { enumerable: true, get: function () { return getKeywordDifficulty_1.getKeywordDifficulty; } });
|
|
8
|
+
var getRelatedKeywords_1 = require("./getRelatedKeywords");
|
|
9
|
+
Object.defineProperty(exports, "getRelatedKeywords", { enumerable: true, get: function () { return getRelatedKeywords_1.getRelatedKeywords; } });
|
|
10
|
+
var getPhraseQuestions_1 = require("./getPhraseQuestions");
|
|
11
|
+
Object.defineProperty(exports, "getPhraseQuestions", { enumerable: true, get: function () { return getPhraseQuestions_1.getPhraseQuestions; } });
|
|
12
|
+
var getBroadMatchKeywords_1 = require("./getBroadMatchKeywords");
|
|
13
|
+
Object.defineProperty(exports, "getBroadMatchKeywords", { enumerable: true, get: function () { return getBroadMatchKeywords_1.getBroadMatchKeywords; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSemrushRank = exports.getRankDifference = void 0;
|
|
4
|
+
var getRankDifference_1 = require("./getRankDifference");
|
|
5
|
+
Object.defineProperty(exports, "getRankDifference", { enumerable: true, get: function () { return getRankDifference_1.getRankDifference; } });
|
|
6
|
+
var getSemrushRank_1 = require("./getSemrushRank");
|
|
7
|
+
Object.defineProperty(exports, "getSemrushRank", { enumerable: true, get: function () { return getSemrushRank_1.getSemrushRank; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getTrafficSummary } from "./getTrafficSummary";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTrafficSummary = void 0;
|
|
4
|
+
var getTrafficSummary_1 = require("./getTrafficSummary");
|
|
5
|
+
Object.defineProperty(exports, "getTrafficSummary", { enumerable: true, get: function () { return getTrafficSummary_1.getTrafficSummary; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
import { Database } from "../type/general/database";
|
|
3
|
+
export type ExportColumns = "Ph" | "Po" | "Pp" | "Nq" | "Cp" | "Co" | "Kd" | "Tr" | "Tg" | "Tc" | "Nr" | "Td" | "Fp" | "Fk" | "Ts" | "In" | "Pt";
|
|
4
|
+
export type DisplaySort = "po_asc" | "po_desc" | "tg_asc" | "tg_desc" | "tr_asc" | "tr_desc" | "tc_asc" | "tc_desc" | "nq_asc" | "nq_desc";
|
|
5
|
+
export declare function getUrlOrganicSearchKeywords(this: SemrushAPIClient, { url, export_columns, database, outputObj, display_limit, display_sort, }: {
|
|
6
|
+
url: string;
|
|
7
|
+
export_columns?: ExportColumns[];
|
|
8
|
+
database?: Database;
|
|
9
|
+
outputObj?: boolean;
|
|
10
|
+
display_limit?: number;
|
|
11
|
+
display_sort?: DisplaySort;
|
|
12
|
+
}): Promise<Record<string, string>[]>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUrlOrganicSearchKeywords = getUrlOrganicSearchKeywords;
|
|
4
|
+
function getUrlOrganicSearchKeywords({ url, export_columns = [
|
|
5
|
+
"Ph",
|
|
6
|
+
"Po",
|
|
7
|
+
"Pp",
|
|
8
|
+
"Nq",
|
|
9
|
+
"Cp",
|
|
10
|
+
"Co",
|
|
11
|
+
"Kd",
|
|
12
|
+
"Tr",
|
|
13
|
+
"Tg",
|
|
14
|
+
"Tc",
|
|
15
|
+
"Nr",
|
|
16
|
+
"Td",
|
|
17
|
+
"Fp",
|
|
18
|
+
"Fk",
|
|
19
|
+
"Ts",
|
|
20
|
+
"In",
|
|
21
|
+
"Pt",
|
|
22
|
+
], database = "us", outputObj = true, display_limit = 10, display_sort, }) {
|
|
23
|
+
const params = {
|
|
24
|
+
url,
|
|
25
|
+
type: "url_organic",
|
|
26
|
+
export_columns: export_columns.join(","),
|
|
27
|
+
database,
|
|
28
|
+
display_limit,
|
|
29
|
+
display_sort,
|
|
30
|
+
};
|
|
31
|
+
return this.get(this.BASE_URL, params, outputObj);
|
|
32
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
import { Database } from "../type/general/database";
|
|
3
|
+
export type ExportColumns = "Dn" | "Or" | "Xn" | "Ot" | "Oc" | "Ad" | "At" | "Ac" | "FKn" | "FPn" | "Ipu" | "Ip0" | "Ip1" | "Ip2" | "Ip3" | "Itu" | "It0" | "It1" | "It2" | "It3" | "Icu" | "Ic0" | "Ic1" | "Ic2" | "Ic3" | "Sr" | "Srb" | "St" | "Stb" | "Sc" | "Srn" | "Srl" | "Rk";
|
|
4
|
+
export type DisplaySort = "po_asc" | "po_desc" | "tg_asc" | "tg_desc" | "tr_asc" | "tr_desc" | "tc_asc" | "tc_desc" | "nq_asc" | "nq_desc" | "rk_asc" | "rk_desc" | "or_asc" | "or_desc" | "ot_asc" | "ot_desc" | "oc_asc" | "oc_desc" | "ad_asc" | "ad_desc" | "at_asc" | "at_desc" | "ac_asc" | "ac_desc";
|
|
5
|
+
export declare function getUrlOverview(this: SemrushAPIClient, { url, export_columns, // Default export columns
|
|
6
|
+
database, outputObj, // Default to true for output object
|
|
7
|
+
display_sort, }: {
|
|
8
|
+
url: string;
|
|
9
|
+
export_columns?: ExportColumns[];
|
|
10
|
+
database?: Database;
|
|
11
|
+
outputObj?: boolean;
|
|
12
|
+
display_sort?: DisplaySort;
|
|
13
|
+
}): Promise<Record<string, string>[]>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUrlOverview = getUrlOverview;
|
|
4
|
+
function getUrlOverview({ url, export_columns = [
|
|
5
|
+
"Dn",
|
|
6
|
+
"Or",
|
|
7
|
+
"Xn",
|
|
8
|
+
"Ot",
|
|
9
|
+
"Oc",
|
|
10
|
+
"Ad",
|
|
11
|
+
"At",
|
|
12
|
+
"Ac",
|
|
13
|
+
"FKn",
|
|
14
|
+
"FPn",
|
|
15
|
+
"Ipu",
|
|
16
|
+
"Ip0",
|
|
17
|
+
"Ip1",
|
|
18
|
+
"Ip2",
|
|
19
|
+
"Ip3",
|
|
20
|
+
"Itu",
|
|
21
|
+
"It0",
|
|
22
|
+
"It1",
|
|
23
|
+
"It2",
|
|
24
|
+
"It3",
|
|
25
|
+
"Icu",
|
|
26
|
+
"Ic0",
|
|
27
|
+
"Ic1",
|
|
28
|
+
"Ic2",
|
|
29
|
+
"Ic3",
|
|
30
|
+
"Sr",
|
|
31
|
+
"Srb",
|
|
32
|
+
"St",
|
|
33
|
+
"Stb",
|
|
34
|
+
"Sc",
|
|
35
|
+
"Srn",
|
|
36
|
+
"Srl",
|
|
37
|
+
"Rk",
|
|
38
|
+
], // Default export columns
|
|
39
|
+
database = "us", outputObj = true, // Default to true for output object
|
|
40
|
+
display_sort, }) {
|
|
41
|
+
const params = {
|
|
42
|
+
url,
|
|
43
|
+
type: "url_rank",
|
|
44
|
+
export_columns: export_columns.join(","),
|
|
45
|
+
database,
|
|
46
|
+
display_sort,
|
|
47
|
+
};
|
|
48
|
+
return this.get(this.BASE_URL, params, outputObj);
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
import { Database } from "../type/general/database";
|
|
3
|
+
export type ExportColumns = "Ph" | "Po" | "Nq" | "Cp" | "Co" | "Tg" | "Tr" | "Tc" | "Nr" | "Td" | "Tt" | "Ds" | "Ts";
|
|
4
|
+
export type DisplaySort = "po_asc" | "po_desc" | "tg_asc" | "tg_desc" | "tr_asc" | "tr_desc" | "tc_asc" | "tc_desc" | "nq_asc" | "nq_desc";
|
|
5
|
+
export declare function getUrlPaidSearchKeywords(this: SemrushAPIClient, { url, export_columns, database, display_sort, outputObj, display_limit, }: {
|
|
6
|
+
url: string;
|
|
7
|
+
export_columns?: ExportColumns[];
|
|
8
|
+
database?: Database;
|
|
9
|
+
display_sort?: DisplaySort;
|
|
10
|
+
outputObj?: boolean;
|
|
11
|
+
display_limit?: number;
|
|
12
|
+
}): Promise<Record<string, string>[]>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUrlPaidSearchKeywords = getUrlPaidSearchKeywords;
|
|
4
|
+
function getUrlPaidSearchKeywords({ url, export_columns = [
|
|
5
|
+
"Ph",
|
|
6
|
+
"Po",
|
|
7
|
+
"Nq",
|
|
8
|
+
"Cp",
|
|
9
|
+
"Co",
|
|
10
|
+
"Tg",
|
|
11
|
+
"Tr",
|
|
12
|
+
"Tc",
|
|
13
|
+
"Nr",
|
|
14
|
+
"Td",
|
|
15
|
+
"Tt",
|
|
16
|
+
"Ds",
|
|
17
|
+
"Ts",
|
|
18
|
+
], database = "us", display_sort, outputObj = true, display_limit = 10, }) {
|
|
19
|
+
const params = {
|
|
20
|
+
url,
|
|
21
|
+
type: "url_adwords",
|
|
22
|
+
export_columns: export_columns.join(","),
|
|
23
|
+
database,
|
|
24
|
+
display_sort,
|
|
25
|
+
display_limit,
|
|
26
|
+
};
|
|
27
|
+
return this.get(this.BASE_URL, params, outputObj);
|
|
28
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUrlPaidSearchKeywords = exports.getUrlOrganicSearchKeywords = exports.getUrlOverview = void 0;
|
|
4
|
+
var getUrlOverview_1 = require("./getUrlOverview");
|
|
5
|
+
Object.defineProperty(exports, "getUrlOverview", { enumerable: true, get: function () { return getUrlOverview_1.getUrlOverview; } });
|
|
6
|
+
var getUrlOrganicSearchKeywords_1 = require("./getUrlOrganicSearchKeywords");
|
|
7
|
+
Object.defineProperty(exports, "getUrlOrganicSearchKeywords", { enumerable: true, get: function () { return getUrlOrganicSearchKeywords_1.getUrlOrganicSearchKeywords; } });
|
|
8
|
+
var getUrlPaidSearchKeywords_1 = require("./getUrlPaidSearchKeywords");
|
|
9
|
+
Object.defineProperty(exports, "getUrlPaidSearchKeywords", { enumerable: true, get: function () { return getUrlPaidSearchKeywords_1.getUrlPaidSearchKeywords; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semrush-api-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": "20"
|
|
20
|
+
"node": ">=20"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
23
23
|
"semrush",
|