8
n8n 中文网amn8n.com

使用TheOddsAPI和Airtable自动化投注数据检索

中级

这是一个Other领域的自动化工作流,包含 10 个节点。主要使用 Merge, Airtable, HttpRequest, ScheduleTrigger 等节点。 使用Odds API自动化体育投注数据

前置要求
  • Airtable API Key
  • 可能需要目标 API 的认证凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "6sBxOuYYcJjIBmVJ",
  "meta": {
    "instanceId": "73d9d5380db181d01f4e26492c771d4cb5c4d6d109f18e2621cf49cac4c50763",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 TheOddsAPI 和 Airtable 自动化投注数据检索",
  "tags": [],
  "nodes": [
    {
      "id": "3f7d9313-2a46-4869-a1f5-33976352961c",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        -300
      ],
      "parameters": {
        "width": 300,
        "height": 440,
        "content": "以下触发器在一天开始和一天结束时启动工作流。时间可以根据用户偏好进行调整。"
      },
      "typeVersion": 1
    },
    {
      "id": "a535c540-c186-466f-97e2-4d96d02c1f1d",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -100,
        -660
      ],
      "parameters": {
        "color": 4,
        "width": 460,
        "height": 660,
        "content": "激活后,HTTP 请求会拉取用户选择体育项目的即将到来的数据。以下设置为冰球。更多文档可在以下链接中找到:"
      },
      "typeVersion": 1
    },
    {
      "id": "29335df8-6aab-475c-8d8b-38b27eb66bb9",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        -280
      ],
      "parameters": {
        "color": 3,
        "width": 800,
        "height": 540,
        "content": "在一天结束时,计划触发器将激活一个 HTTP 请求以获取赛事比分。此设置为冰球,但可以根据用户偏好进行调整。"
      },
      "typeVersion": 1
    },
    {
      "id": "01134aa4-cc3c-42ed-bc96-f737f1434ed6",
      "name": "早上 7:00 拉取数据的早晨触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -420,
        -200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c0b4c27f-bb17-4d85-a042-aa2db5060a6f",
      "name": "晚上 11:00 拉取数据的晚间触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -420,
        -20
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 23
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0a38de6c-4f2e-46ba-8c10-8f12b0a4abe2",
      "name": "检索当天即将举行的体育赛事数据",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        20,
        -200
      ],
      "parameters": {
        "url": "=https://api.the-odds-api.com/v4/sports/icehockey_nhl/events?apiKey=60019f5ac82b8d5d508b2dc8393384c1",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "qbYtAoCFY2cLFvOU",
          "name": "Header Auth account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "28393bd9-17ed-48b1-ba6f-f62b51ce137c",
      "name": "创建当天即将举行的赛事记录",
      "type": "n8n-nodes-base.airtable",
      "position": [
        180,
        -380
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appIXd8a8JeB9bPaL",
          "cachedResultUrl": "https://airtable.com/appIXd8a8JeB9bPaL",
          "cachedResultName": "Untitled Base"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbldpnP52opBEtKEy",
          "cachedResultUrl": "https://airtable.com/appIXd8a8JeB9bPaL/tbldpnP52opBEtKEy",
          "cachedResultName": "Table 1"
        },
        "columns": {
          "value": {
            "id": "={{ $json.id }}",
            "away_team": "={{ $json.away_team }}",
            "home_team": "={{ $json.home_team }}",
            "sports_key": "={{ $json.sport_key }}",
            "sport_title": "={{ $json.sport_title }}",
            "commence_time": "={{ $json.commence_time }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "sports_key",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "sports_key",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "sport_title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "sport_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "commence_time",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "commence_time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "home_team",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "home_team",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "away_team",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "away_team",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "completed",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "completed",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "scores",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "scores",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "last_update",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "last_update",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "create"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "0ApVmNsLu7aFzQD6",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "086e599b-fc74-4ed5-a36f-fb80e385e625",
      "name": "在一天结束时检索体育结果数据",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        500,
        20
      ],
      "parameters": {
        "url": "https://api.the-odds-api.com/v4/sports/icehockey_nhl/scores?daysFrom=1&apiKey=60019f5ac82b8d5d508b2dc8393384c1",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "qbYtAoCFY2cLFvOU",
          "name": "Header Auth account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1b5ec6f2-d913-4005-89f0-d566e896c344",
      "name": "通过匹配 ID 将体育结果与即将举行的赛事记录合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        740,
        -120
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "fieldsToMatchString": "id"
      },
      "typeVersion": 3
    },
    {
      "id": "f1765871-6f9e-416b-8ee8-696bc4dbf6bb",
      "name": "使用体育赛事的比分和结果更新表格记录",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1020,
        -60
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appIXd8a8JeB9bPaL",
          "cachedResultUrl": "https://airtable.com/appIXd8a8JeB9bPaL",
          "cachedResultName": "Untitled Base"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbldpnP52opBEtKEy",
          "cachedResultUrl": "https://airtable.com/appIXd8a8JeB9bPaL/tbldpnP52opBEtKEy",
          "cachedResultName": "Table 1"
        },
        "columns": {
          "value": {
            "id": "={{ $json.id }}",
            "scores": "={{ $json.scores }}",
            "completed": "={{ $json.completed }}",
            "last_update": "={{ $json.last_update }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "sports_key",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "sports_key",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "sport_title",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "sport_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "commence_time",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "commence_time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "home_team",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "home_team",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "away_team",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "away_team",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "completed",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "completed",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "scores",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "scores",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "last_update",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "last_update",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "0ApVmNsLu7aFzQD6",
          "name": "Airtable Personal Access Token account"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bf20603b-eb12-4156-94fe-fb18ecf6a454",
  "connections": {
    "Morning Trigger To Pull Data At 7:00am": {
      "main": [
        [
          {
            "node": "Retrieve Data Of Upcoming Sport Events For The Day",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Evening Trigger To Pull Data At 11:00pm": {
      "main": [
        [
          {
            "node": "Retrieve Sport Results Data At The End Of The Day",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Sport Results Data At The End Of The Day": {
      "main": [
        [
          {
            "node": "Combine Sport Results With Upcoming Events Records By Matching ID",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Retrieve Data Of Upcoming Sport Events For The Day": {
      "main": [
        [
          {
            "node": "Combine Sport Results With Upcoming Events Records By Matching ID",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create Records Of Upcoming Events For The Day",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Sport Results With Upcoming Events Records By Matching ID": {
      "main": [
        [
          {
            "node": "Update Table Records With Scores And Results For Sport Events",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 其他

需要付费吗?

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

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

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

作者
Marketing Canopy

Marketing Canopy

@johnmarketingcanopy

A results-driven Six Sigma Green Belt with 5 years of experience specializing in marketing process optimization, AI-powered data automation, and performance analytics. Adept at leveraging machine learning models, predictive analytics, and automation tools to enhance marketing efficiency, streamline workflows, and maximize ROI.

外部链接
在 n8n.io 查看

分享此工作流