{
  "id": "juEsSyZeSBq3BLlc",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Pull bulk domain backlink profiles to Google Sheets with DataForSEO",
  "tags": [],
  "nodes": [
    {
      "id": "e6d03a5c-814b-40f3-86b1-e47d7e4520ab",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b1320984-a398-44a3-9682-7acca50526e8",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        416,
        0
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "15e95410-a52d-4ff4-9b7d-4350676a440f",
      "name": "Update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1040,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Rank": "={{ $json.rank }}",
            "Target": "={{ $json.url }}",
            "Lost date": "={{ $json.lost_date?.toDateTime()?.format('yyyy-MM-dd') }}",
            "First seen": "={{ $json.first_seen.toDateTime().format('yyyy-MM-dd') }}",
            "Broken pages": "={{ $json.broken_pages }}",
            "Referring IPs": "={{ $json.referring_ips }}",
            "Referring pages": "={{ $json.referring_pages }}",
            "Broken backlinks": "={{ $json.broken_backlinks }}",
            "Main Domain Rank": "={{ $json.main_domain_rank }}",
            "Referring domains": "={{ $json.referring_domains }}",
            "Referring subnets": "={{ $json.referring_subnets }}",
            "Backlink Spam Score": "={{ $json.backlinks_spam_score }}",
            "Number of Backlinks": "={{ $json.backlinks }}",
            "Referring links TLD": "={{ $json.referring_links_tld }}",
            "Referring links types": "={{ $json.referring_links_types }}",
            "Referring main domains": "={{ $json.referring_main_domains }}",
            "Nofollow Referring pages": "={{ $json.referring_pages_nofollow }}",
            "Referring links countries": "={{ $json.referring_links_countries }}",
            "Nofollow referring domains": "={{ $json.referring_domains_nofollow }}",
            "Referring links attributes": "={{ $json.referring_links_attributes }}",
            "Referring semantic locations": "={{ $json.referring_links_semantic_locations }}",
            "Referring links platform types": "={{ $json.referring_links_platform_types }}",
            "Nofollow main referrring domains": "={{ $json.referring_main_domains_nofollow }}"
          },
          "schema": [
            {
              "id": "Target",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Target",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "First seen",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "First seen",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Lost date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Lost date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Rank",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Rank",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Main Domain Rank",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Main Domain Rank",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Number of Backlinks",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Number of Backlinks",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Backlink Spam Score",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Backlink Spam Score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Broken backlinks",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Broken backlinks",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Broken pages",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Broken pages",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Referring domains",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Referring domains",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Nofollow referring domains",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Nofollow referring domains",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Referring main domains",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Referring main domains",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Nofollow main referrring domains",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Nofollow main referrring domains",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Referring IPs",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Referring IPs",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Referring subnets",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Referring subnets",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Referring pages",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Referring pages",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Nofollow Referring pages",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Nofollow Referring pages",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Referring links TLD",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Referring links TLD",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Referring links types",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Referring links types",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Referring links attributes",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Referring links attributes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Referring links platform types",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Referring links platform types",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Referring semantic locations",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Referring semantic locations",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Referring links countries",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Referring links countries",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Target"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1965912569,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1SE3EZWnjSGLTxNc9pO17bOJQGUd_pFds7xOwOvc6cU8/edit#gid=1965912569",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1SE3EZWnjSGLTxNc9pO17bOJQGUd_pFds7xOwOvc6cU8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1SE3EZWnjSGLTxNc9pO17bOJQGUd_pFds7xOwOvc6cU8/edit?usp=drivesdk",
          "cachedResultName": "Bulk Domain Backlink Profile"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "63e79fd4-88ac-4daf-8df8-13508d25f27c",
      "name": "Get targets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        208,
        0
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1965912569,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1SE3EZWnjSGLTxNc9pO17bOJQGUd_pFds7xOwOvc6cU8/edit#gid=1965912569",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1SE3EZWnjSGLTxNc9pO17bOJQGUd_pFds7xOwOvc6cU8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1SE3EZWnjSGLTxNc9pO17bOJQGUd_pFds7xOwOvc6cU8/edit?usp=drivesdk",
          "cachedResultName": "Bulk Domain Backlink Profile"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "2c483d30-3910-4862-b7c9-3d6308fd1d78",
      "name": "Split out (items)",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        832,
        0
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "tasks[0].result[0].items"
      },
      "typeVersion": 1
    },
    {
      "id": "4c2e4338-ff2a-40a6-ad7c-8313f8e922d0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -144
      ],
      "parameters": {
        "color": 6,
        "width": 384,
        "height": 304,
        "content": "## Get targets\nCreate a Google Sheets connection and select the spreadsheet with targets. The sheet must have the same columns as in [this Example](https://docs.google.com/spreadsheets/d/1SE3EZWnjSGLTxNc9pO17bOJQGUd_pFds7xOwOvc6cU8/edit?usp=sharing)."
      },
      "typeVersion": 1
    },
    {
      "id": "ada552c6-3ba5-42f6-925b-cd17f33722ea",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -144
      ],
      "parameters": {
        "color": 6,
        "width": 592,
        "height": 304,
        "content": "## Get backlink profiles with DataForSEO and save the data to the spreadsheet\nCreate a DataForSEO connection.\nSelect the same spreadsheet with your targets as in the first Google Sheets node."
      },
      "typeVersion": 1
    },
    {
      "id": "543e0601-7cfb-44cc-9f2c-9d5147fa199b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        -208
      ],
      "parameters": {
        "width": 384,
        "height": 512,
        "content": "This workflow pulls detailed backlink profiles for multiple target domains using the DataForSEO Backlinks API, and organizes the results into a dedicated Google Sheet \u2013  all in one click.\n## How it works\n1. Triggers manually.\n2. Reads target domains from your Google Sheet.\n3. Sends the batch request to the DataForSEO Bulk Pages Summary endpoint.\n4. Fetches detailed backlink profiles for each domain.\n5. Writes the backlink profile data back to the Google Sheet row by row.\n\n## Setup steps\n1. Create or select your DataForSEO connection (use you[r API login and password](https://app.dataforseo.com/api-access)).\n2. Create or select your Google Sheets connection.\n3. Prepare your Google Sheet with target domains following the required column structure.\n4. Select the same spreadsheet in both Google Sheets nodes.\n5. Run the workflow.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "4a2cc33f-20c6-47ea-a48d-f999ecf89532",
      "name": "Get backlink profiles",
      "type": "n8n-nodes-dataforseo.dataForSeoBacklinksApi",
      "position": [
        624,
        0
      ],
      "parameters": {
        "operation": "get-bulk-pages-summary",
        "input_mode": "json",
        "targets_1000_json": "={{ $json.data.map(item => item.Target) }}"
      },
      "credentials": {
        "dataForSeoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "71cd8439-152e-454f-abdb-ed16ceb004ee",
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Get backlink profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get targets": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out (items)": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get backlink profiles": {
      "main": [
        [
          {
            "node": "Split out (items)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get targets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}