|
| 1 | +import app from "../../dataforseo.app.mjs"; |
| 2 | + |
| 3 | +export default { |
| 4 | + key: "dataforseo-get-backlink-summary", |
| 5 | + name: "Get Backlink Summary", |
| 6 | + description: |
| 7 | + "Get an overview of backlinks data available for a given domain, subdomain, or webpage. [See the documentation](https://docs.dataforseo.com/v3/business_data/business_listings/search/live/?bash)", |
| 8 | + version: "0.0.1", |
| 9 | + type: "action", |
| 10 | + methods: { |
| 11 | + getBacklinkSummary(args = {}) { |
| 12 | + return this._makeRequest({ |
| 13 | + path: "/backlinks/summary/live", |
| 14 | + method: "post", |
| 15 | + ...args, |
| 16 | + }); |
| 17 | + }, |
| 18 | + }, |
| 19 | + props: { |
| 20 | + app, |
| 21 | + target: { |
| 22 | + type: "string", |
| 23 | + label: "Target", |
| 24 | + description: |
| 25 | + "Domain, subdomain or webpage to get data for. A domain or a subdomain should be specified without `https://` and `www`. A page should be specified with absolute URL (including `http://` or `https://`", |
| 26 | + }, |
| 27 | + includeSubdomains: { |
| 28 | + type: "boolean", |
| 29 | + label: "Include Subdomains", |
| 30 | + description: |
| 31 | + "Whether the subdomains of the `target` will be included in the search. Default is `true`", |
| 32 | + optional: true, |
| 33 | + }, |
| 34 | + includeIndirectLinks: { |
| 35 | + type: "boolean", |
| 36 | + label: "Include Indirect Links", |
| 37 | + description: |
| 38 | + "Whether indirect links to the target will be included in the results. Default is `true`", |
| 39 | + optional: true, |
| 40 | + }, |
| 41 | + excludeInternalBacklinks: { |
| 42 | + type: "boolean", |
| 43 | + label: "Exclude Internal Backlinks", |
| 44 | + description: |
| 45 | + "Indicates if internal backlinks from subdomains to the target will be excluded from the results. Default is `true`", |
| 46 | + optional: true, |
| 47 | + }, |
| 48 | + internalListLimit: { |
| 49 | + type: "integer", |
| 50 | + label: "Internal List Limit", |
| 51 | + description: |
| 52 | + "Maximum number of elements within internal arrays. [See the documentation](https://docs.dataforseo.com/v3/backlinks/summary/live/?bash#internal_list_limit) for more information", |
| 53 | + default: 10, |
| 54 | + max: 1000, |
| 55 | + optional: true, |
| 56 | + }, |
| 57 | + backlinksStatusType: { |
| 58 | + type: "string", |
| 59 | + label: "Include Indirect Links", |
| 60 | + description: |
| 61 | + "You can use this field to choose what backlinks will be returned and used for aggregated metrics for your target", |
| 62 | + optional: true, |
| 63 | + options: [ |
| 64 | + { |
| 65 | + value: "all", |
| 66 | + label: "All backlinks will be returned and counted", |
| 67 | + }, |
| 68 | + { |
| 69 | + value: "live", |
| 70 | + label: |
| 71 | + "Backlinks found during the last check will be returned and counted", |
| 72 | + }, |
| 73 | + { |
| 74 | + value: "lost", |
| 75 | + label: "Lost backlinks will be returned and counted", |
| 76 | + }, |
| 77 | + ], |
| 78 | + default: "live", |
| 79 | + }, |
| 80 | + backlinksFilters: { |
| 81 | + type: "string[]", |
| 82 | + label: "Backlinks Filters", |
| 83 | + description: |
| 84 | + "You can use this field to filter the initial backlinks that will be included in the dataset for aggregated metrics for your target. [See the documentation](https://docs.dataforseo.com/v3/backlinks/summary/live/?bash#backlinks_filters) for more information. Example: `[\"dofollow\", \"=\", true]`", |
| 85 | + optional: true, |
| 86 | + }, |
| 87 | + rankScale: { |
| 88 | + type: "string", |
| 89 | + label: "Rank Scale", |
| 90 | + description: |
| 91 | + "Whether rank values are presented on a 0-100 or 0-1000 scale", |
| 92 | + optional: true, |
| 93 | + options: [ |
| 94 | + "one_hundred", |
| 95 | + "one_thousand", |
| 96 | + ], |
| 97 | + default: "one_thousand", |
| 98 | + }, |
| 99 | + tag: { |
| 100 | + type: "string", |
| 101 | + label: "Tag", |
| 102 | + description: |
| 103 | + "You can use this parameter to identify the task and match it with the result.", |
| 104 | + optional: true, |
| 105 | + }, |
| 106 | + }, |
| 107 | + async run({ $ }) { |
| 108 | + const response = await this.getBacklinkSummary({ |
| 109 | + $, |
| 110 | + data: [ |
| 111 | + { |
| 112 | + target: this.target, |
| 113 | + include_subdomains: this.includeSubdomains, |
| 114 | + include_indirect_links: this.includeIndirectLinks, |
| 115 | + exclude_internal_backlinks: this.excludeInternalBacklinks, |
| 116 | + internal_list_limit: this.internalListLimit, |
| 117 | + backlinks_status_type: this.backlinksStatusType, |
| 118 | + backlinks_filters: this.backlinksFilters, |
| 119 | + rank_scale: this.rankScale, |
| 120 | + tag: this.tag, |
| 121 | + }, |
| 122 | + ], |
| 123 | + }); |
| 124 | + $.export( |
| 125 | + "$summary", |
| 126 | + "Successfully retrieved backlink summary", |
| 127 | + ); |
| 128 | + return response; |
| 129 | + }, |
| 130 | +}; |
0 commit comments