semrush-api-client 0.1.4 → 0.1.5
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/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# semrush-api-client
|
|
2
2
|
[](https://github.com//RenKoya1/semrush-api-client)
|
|
3
|
+
[](https://www.npmjs.com/package/semrush-api-client)
|
|
3
4
|
|
|
4
5
|
A Node.js/TypeScript client for accessing the SEMrush API easily.
|
|
5
6
|
|
package/dist/client/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { getDomainRank } from "../domain/getDomainRank";
|
|
|
2
2
|
import { getPhraseAll } from "../keyword/getPhrase";
|
|
3
3
|
import { backlinksOverview } from "../backlinks/backlinksOverview";
|
|
4
4
|
import { getRankDifference } from "../overview/getRankDifference";
|
|
5
|
+
import { getSemrushRank } from "../overview/getSemrushRank";
|
|
5
6
|
export declare class SemrushAPIClient {
|
|
6
7
|
private client;
|
|
7
8
|
private api_key;
|
|
@@ -16,4 +17,5 @@ export declare class SemrushAPIClient {
|
|
|
16
17
|
getPhrase: typeof getPhraseAll;
|
|
17
18
|
backlinksOverview: typeof backlinksOverview;
|
|
18
19
|
getRankDifference: typeof getRankDifference;
|
|
20
|
+
getSemrushRank: typeof getSemrushRank;
|
|
19
21
|
}
|
package/dist/client/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const getDomainRank_1 = require("../domain/getDomainRank");
|
|
|
9
9
|
const getPhrase_1 = require("../keyword/getPhrase");
|
|
10
10
|
const backlinksOverview_1 = require("../backlinks/backlinksOverview");
|
|
11
11
|
const getRankDifference_1 = require("../overview/getRankDifference");
|
|
12
|
+
const getSemrushRank_1 = require("../overview/getSemrushRank");
|
|
12
13
|
class SemrushAPIClient {
|
|
13
14
|
client;
|
|
14
15
|
api_key;
|
|
@@ -58,5 +59,6 @@ class SemrushAPIClient {
|
|
|
58
59
|
getPhrase = getPhrase_1.getPhraseAll;
|
|
59
60
|
backlinksOverview = backlinksOverview_1.backlinksOverview;
|
|
60
61
|
getRankDifference = getRankDifference_1.getRankDifference;
|
|
62
|
+
getSemrushRank = getSemrushRank_1.getSemrushRank;
|
|
61
63
|
}
|
|
62
64
|
exports.SemrushAPIClient = SemrushAPIClient;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SemrushAPIClient } from "../client";
|
|
2
|
+
import { Database } from "../type/general/database";
|
|
3
|
+
type ExportColumns = "Dn" | "Rk" | "Or" | "Ot" | "Oc" | "Ad" | "At" | "Ac" | "Sr" | "St" | "Sc";
|
|
4
|
+
export declare function getSemrushRank(this: SemrushAPIClient, { export_columns, database, display_limit, outputObj, }: {
|
|
5
|
+
export_columns?: ExportColumns[];
|
|
6
|
+
database?: Database;
|
|
7
|
+
display_limit?: number;
|
|
8
|
+
outputObj?: boolean;
|
|
9
|
+
}): Promise<string>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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, }) {
|
|
5
|
+
const params = {
|
|
6
|
+
type: "rank",
|
|
7
|
+
export_columns: export_columns.join(","),
|
|
8
|
+
database,
|
|
9
|
+
display_limit,
|
|
10
|
+
};
|
|
11
|
+
return this.get(this.BASE_URL, params, outputObj);
|
|
12
|
+
}
|