8
n8n 中文网amn8n.com

14 - 域名流量丰富器

中级

这是一个Market Research, Multimodal AI领域的自动化工作流,包含 9 个节点。主要使用 Set, Code, Airtable, HttpRequest, GoogleSheets 等节点。 在Google表格和Airtable中使用SimilarWeb流量分析丰富域名数据

前置要求
  • Airtable API Key
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "name": "14 - 域名流量丰富器",
  "tags": [],
  "nodes": [
    {
      "id": "541d74fd-8229-442d-8805-3485c0f183ba",
      "name": "🟢 表格触发器:新域名",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -1740,
        60
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID_HERE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit?usp=drivesdk",
          "cachedResultName": "Companies List"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "YOUR_GOOGLE_SHEETS_CREDENTIAL_ID",
          "name": "Google Sheets Trigger account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cc51b573-cf22-44ea-8c77-60e12187b348",
      "name": "🧼 清理域名 URL",
      "type": "n8n-nodes-base.set",
      "position": [
        -1520,
        60
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "domain_cleanup",
              "name": "domain",
              "type": "string",
              "value": "={{ $json.List.replace(/^https?:\\/\\//, '').replace(/^www\\./, '').replace(/\\/$/, '') }}"
            },
            {
              "id": "row_number",
              "name": "rowNumber",
              "type": "number",
              "value": "={{ $json.row_number }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "bbd629ed-94fa-4cfd-8274-075890405f6d",
      "name": "🌐 获取分析(SimilarWeb API)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1300,
        60
      ],
      "parameters": {
        "url": "https://similarweb8.p.rapidapi.com/get-analysis",
        "options": {
          "timeout": 30000
        },
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "domain",
              "value": "={{ $json.domain }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "X-RapidAPI-Key",
              "value": "YOUR_SIMILARWEB_RAPIDAPI_KEY_HERE"
            },
            {
              "name": "X-RapidAPI-Host",
              "value": "similarweb8.p.rapidapi.com"
            }
          ]
        }
      },
      "typeVersion": 4.1,
      "continueOnFail": true
    },
    {
      "id": "4c68f450-c6c1-4233-af80-527a720114dd",
      "name": "📊 提取关键流量指标",
      "type": "n8n-nodes-base.code",
      "position": [
        -1080,
        60
      ],
      "parameters": {
        "jsCode": "// Input: Raw SimilarWeb data in `$json.data`\nconst data = $json.data;\n\nconst output = {\n  domain: data.domain,\n  globalRank: data.global_rank,\n  countryRank: `${data.country_rank.country} - ${data.country_rank.rank}`,\n  categoryRank: `${data.category_rank.category} - ${data.category_rank.rank}`,\n  totalVisits: data.traffic_overview.total_visits,\n  bounceRate: `${(data.traffic_overview.bounce_rate * 100).toFixed(2)}%`,\n  pagesPerVisit: data.traffic_overview.pages_per_visit,\n  avgVisitDuration: data.traffic_overview.avg_visit_duration,\n\n  // Only top 3 traffic sources\n  topTrafficSources: {\n    direct: `${(data.traffic_sources.direct * 100).toFixed(1)}%`,\n    search: `${(data.traffic_sources.search * 100).toFixed(1)}%`,\n    social: `${(data.traffic_sources.social * 100).toFixed(1)}%`\n  },\n\n  // Top 3 countries only\n  topCountries: data.geography.top_countries.slice(0, 3).map(c => `${c.country}: ${(c.share * 100).toFixed(1)}%`),\n\n  deviceSplit: {\n    mobile: `${(data.mobile_vs_desktop.mobile * 100).toFixed(1)}%`,\n    desktop: `${(data.mobile_vs_desktop.desktop * 100).toFixed(1)}%`\n  }\n};\n\nreturn [\n  {\n    json: output\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "1c94450d-23dd-4a58-a10b-1a976d53e03e",
      "name": "📤 使用流量数据更新表格",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -860,
        -40
      ],
      "parameters": {
        "columns": {
          "value": {},
          "mappingMode": "defineBelow"
        },
        "options": {},
        "operation": "update",
        "sheetName": "Sheet1",
        "documentId": "YOUR_OUTPUT_GOOGLE_SHEET_ID_HERE"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "YOUR_GOOGLE_SHEETS_CREDENTIAL_ID",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4
    },
    {
      "id": "e4edab91-d07a-4045-96fb-36918cb869ce",
      "name": "📁 导出到 Airtable(可选)",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -860,
        160
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_AIRTABLE_BASE_ID"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_AIRTABLE_TABLE_NAME"
        },
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create",
        "authentication": "airtableOAuth2Api"
      },
      "credentials": {
        "airtableOAuth2Api": {
          "id": "YOUR_AIRTABLE_CREDENTIAL_ID",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e6e73f3f-5987-4a01-b5b3-b2e7f5f5c0bd",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1780,
        -200
      ],
      "parameters": {
        "width": 400,
        "height": 540,
        "content": "## 🧾 触发表格 | 🛠️ 设置表格数据"
      },
      "typeVersion": 1
    },
    {
      "id": "2356c9db-8443-4805-af2c-77b32170637b",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        -320
      ],
      "parameters": {
        "width": 420,
        "height": 660,
        "content": "## 🌍 Similarweb HTTP 请求 | 🛠️ 设置格式化的 Similarweb 响应"
      },
      "typeVersion": 1
    },
    {
      "id": "0de06e71-5a3e-4040-b110-1ebe399fe669",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -920,
        -320
      ],
      "parameters": {
        "width": 200,
        "height": 660,
        "content": "## 🧾 发送到表格"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "🧼 Clean Domain URL": {
      "main": [
        [
          {
            "node": "🌐 Fetch Analysis (SimilarWeb API)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🟢 Sheet Trigger: New Domain": {
      "main": [
        [
          {
            "node": "🧼 Clean Domain URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📊 Extract Key Traffic Metrics": {
      "main": [
        [
          {
            "node": "📤 Update Sheet with Traffic Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "📁 Export to Airtable (Optional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📤 Update Sheet with Traffic Data": {
      "main": [
        []
      ]
    },
    "🌐 Fetch Analysis (SimilarWeb API)": {
      "main": [
        [
          {
            "node": "📊 Extract Key Traffic Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 市场调研, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
中级
节点数量9
分类2
节点类型7
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Avkash Kakdiya

Avkash Kakdiya

@itechnotion

🚀 Founder of iTechNotion — we build custom AI-powered automation workflows for startups, agencies, and founders. 💡 Specializing in agentic AI systems, content automation, sales funnels, and digital workers. 🔧 14+ years in tech | Building scalable no-code/low-code solutions using n8n, OpenAI, and other API-first tools. 📬 Let’s automate what slows you down.

外部链接
在 n8n.io 查看

分享此工作流