Skip to content

DataForSEO new components #16717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import dataforseo from "../../dataforseo.app.mjs";

export default {
key: "dataforseo-get-backlinks-history",
name: "Get Backlinks History",
description:
"Get historical backlinks data back to the beginning of 2019. [See the documentation](https://docs.dataforseo.com/v3/backlinks/history/live/)",
version: "0.0.1",
type: "action",
methods: {
getBacklinksHistory(args = {}) {
return this.dataforseo._makeRequest({
path: "/backlinks/history/live",
method: "post",
...args,
});
},
},
props: {
dataforseo,
target: {
type: "string",
label: "Target Domain",
description: "Domain should be specified without `https://` and `www`",
},
dateFrom: {
type: "string",
label: "Starting Date",
description:
"Starting date of the time range, in `YYYY-MM-DD` format. Default and minimum value is `2019-01-01`",
optional: true,
},
dateTo: {
type: "string",
label: "End Date",
description:
"End date of the time range, in `YYYY-MM-DD` format. Default is today's date",
optional: true,
},
rankScale: {
propDefinition: [
dataforseo,
"rankScale",
],
},
tag: {
propDefinition: [
dataforseo,
"tag",
],
},
},
async run({ $ }) {
const response = await this.getBacklinksHistory({
$,
data: [
{
target: this.target,
date_from: this.dateFrom,
date_to: this.dateTo,
rank_scale: this.rankScale,
tag: this.tag,
},
],
});
$.export("$summary", "Successfully retrieved backlinks history");
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import dataforseo from "../../dataforseo.app.mjs";
import { parseObjectEntries } from "../../common/utils.mjs";

export default {
key: "dataforseo-get-backlinks-summary",
name: "Get Backlinks Summary",
description:
"Get an overview of backlinks data available for a given domain, subdomain, or webpage. [See the documentation](https://docs.dataforseo.com/v3/backlinks/summary/live/)",
version: "0.0.1",
type: "action",
methods: {
getBacklinksSummary(args = {}) {
return this.dataforseo._makeRequest({
path: "/backlinks/summary/live",
method: "post",
...args,
});
},
},
props: {
dataforseo,
target: {
propDefinition: [
dataforseo,
"backlinksTarget",
],
},
includeSubdomains: {
propDefinition: [
dataforseo,
"includeSubdomains",
],
},
includeIndirectLinks: {
propDefinition: [
dataforseo,
"includeIndirectLinks",
],
},
excludeInternalBacklinks: {
propDefinition: [
dataforseo,
"excludeInternalBacklinks",
],
},
backlinksStatusType: {
propDefinition: [
dataforseo,
"backlinksStatusType",
],
},
backlinksFilters: {
propDefinition: [
dataforseo,
"backlinksFilters",
],
},
rankScale: {
propDefinition: [
dataforseo,
"rankScale",
],
},
tag: {
propDefinition: [
dataforseo,
"tag",
],
},
additionalOptions: {
propDefinition: [
dataforseo,
"additionalOptions",
],
description: "Additional parameters to send in the request. [See the documentation](https://docs.dataforseo.com/v3/backlinks/summary/live/) for all available parameters. Values will be parsed as JSON where applicable.",
},
},
async run({ $ }) {
const response = await this.getBacklinksSummary({
$,
data: [
{
target: this.target,
include_subdomains: this.includeSubdomains,
include_indirect_links: this.includeIndirectLinks,
exclude_internal_backlinks: this.excludeInternalBacklinks,
backlinks_status_type: this.backlinksStatusType,
backlinks_filters: this.backlinksFilters,
rank_scale: this.rankScale,
tag: this.tag,
...parseObjectEntries(this.additionalOptions),
},
],
});
$.export(
"$summary",
"Successfully retrieved backlink summary",
);
return response;
},
};
97 changes: 97 additions & 0 deletions components/dataforseo/actions/get-backlinks/get-backlinks.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import { parseObjectEntries } from "../../common/utils.mjs";
import dataforseo from "../../dataforseo.app.mjs";

export default {
key: "dataforseo-get-backlinks",
name: "Get Backlinks",
description:
"Get a list of backlinks and relevant data for a given domain, subdomain, or webpage. [See the documentation](https://docs.dataforseo.com/v3/backlinks/backlinks/live/)",
version: "0.0.1",
type: "action",
methods: {
getBacklinks(args = {}) {
return this.dataforseo._makeRequest({
path: "/backlinks/backlinks/live",
method: "post",
...args,
});
},
},
props: {
dataforseo,
target: {
propDefinition: [
dataforseo,
"backlinksTarget",
],
},
mode: {
type: "string",
label: "Mode",
description: "Select the mode of grouping the results",
options: [
{
value: "as_is",
label: "returns all backlinks",
},
{
value: "one_per_domain",
label: "returns one backlink per domain",
},
{
value: "one_per_anchor",
label: "returns one backlink per anchor",
},
],
default: "as_is",
},
filters: {
propDefinition: [
dataforseo,
"backlinksFilters",
],
},
order_by: {
type: "string[]",
label: "Order By",
description: "One or more rules to sort results with, with each entry being a field and a direction (`asc` for ascending or `desc` for descending). Example: [\"domain_from_rank,desc\",\"page_from_rank,asc\"]",
},
rankScale: {
propDefinition: [
dataforseo,
"rankScale",
],
},
tag: {
propDefinition: [
dataforseo,
"tag",
],
},
additionalOptions: {
propDefinition: [
dataforseo,
"additionalOptions",
],
description: "Additional parameters to send in the request. [See the documentation](https://docs.dataforseo.com/v3/backlinks/backlinks/live/) for all available parameters. Values will be parsed as JSON where applicable.",
},
},
async run({ $ }) {
const response = await this.getBacklinks({
$,
data: [
{
target: this.target,
mode: this.mode,
filters: this.filters,
order_by: this.order_by,
rank_scale: this.rankScale,
tag: this.tag,
...parseObjectEntries(this.additionalOptions),
},
],
});
$.export("$summary", "Successfully retrieved backlinks data");
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import dataforseo from "../../dataforseo.app.mjs";

export default {
key: "dataforseo-get-bulk-backlinks",
name: "Get Bulk Backlinks",
description:
"Get the number of backlinks pointing to specified domains, subdomains, and pages. [See the documentation](https://docs.dataforseo.com/v3/backlinks/bulk_backlinks/live/)",
version: "0.0.1",
type: "action",
methods: {
getBulkBacklinks(args = {}) {
return this.dataforseo._makeRequest({
path: "/backlinks/bulk_backlinks/live",
method: "post",
...args,
});
},
},
props: {
dataforseo,
targets: {
propDefinition: [
dataforseo,
"targets",
],
},
tag: {
propDefinition: [
dataforseo,
"tag",
],
},
},
async run({ $ }) {
const response = await this.getBulkBacklinks({
$,
data: [
{
targets: this.targets,
tag: this.tag,
},
],
});
$.export("$summary", "Successfully retrieved bulk backlinks");
return response;
},
};
54 changes: 54 additions & 0 deletions components/dataforseo/actions/get-bulk-ranks/get-bulk-ranks.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import dataforseo from "../../dataforseo.app.mjs";

export default {
key: "dataforseo-get-bulk-ranks",
name: "Get Bulk Ranks",
description:
"Get rank scores of specified domains, subdomains, and pages. [See the documentation](https://docs.dataforseo.com/v3/backlinks/bulk_ranks/live/)",
version: "0.0.1",
type: "action",
methods: {
getBacklinksBulkRanks(args = {}) {
return this.dataforseo._makeRequest({
path: "/backlinks/bulk_ranks/live",
method: "post",
...args,
});
},
},
props: {
dataforseo,
targets: {
propDefinition: [
dataforseo,
"targets",
],
},
rankScale: {
propDefinition: [
dataforseo,
"rankScale",
],
},
tag: {
propDefinition: [
dataforseo,
"tag",
],
},
},
async run({ $ }) {
const response = await this.getBacklinksBulkRanks({
$,
data: [
{
targets: this.targets,
rank_scale: this.rankScale,
tag: this.tag,
},
],
});
$.export("$summary", "Successfully retrieved bulk ranks");
return response;
},
};
Loading
Loading