8
n8n 中文网amn8n.com

📈 使用Alpha Vantage API和Google表格每小时监控加密货币汇率

中级

这是一个Finance, AI领域的自动化工作流,包含 9 个节点。主要使用 Telegram, HttpRequest, GoogleSheets, ScheduleTrigger 等节点,结合人工智能技术实现智能自动化。 📈 使用Alpha Vantage API和Google表格每小时监控加密货币汇率

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "LRLFh0lVw2OIPJdW",
  "meta": {
    "instanceId": "",
    "templateCredsSetupCompleted": true
  },
  "name": "📈 使用 Alpha Vantage API 和 Google Sheets 每小时监控加密货币汇率",
  "tags": [],
  "nodes": [
    {
      "id": "95d9375b-c423-4346-8dd4-3cba09a62caa",
      "name": "BTC 汇率",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -520,
        -60
      ],
      "parameters": {
        "url": "https://www.alphavantage.co/query",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "function",
              "value": "CURRENCY_EXCHANGE_RATE"
            },
            {
              "name": "from_currency",
              "value": "BTC"
            },
            {
              "name": "to_currency",
              "value": "EUR"
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "",
          "name": ""
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "5d2a06c6-d2d8-4f55-b9ea-615d5c88612a",
      "name": "每小时调用",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -860,
        40
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ede798c5-aec6-4040-9ed8-b9f2cf6ea66f",
      "name": "保存 BTC 汇率",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -320,
        -60
      ],
      "parameters": {
        "columns": {
          "value": {
            "Ask_Price": "={{ $json['Realtime Currency Exchange Rate']['9. Ask Price'] }}",
            "Bid_Price": "={{ $json['Realtime Currency Exchange Rate']['8. Bid Price'] }}",
            "Time_Zone": "={{ $json['Realtime Currency Exchange Rate']['7. Time Zone'] }}",
            "Exchange_Rate": "={{ $json['Realtime Currency Exchange Rate']['5. Exchange Rate'] }}",
            "Last_Refreshed": "={{ $json['Realtime Currency Exchange Rate']['6. Last Refreshed'] }}",
            "To_Currency_Code": "={{ $json['Realtime Currency Exchange Rate']['3. To_Currency Code'] }}",
            "To_Currency_Name": "={{ $json['Realtime Currency Exchange Rate']['4. To_Currency Name'] }}",
            "From_Currency_Code": "={{ $json['Realtime Currency Exchange Rate']['1. From_Currency Code'] }}",
            "From_Currency_Name": "={{ $json['Realtime Currency Exchange Rate']['2. From_Currency Name'] }}"
          },
          "schema": [
            {
              "id": "Last_Refreshed",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Last_Refreshed",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Time_Zone",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Time_Zone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "From_Currency_Code",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "From_Currency_Code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "From_Currency_Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "From_Currency_Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "To_Currency_Code",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "To_Currency_Code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "To_Currency_Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "To_Currency_Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Exchange_Rate",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Exchange_Rate",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last_Refreshed",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Last_Refreshed",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Time_Zone",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Time_Zone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Bid_Price",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Bid_Price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Ask_Price",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Ask_Price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "BTC"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1vtjhgdulJn8niwZE0RQeQL8L1kb00L4z2TOuQK_9mV0",
          "cachedResultUrl": "",
          "cachedResultName": "AlphaVantage"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": ""
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.6
    },
    {
      "id": "2fb8320b-aeb4-4e23-91c5-ff2ceebc8970",
      "name": "保存 ETH 汇率",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -320,
        120
      ],
      "parameters": {
        "columns": {
          "value": {
            "Ask_Price": "={{ $json['Realtime Currency Exchange Rate']['9. Ask Price'] }}",
            "Bid_Price": "={{ $json['Realtime Currency Exchange Rate']['8. Bid Price'] }}",
            "Time_Zone": "={{ $json['Realtime Currency Exchange Rate']['7. Time Zone'] }}",
            "Exchange_Rate": "={{ $json['Realtime Currency Exchange Rate']['5. Exchange Rate'] }}",
            "Last_Refreshed": "={{ $json['Realtime Currency Exchange Rate']['6. Last Refreshed'] }}",
            "To_Currency_Code": "={{ $json['Realtime Currency Exchange Rate']['3. To_Currency Code'] }}",
            "To_Currency_Name": "={{ $json['Realtime Currency Exchange Rate']['4. To_Currency Name'] }}",
            "From_Currency_Code": "={{ $json['Realtime Currency Exchange Rate']['1. From_Currency Code'] }}",
            "From_Currency_Name": "={{ $json['Realtime Currency Exchange Rate']['2. From_Currency Name'] }}"
          },
          "schema": [
            {
              "id": "Last_Refreshed",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Last_Refreshed",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Time_Zone",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Time_Zone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "From_Currency_Code",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "From_Currency_Code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "From_Currency_Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "From_Currency_Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "To_Currency_Code",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "To_Currency_Code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "To_Currency_Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "To_Currency_Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Exchange_Rate",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Exchange_Rate",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last_Refreshed",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Last_Refreshed",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Time_Zone",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Time_Zone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Bid_Price",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Bid_Price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Ask_Price",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Ask_Price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1591416661,
          "cachedResultUrl": "",
          "cachedResultName": "ETH"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1vtjhgdulJn8niwZE0RQeQL8L1kb00L4z2TOuQK_9mV0",
          "cachedResultUrl": "",
          "cachedResultName": "AlphaVantage"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": ""
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.6
    },
    {
      "id": "b0630581-e5cc-4e64-bbb3-2c362b766a8a",
      "name": "ETH 汇率",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -520,
        120
      ],
      "parameters": {
        "url": "https://www.alphavantage.co/query",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "function",
              "value": "CURRENCY_EXCHANGE_RATE"
            },
            {
              "name": "from_currency",
              "value": "ETH"
            },
            {
              "name": "to_currency",
              "value": "EUR"
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "",
          "name": ""
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "329e3c49-9b8f-49ca-83da-5e7ec00f17f0",
      "name": "BTC 通知",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -80,
        -60
      ],
      "webhookId": "5f997b2e-aff9-427e-a92d-a0133903a3a4",
      "parameters": {
        "text": "=<b>🔄 BTC to EUR Rate Update</b>\n\n<b>From:</b> {{ $json[\"From_Currency_Name\"] }} ({{ $json[\"From_Currency_Code\"] }})\n<b>To:</b> {{ $json[\"To_Currency_Name\"] }} ({{ $json[\"To_Currency_Code\"] }})\n\n<b>💱 Exchange Rate:</b> {{ $json[\"Exchange_Rate\"] }}\n<b>📉 Bid:</b> {{ $json[\"Bid_Price\"] }}\n<b>📈 Ask:</b> {{ $json[\"Ask_Price\"] }}\n\n<b>🕒 Last Updated:</b> {{ $json[\"Last_Refreshed\"] }} ({{ $json[\"Time_Zone\"] }})",
        "chatId": "1698247520",
        "additionalFields": {
          "parse_mode": "HTML",
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "BlqWlzuNU8B4t9Pw",
          "name": "Assistant Bot"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1.2
    },
    {
      "id": "e9920828-9a99-4899-9313-037fc78933dc",
      "name": "ETH 通知",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -80,
        120
      ],
      "webhookId": "5f997b2e-aff9-427e-a92d-a0133903a3a4",
      "parameters": {
        "text": "=<b>🔄 ETH to EUR Rate Update</b>\n\n<b>From:</b> {{ $json[\"From_Currency_Name\"] }} ({{ $json[\"From_Currency_Code\"] }})\n<b>To:</b> {{ $json[\"To_Currency_Name\"] }} ({{ $json[\"To_Currency_Code\"] }})\n\n<b>💱 Exchange Rate:</b> {{ $json[\"Exchange_Rate\"] }}\n<b>📉 Bid:</b> {{ $json[\"Bid_Price\"] }}\n<b>📈 Ask:</b> {{ $json[\"Ask_Price\"] }}\n\n<b>🕒 Last Updated:</b> {{ $json[\"Last_Refreshed\"] }} ({{ $json[\"Time_Zone\"] }})",
        "chatId": "1698247520",
        "additionalFields": {
          "parse_mode": "HTML",
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "",
          "name": ""
        }
      },
      "notesInFlow": true,
      "typeVersion": 1.2
    },
    {
      "id": "3d674add-ca49-4e6f-b3e4-7aaa82f67953",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -900,
        -500
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 760,
        "content": "### 1. 工作流每小时触发"
      },
      "typeVersion": 1
    },
    {
      "id": "4095c6c9-9cbd-446c-884c-ed713760ddff",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        -500
      ],
      "parameters": {
        "color": 7,
        "width": 920,
        "height": 760,
        "content": "### 2. 从 Alpha Vantage Insight API 收集 BTC 和 ETH 价格"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "cd5a0fe2-298c-40a5-b184-be90d8c220d1",
  "connections": {
    "Save Rate BTC": {
      "main": [
        [
          {
            "node": "Notification BTC",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Rate ETH": {
      "main": [
        [
          {
            "node": "Notification ETH",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Every Hour": {
      "main": [
        [
          {
            "node": "BTC Exchange Rate",
            "type": "main",
            "index": 0
          },
          {
            "node": "ETH Exchange Rate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BTC Exchange Rate": {
      "main": [
        [
          {
            "node": "Save Rate BTC",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ETH Exchange Rate": {
      "main": [
        [
          {
            "node": "Save Rate ETH",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 财务, 人工智能

需要付费吗?

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

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

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

作者
Samir Saci

Samir Saci

@samirsaci

Automation, AI and Analytics for Supply Chain & Business Optimization Helping businesses streamline operations using n8n, AI agents, and data science to enhance efficiency and sustainability. Linkedin: www.linkedin.com/in/samir-saci

外部链接
在 n8n.io 查看

分享此工作流