8
n8n 中文网amn8n.com

使用谷歌爬取、Bright Data和Gemini AI分析关键词搜索意图

高级

这是一个Market Research, AI Summarization领域的自动化工作流,包含 24 个节点。主要使用 Set, Merge, SplitOut, HttpRequest, GoogleSheets 等节点。 使用谷歌爬取、Bright Data和Gemini AI分析关键词搜索意图

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "db80165df40cb07c0377167c050b3f9ab0b0fb04f0e8cae0dc53f5a8527103ca",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "63865e5c-9e83-49ad-8d51-02391ee9e36c",
      "name": "点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -920,
        -700
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e935f831-25e0-4325-b0a4-72dd632c6c46",
      "name": "获取 Google 搜索结果 JSON",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -20,
        -680
      ],
      "parameters": {
        "url": "https://api.brightdata.com/request",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "sendBody": true,
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "zone",
              "value": "serp_api1"
            },
            {
              "name": "url",
              "value": "=https://www.google.com/search?q={{ $json.search_term .replaceAll(\" \", \"+\")}}&start=0&brd_json=1"
            },
            {
              "name": "country",
              "value": "={{ $json['country code'] }}"
            },
            {
              "name": "format",
              "value": "raw"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "async",
              "value": "true"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "gfLRVcGG09VEZv5B",
          "name": "Brightdata Header"
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "91fa9b7c-626d-48aa-9728-2126f75be833",
      "name": "分离",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        160,
        -680
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "organic"
      },
      "typeVersion": 1
    },
    {
      "id": "ee4881f0-9148-493e-825e-ce2dde83fbae",
      "name": "获取关键词",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -700,
        -700
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit#gid=0",
          "cachedResultName": "Keywords to Track"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit?usp=drivesdk",
          "cachedResultName": "Position Tracking for Keyword + Dashboard "
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ZAI2a6Qt80kX5a9s",
          "name": "Google Sheets account✅ "
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "69fff95a-24de-4331-89a8-14d4ea25c066",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -460,
        -700
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "c4d31168-a21a-44ba-8cb6-a4a51167aa49",
      "name": "格式化字段",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        -680
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "bcca5d0b-e07d-4488-9e7f-4454bb7d2924",
              "name": "Keyword",
              "type": "string",
              "value": "={{ $('set keyword').item.json.search_term }}"
            },
            {
              "id": "d39c09ec-b94a-4d38-8ba1-5f54395186de",
              "name": "ranking page",
              "type": "string",
              "value": "={{ $json.link }}"
            },
            {
              "id": "a167b825-4324-42a5-bb16-9ae5d40b20eb",
              "name": "title",
              "type": "string",
              "value": "={{ $json.title }}"
            },
            {
              "id": "035f315b-1199-4e1a-bc1d-8055774cc290",
              "name": "Meta description",
              "type": "string",
              "value": "={{ $json.description }}"
            },
            {
              "id": "8c6b4298-420c-4648-9438-864ca9d9cb72",
              "name": "extensions",
              "type": "string",
              "value": "={{ $json.extensions?.toJsonString() }}"
            },
            {
              "id": "243329e0-2cae-4e75-a589-1ea098614ae5",
              "name": "position ",
              "type": "number",
              "value": "={{ $json.rank }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ee815b25-9a77-4bb5-96f8-54e26a8dcb6e",
      "name": "追加排名结果",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1300,
        -680
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "position ",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "position ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ranking page",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ranking page",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Meta description",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Meta description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Keyword",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Keyword",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "extensions",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "extensions",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "intent",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "intent",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "ranking page"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1031244896,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit#gid=1031244896",
          "cachedResultName": "Sheet2"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit?usp=drivesdk",
          "cachedResultName": "Position Tracking for Keyword + Dashboard "
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ZAI2a6Qt80kX5a9s",
          "name": "Google Sheets account✅ "
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "baf30b06-9307-4c35-94f1-0c7342a08604",
      "name": "意图分类器",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        500,
        -720
      ],
      "parameters": {
        "options": {},
        "inputText": "=Keyword: {{  $json.Keyword}}\n\nTop pages title  : {{ $json.title }}\n\nmeta descriptions : {{ $json.description }}",
        "categories": {
          "categories": [
            {
              "category": "Informational",
              "description": "=The user wants to learn something (e.g., guides, tutorials, definitions)"
            },
            {
              "category": "Navigational",
              "description": "The user is looking for a specific brand or website."
            },
            {
              "category": "Commercial",
              "description": "=The user is researching products/services before making a purchase."
            },
            {
              "category": "Transactional",
              "description": "=The user is ready to take action or make a purchase (e.g., sign up, buy, download)."
            },
            {
              "category": "Mixed",
              "description": "=If results show multiple types equally (e.g., some blogs, some product pages)."
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "430917d7-75ea-481b-ae98-f11997f97863",
      "name": "Google Gemini 聊天模型2",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        520,
        -480
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "Xp5T9q3YYxBIw2nd",
          "name": "Google Gemini(PaLM) Api account✅"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2cd17548-dc51-4b6a-a13f-ee3c60146412",
      "name": "信息型",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        -1000
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f02fd6cc-9d46-47a0-9e65-cf0436c92ae7",
              "name": "intent",
              "type": "string",
              "value": "informational"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "1b6604e2-aefb-4c5b-929c-633161b0871b",
      "name": "导航型",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        -840
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f02fd6cc-9d46-47a0-9e65-cf0436c92ae7",
              "name": "intent",
              "type": "string",
              "value": "Navigational"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "b4bd39b8-ae9d-4a6a-9cdb-3cdb86b218eb",
      "name": "商业型",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        -680
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f02fd6cc-9d46-47a0-9e65-cf0436c92ae7",
              "name": "intent",
              "type": "string",
              "value": "Commercial"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "60e4efd2-52cc-44cb-9f6f-541a187364f0",
      "name": "交易型",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        -540
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f02fd6cc-9d46-47a0-9e65-cf0436c92ae7",
              "name": "intent",
              "type": "string",
              "value": "Transactional"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "6cdb9432-caff-4338-986e-ecde27f7d8bb",
      "name": "混合型",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        -400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f02fd6cc-9d46-47a0-9e65-cf0436c92ae7",
              "name": "intent",
              "type": "string",
              "value": "Mixed"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "7d335e4f-c521-4711-9aeb-e6e4c861fc4c",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        -940
      ],
      "parameters": {
        "color": 2,
        "width": 320,
        "height": 620,
        "content": "## 分析排名靠前页面的意图"
      },
      "typeVersion": 1
    },
    {
      "id": "ca13d5f0-8bbe-464b-9778-18dee7b959ea",
      "name": "合并意图",
      "type": "n8n-nodes-base.merge",
      "position": [
        1120,
        -720
      ],
      "parameters": {
        "numberInputs": 5
      },
      "typeVersion": 3.2
    },
    {
      "id": "ad137e75-05e9-4582-981f-43f6df6becbf",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1260,
        -780
      ],
      "parameters": {
        "width": 260,
        "height": 280,
        "content": "## 工作原理"
      },
      "typeVersion": 1
    },
    {
      "id": "ad89de82-a005-4851-8c40-102b83f3c912",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        -820
      ],
      "parameters": {
        "width": 220,
        "height": 320,
        "content": "- 复制此 [Google 表格](https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit?usp=sharing)"
      },
      "typeVersion": 1
    },
    {
      "id": "571a1981-a9f3-4b66-8c9f-3d4779425df6",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        -820
      ],
      "parameters": {
        "color": 5,
        "width": 200,
        "height": 340,
        "content": "- 我们逐个遍历每个项目"
      },
      "typeVersion": 1
    },
    {
      "id": "5b39d950-56e9-4069-81f0-8a061a56795d",
      "name": "设置关键词",
      "type": "n8n-nodes-base.set",
      "position": [
        -180,
        -680
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cee3c6fe-dc44-43b2-9243-a1f1a62f9fa1",
              "name": "search_term",
              "type": "string",
              "value": "={{ $json.Keyword }}"
            },
            {
              "id": "3c58a493-6d15-4b90-bc5a-154d6f6d6474",
              "name": "country code",
              "type": "string",
              "value": "={{ $json['country code'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "72f54c66-32df-45a4-8b1d-84a02cc7c4b8",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        -800
      ],
      "parameters": {
        "color": 4,
        "width": 340,
        "height": 320,
        "content": "- 映射关键词和国家代码"
      },
      "typeVersion": 1
    },
    {
      "id": "336c7e9e-6d26-46d4-96b6-ebbcea39411b",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        -460
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 280,
        "content": "## 在 Bright Data 中设置 SERP 抓取器"
      },
      "typeVersion": 1
    },
    {
      "id": "bb416232-7254-499e-98e5-6495ebd35e8d",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        840,
        -1060
      ],
      "parameters": {
        "color": 6,
        "width": 200,
        "height": 820,
        "content": "- 为每个路径或输出设置意图字段名称"
      },
      "typeVersion": 1
    },
    {
      "id": "24866dbb-0b4f-4f36-8ed6-a474b51455ac",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1260,
        -780
      ],
      "parameters": {
        "width": 220,
        "height": 360,
        "content": "- 将排名靠前的页面追加到 Google 表格以供进一步分析"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Mixed": {
      "main": [
        [
          {
            "node": "Merge intents",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "format fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Commercial": {
      "main": [
        [
          {
            "node": "Merge intents",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "set keyword": {
      "main": [
        [
          {
            "node": "Fetch Google Search Results JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Keywords": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Navigational": {
      "main": [
        [
          {
            "node": "Merge intents",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge intents": {
      "main": [
        [
          {
            "node": "append ranking result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transactional": {
      "main": [
        [
          {
            "node": "Merge intents",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "format fields": {
      "main": [
        [
          {
            "node": "Intent Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "informational": {
      "main": [
        [
          {
            "node": "Merge intents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "set keyword",
            "type": "main",
            "index": 0
          },
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Intent Classifier": {
      "main": [
        [
          {
            "node": "informational",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Navigational",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Commercial",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Transactional",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mixed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Intent Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Google Search Results JSON": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get Keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 市场调研, AI 摘要总结

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量24
分类2
节点类型10
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Zacharia Kimotho

Zacharia Kimotho

@imperolq

Automation expert with years of experience helping businesses improve their efficiency and productivity with smart automations that are affordable, scalable, and flexible.

外部链接
在 n8n.io 查看

分享此工作流