自動化された毎日の暗号通貨市場レポート - 最も上昇したものと最も下落したもの
これはCrypto Trading, Multimodal AI分野の自動化ワークフローで、13個のノードを含みます。主にSet, Code, Cron, WhatsApp, EmailSendなどのノードを使用。 毎日の暗号通貨市場レポート(CoinGecko、WhatsApp、メール通知を使用)
- •ターゲットAPIの認証情報が必要な場合あり
{
"id": "65dLT87vPoyQexup",
"meta": {
"instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
"templateCredsSetupCompleted": true
},
"name": "Automated Daily Crypto Market Report - Top Gainers & Losers",
"tags": [],
"nodes": [
{
"id": "d4575dcd-57c9-4ade-9746-be644aba5443",
"name": "毎日暗号通貨トリガー",
"type": "n8n-nodes-base.cron",
"position": [
0,
240
],
"parameters": {
"triggerTimes": {
"item": [
{
"hour": 0
}
]
}
},
"typeVersion": 1
},
{
"id": "39d4dd2e-6ec8-4970-b5b1-8e9c896529ef",
"name": "設定変数のセット",
"type": "n8n-nodes-base.set",
"position": [
224,
240
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "symbols-assignment",
"name": "vs_currency",
"type": "string",
"value": "usd"
},
{
"id": "whatsapp-number",
"name": "whatsapp_number",
"type": "string",
"value": "+919988665533"
},
{
"id": "email-recipient",
"name": "email_recipient",
"type": "string",
"value": "abc@gmail.com"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "eef4d478-03bd-438b-88c9-83244dd4e1d0",
"name": "CoinGeckoから暗号通貨データを取得",
"type": "n8n-nodes-base.httpRequest",
"position": [
448,
240
],
"parameters": {
"url": "=https://api.coingecko.com/api/v3/coins/markets?vs_currency={{ $json.vs_currency }}&order=market_cap_desc&per_page=100&page=1&sparkline=false&locale=en&price_change_percentage=24h",
"options": {
"timeout": 30000
}
},
"typeVersion": 4.2
},
{
"id": "29507472-9f45-4854-a25c-e0cb35136fa9",
"name": "暗号通貨変動を処理",
"type": "n8n-nodes-base.code",
"position": [
672,
240
],
"parameters": {
"jsCode": "// Process crypto data and calculate movements\nlet processedStocks = [];\n\n// Log the raw input for debugging\nconsole.log('Raw API Input:', JSON.stringify($input.all(), null, 2));\n\n// Aggregate data from all input items\n$input.all().forEach(item => {\n const stockData = item.json;\n if (stockData && stockData.name && stockData.price_change_percentage_24h !== undefined) {\n const percentChange = parseFloat(stockData.price_change_percentage_24h);\n const price = parseFloat(stockData.current_price);\n const change = parseFloat(stockData.price_change_24h);\n \n processedStocks.push({\n name: stockData.name,\n symbol: stockData.symbol.toUpperCase(),\n price: isNaN(price) ? null : price,\n change: isNaN(change) ? null : change,\n percent_change: isNaN(percentChange) ? null : percentChange,\n volume: stockData.total_volume ? parseInt(stockData.total_volume) : null,\n high: stockData.high_24h ? parseFloat(stockData.high_24h) : null,\n low: stockData.low_24h ? parseFloat(stockData.low_24h) : null,\n movement_type: percentChange > 0 ? 'gain' : 'loss',\n abs_percent_change: Math.abs(percentChange)\n });\n }\n});\n\n// Log processed stocks for debugging\nconsole.log('Processed Stocks:', JSON.stringify(processedStocks, null, 2));\n\n// Sort by absolute percentage change (biggest movers)\nprocessedStocks.sort((a, b) => b.abs_percent_change - a.abs_percent_change);\n\n// Take top 100 biggest movers, gainers, and losers\nconst topMovers = processedStocks.slice(0, 100);\nconst gainers = processedStocks.filter(stock => stock.percent_change > 0).slice(0, 100);\nconst losers = processedStocks.filter(stock => stock.percent_change < 0).slice(0, 100);\n\n// Set current date and time in IST (02:33 PM IST, August 22, 2025)\nconst currentDate = new Date('2025-08-22T14:33:00+05:30').toLocaleString('en-IN', {\n \n year: 'numeric',\n month: 'long',\n day: 'numeric'\n});\n\nreturn [{\n json: {\n date: currentDate, // Reflects 02:33 PM IST, August 22, 2025\n total_stocks: processedStocks.length,\n top_gainers: gainers,\n top_losers: losers,\n biggest_movers: topMovers\n }\n}];"
},
"typeVersion": 2
},
{
"id": "65d484f2-0da1-4fba-86b3-eef7d8c59bb4",
"name": "WhatsAppメッセージをフォーマット",
"type": "n8n-nodes-base.code",
"position": [
896,
144
],
"parameters": {
"jsCode": "// Generate WhatsApp message\n const data = $input.first().json;\n\nlet message = `📈 *DAILY CRYPTO MARKET REPORT*\\n`;\nmessage += `📅 Date: ${data.date}\\n`;\nmessage += `📊 Analyzed: ${data.total_stocks} cryptos\\n\\n`;\n\n// Top Gainers\nmessage += `🟢 *TOP GAINERS*\\n`;\nmessage += `━━━━━━━━━━━━━━━━━━━━\\n`;\ndata.top_gainers.forEach((stock, index) => {\n message += `${index + 1}. ${stock.symbol}\\n`;\n message += ` 💰 $${stock.price?.toFixed(2) || 'N/A'}\\n`;\n message += ` 📈 +${stock.percent_change?.toFixed(2)}% (+$${stock.change?.toFixed(2)})\\n\\n`;\n});\n\n// Top Losers\nmessage += `🔴 *TOP LOSERS*\\n`;\nmessage += `━━━━━━━━━━━━━━━━━━━━\\n`;\ndata.top_losers.forEach((stock, index) => {\n message += `${index + 1}. ${stock.symbol}\\n`;\n message += ` 💰 $${stock.price?.toFixed(2) || 'N/A'}\\n`;\n message += ` 📉 ${stock.percent_change?.toFixed(2)}% ($${stock.change?.toFixed(2)})\\n\\n`;\n});\n\nmessage += `\\n⚡ Generated by Crypto Alert Bot`;\n\nreturn [{ json: { whatsapp_message: message } }];"
},
"typeVersion": 2
},
{
"id": "337719ad-85c1-49bc-8bf9-b578f8718211",
"name": "メールコンテンツをフォーマット",
"type": "n8n-nodes-base.code",
"position": [
896,
336
],
"parameters": {
"jsCode": "// Generate HTML Email content\n const data = $input.first().json;\n\nlet htmlContent = `\n<!DOCTYPE html>\n<html>\n<head>\n <style>\n body { font-family: Arial, sans-serif; margin: 20px; background-color: #f5f5f5; }\n .container { max-width: 800px; margin: 0 auto; background: white; padding: 20px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }\n .header { text-align: center; border-bottom: 2px solid #007bff; padding-bottom: 15px; margin-bottom: 20px; }\n .section { margin-bottom: 30px; }\n .stock-table { width: 100%; border-collapse: collapse; margin-top: 10px; }\n .stock-table th, .stock-table td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }\n .stock-table th { background-color: #f8f9fa; font-weight: bold; }\n .gain { color: #28a745; font-weight: bold; }\n .loss { color: #dc3545; font-weight: bold; }\n .symbol { font-weight: bold; color: #007bff; }\n .stats { display: flex; justify-content: space-around; background: #f8f9fa; padding: 15px; border-radius: 5px; margin-bottom: 20px; }\n .stat-item { text-align: center; }\n .stat-number { font-size: 24px; font-weight: bold; color: #007bff; }\n </style>\n</head>\n<body>\n <div class=\"container\">\n <div class=\"header\">\n <h1>📈 Daily Crypto Market Report</h1>\n <p><strong>Date:</strong> ${data.date}</p>\n </div>\n \n <div class=\"stats\">\n <div class=\"stat-item\">\n <div class=\"stat-number\">${data.total_stocks}</div>\n <div>Cryptos Analyzed</div>\n </div>\n <div class=\"stat-item\">\n <div class=\"stat-number\">${data.top_gainers.length}</div>\n <div>Top Gainers</div>\n </div>\n <div class=\"stat-item\">\n <div class=\"stat-number\">${data.top_losers.length}</div>\n <div>Top Losers</div>\n </div>\n </div>\n\n <div class=\"section\">\n <h2 style=\"color: #28a745;\">🟢 Top Gainers</h2>\n <table class=\"stock-table\">\n <thead>\n <tr>\n <th>Rank</th>\n <th>Symbol</th>\n <th>Price</th>\n <th>Change</th>\n <th>% Change</th>\n <th>Volume</th>\n </tr>\n </thead>\n <tbody>`;\n\ndata.top_gainers.forEach((stock, index) => {\n htmlContent += `\n <tr>\n <td>${index + 1}</td>\n <td class=\"symbol\">${stock.symbol}</td>\n <td>$${stock.price?.toFixed(2) || 'N/A'}</td>\n <td class=\"gain\">+$${stock.change?.toFixed(2) || 'N/A'}</td>\n <td class=\"gain\">+${stock.percent_change?.toFixed(2)}%</td>\n <td>${stock.volume?.toLocaleString() || 'N/A'}</td>\n </tr>`;\n});\n\nhtmlContent += `\n </tbody>\n </table>\n </div>\n\n <div class=\"section\">\n <h2 style=\"color: #dc3545;\">🔴 Top Losers</h2>\n <table class=\"stock-table\">\n <thead>\n <tr>\n <th>Rank</th>\n <th>Symbol</th>\n <th>Price</th>\n <th>Change</th>\n <th>% Change</th>\n <th>Volume</th>\n </tr>\n </thead>\n <tbody>`;\n\ndata.top_losers.forEach((stock, index) => {\n htmlContent += `\n <tr>\n <td>${index + 1}</td>\n <td class=\"symbol\">${stock.symbol}</td>\n <td>$${stock.price?.toFixed(2) || 'N/A'}</td>\n <td class=\"loss\">$${stock.change?.toFixed(2) || 'N/A'}</td>\n <td class=\"loss\">${stock.percent_change?.toFixed(2)}%</td>\n <td>${stock.volume?.toLocaleString() || 'N/A'}</td>\n </tr>`;\n});\n\nhtmlContent += `\n </tbody>\n </table>\n </div>\n \n <div style=\"text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #ddd; color: #666;\">\n <p>⚡ Generated automatically by Crypto Alert System</p>\n <p><small>Data provided by CoinGecko API</small></p>\n </div>\n </div>\n</body>\n</html>`;\n\n const plainText = `\nDAILY CRYPTO MARKET REPORT\\n========================\\nDate: ${data.date}\\nCryptos Analyzed: ${data.total_stocks}\\n\\nTOP GAINERS:\\n-----------\\n${data.top_gainers.map((stock, i) => `${i+1}. ${stock.symbol}: $${stock.price?.toFixed(2)} (+${stock.percent_change?.toFixed(2)}%)`).join('\\n')}\\n\\nTOP LOSERS:\\n----------\\n${data.top_losers.map((stock, i) => `${i+1}. ${stock.symbol}: $${stock.price?.toFixed(2)} (${stock.percent_change?.toFixed(2)}%)`).join('\\n')}\\n\\nGenerated by Crypto Alert System`;\n\nreturn [{\n json: {\n email_html: htmlContent,\n email_text: plainText,\n email_subject: `📈 Daily Crypto Report - ${data.date} | Top Movers Alert`\n }\n}];"
},
"typeVersion": 2
},
{
"id": "e66985b9-91e8-4345-994d-9713557bc7cd",
"name": "メールアラートを送信",
"type": "n8n-nodes-base.emailSend",
"position": [
1120,
336
],
"webhookId": "cead9a3f-5f37-422c-9755-7cfbdd18193d",
"parameters": {
"html": "={{ $json.email_html }}",
"options": {},
"subject": "={{ $json.email_subject }}",
"toEmail": "={{ $('Set Configuration Variables\t').item.json.email_recipient }}",
"fromEmail": "alert@gmail.com",
"emailFormat": "html"
},
"credentials": {
"smtp": {
"id": "G1kyF8cSWTZ4vouN",
"name": "SMTP -test"
}
},
"typeVersion": 2
},
{
"id": "7c7f1532-ef42-4537-b9c6-5fa1834dd832",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
0
],
"parameters": {
"width": 180,
"height": 200,
"content": "Triggers daily at 00:00 UTC."
},
"typeVersion": 1
},
{
"id": "60622a0b-df55-46f3-8da7-961be1d89e61",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
224,
0
],
"parameters": {
"color": 4,
"width": 180,
"height": 200,
"content": "Configure phone numbers, and email addresses here"
},
"typeVersion": 1
},
{
"id": "1a47e027-c1d2-47aa-8083-b6a8dc033b09",
"name": "付箋2",
"type": "n8n-nodes-base.stickyNote",
"position": [
448,
0
],
"parameters": {
"color": 3,
"width": 180,
"height": 200,
"content": "Fetches 24h data for top 100 cryptos using CoinGecko API"
},
"typeVersion": 1
},
{
"id": "45c9aadb-c889-4aff-bffa-8a3940d1815d",
"name": "付箋3",
"type": "n8n-nodes-base.stickyNote",
"position": [
672,
0
],
"parameters": {
"color": 5,
"width": 180,
"height": 200,
"content": "Processes and ranks cryptos by biggest 24h movements"
},
"typeVersion": 1
},
{
"id": "dd16268b-0178-4416-ae19-bb8e4cc6b34c",
"name": "付箋4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1088,
0
],
"parameters": {
"color": 6,
"width": 200,
"height": 200,
"content": "Sends alerts via WhatsApp/Telegram and Email with formatted reports"
},
"typeVersion": 1
},
{
"id": "bd9244db-2652-491e-9437-7b497098ee04",
"name": "メッセージを送信",
"type": "n8n-nodes-base.whatsApp",
"position": [
1120,
144
],
"webhookId": "d5c8ef9f-32a8-4655-8baf-e91f60b81fe2",
"parameters": {
"textBody": "={{ $json.whatsapp_message }}",
"operation": "send",
"phoneNumberId": "=+919876543234",
"additionalFields": {},
"recipientPhoneNumber": "={{ $('Set Configuration Variables\t').item.json.whatsapp_number }}"
},
"credentials": {
"whatsAppApi": {
"id": "b0PxTDPdWzznWnfG",
"name": "WhatsApp-test "
}
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "666f2f29-90e3-4f93-9267-a32bb6e03fc3",
"connections": {
"d4575dcd-57c9-4ade-9746-be644aba5443": {
"main": [
[
{
"node": "39d4dd2e-6ec8-4970-b5b1-8e9c896529ef",
"type": "main",
"index": 0
}
]
]
},
"337719ad-85c1-49bc-8bf9-b578f8718211": {
"main": [
[
{
"node": "e66985b9-91e8-4345-994d-9713557bc7cd",
"type": "main",
"index": 0
}
]
]
},
"65d484f2-0da1-4fba-86b3-eef7d8c59bb4": {
"main": [
[
{
"node": "bd9244db-2652-491e-9437-7b497098ee04",
"type": "main",
"index": 0
}
]
]
},
"29507472-9f45-4854-a25c-e0cb35136fa9": {
"main": [
[
{
"node": "65d484f2-0da1-4fba-86b3-eef7d8c59bb4",
"type": "main",
"index": 0
},
{
"node": "337719ad-85c1-49bc-8bf9-b578f8718211",
"type": "main",
"index": 0
}
]
]
},
"39d4dd2e-6ec8-4970-b5b1-8e9c896529ef": {
"main": [
[
{
"node": "eef4d478-03bd-438b-88c9-83244dd4e1d0",
"type": "main",
"index": 0
}
]
]
},
"eef4d478-03bd-438b-88c9-83244dd4e1d0": {
"main": [
[
{
"node": "29507472-9f45-4854-a25c-e0cb35136fa9",
"type": "main",
"index": 0
}
]
]
}
}
}このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - 仮想通貨取引, マルチモーダルAI
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
Oneclick AI Squad
@oneclick-aiThe AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.
このワークフローを共有