Automate NHL Betting Data with TheOddsAPI & Airtable Using n8n

Save hours daily by automating NHL betting data retrieval and updates. This n8n workflow pulls live hockey event data using TheOddsAPI and stores results in Airtable, ensuring accurate, up-to-date betting insights without manual effort.
scheduleTrigger
httpRequest
airtable
+2
Workflow Identifier: 2156
NODES in Use: Schedule Trigger, HTTP Request, Airtable, Merge, Sticky Note

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

Opening Problem Statement

Meet Jake, a dedicated sports analyst and hockey enthusiast, who spends over two hours each day manually pulling NHL betting data from multiple sources and updating his records in Airtable. This tedious process is prone to errors, from missed updates to inconsistent data entry, often leading to inaccurate predictions and wasted time chasing information instead of analyzing it. Jake wishes there was a simpler, automated way to collect up-to-date NHL event schedules and scores quickly and reliably—freeing up his time for deeper analytics and better betting decisions.

Fortunately, this is exactly what the “Automating Betting Data Retrieval with TheOddsAPI and Airtable” workflow in n8n solves. By automating the retrieval and updating of sports data, it eliminates manual errors and drastically reduces the workload of data management for hockey betting enthusiasts like Jake.

What This Automation Does

This n8n workflow automates the entire daily cycle of retrieving NHL ice hockey event data and results, then updating a centralized Airtable. Here’s what happens when this workflow runs:

  • At 7:00 AM every day, it triggers and sends an HTTP request to TheOddsAPI to fetch the schedule of upcoming NHL events.
  • Creates new records in an Airtable base for all upcoming hockey matches, including essential details like teams, sport type, and start times.
  • At 11:00 PM daily, it pulls the scores and final results for those events from TheOddsAPI.
  • Uses the Merge node to combine updated score data with existing event records, matching by event ID.
  • Updates the Airtable records with scores, completion status, and last update timestamps, keeping all data in sync.
  • Offers flexibility to adjust for other sports or include betting odds and sportsbook data by modifying API calls and node settings.

These automated steps save Jake several hours and ensures accurate, up-to-date information without the risk of human error.

Prerequisites ⚙️

  • n8n account (cloud or self-hosted) 🔌
  • TheOddsAPI account with an API key for accessing sports data 🔑
  • Airtable account with a base and table set up to store event and score records 📊
  • Configured HTTP Header Authentication credentials in n8n for API access 🔐

Step-by-Step Guide

1. Set Day Start and End Schedule Triggers

Navigate to Nodes > Add Node > Schedule Trigger in n8n. Create two schedule triggers:

  • Morning Trigger: Set to run at 7:00 AM. Under interval, select triggerAtHour: 7.
  • Evening Trigger: Set to run at 11:00 PM. Under interval, select triggerAtHour: 23.

You should see these triggers fire at their respective times when activated. These coordinate data retrievals around the day.

Common Mistake: Using incorrect time format or forgetting to activate the workflow will prevent triggers from running.

2. Configure HTTP Request to Retrieve Upcoming NHL Events

Add an HTTP Request node connected to the Morning Trigger. Configure it as follows:

  • Method: GET (default)
  • URL: https://api.the-odds-api.com/v4/sports/icehockey_nhl/events?apiKey=YOUR_API_KEY
  • Authentication: Generic Credential with HTTP Header Auth using your TheOddsAPI key

This call fetches upcoming NHL games. You will see JSON data of the day’s ice hockey events when successful.

Common Mistake: Forgetting to replace YOUR_API_KEY or misconfiguring credentials causes failed API requests.

3. Create Airtable Records for Upcoming Events

Next, add an Airtable node and connect it to the HTTP Request node’s output. Set it to create records in your Airtable base and table where you store NHL events. Map these fields from API data carefully:

  • id from $json.id
  • home_team from $json.home_team
  • away_team from $json.away_team
  • sports_key from $json.sport_key
  • sport_title from $json.sport_title
  • commence_time from $json.commence_time

Once configured, this node adds the new game records. You should see entries appear in Airtable after a workflow run.

Common Mistake: Field mismatches or incorrect table/base IDs result in no records created or errors.

4. Retrieve End-of-Day NHL Results

Connect an HTTP Request node to the Evening Trigger. Configure it with:

  • GET URL: https://api.the-odds-api.com/v4/sports/icehockey_nhl/scores?daysFrom=1&apiKey=YOUR_API_KEY
  • Authentication: Same HTTP Header Authentication as before

This fetches results from the previous day. On success, you’ll see match scores JSON.

Common Mistake: Incorrect API URLs or credentials mean data won’t update at day end.

5. Merge Event Records with Scores by ID

Add a Merge node connected to the results HTTP Request. Configure it to combine data by matching the id field from events and results:

  • Mode: Combine
  • Fields to Match String: id

This merges event details with corresponding final scores for updating Airtable.

Common Mistake: Mismatched or missing ID fields cause no data merges and failed updates.

6. Update Airtable Records with Scores and Results

Attach an Airtable node to the Merge node’s output. Configure it to update records in your Airtable base/table:

  • Map the id field for matching
  • Update scores, completed, and last_update fields from the merged output

After running, Airtable shows updated scores for each game.

Common Mistake: Not setting id as the matching key leads to failure in updating existing records.

Customizations ✏️

  • Change Sport Type: In the HTTP Request nodes, replace icehockey_nhl in URLs with sports keys like basketball_nba or soccer_epl to track other sports.
  • Add Bookmaker Odds: Extend the HTTP requests to include odds data by calling /odds endpoints from TheOddsAPI and add fields to Airtable accordingly.
  • Adjust Times: Modify Schedule Triggers to different hours that match your timezone or desired update frequency.
  • Expand Airtable Fields: Include additional metadata like venue, referee, or league info from the API data into your Airtable schema for richer records.

Troubleshooting 🔧

Problem: “HTTP 401 Unauthorized”

Cause: Invalid or missing API key in HTTP Request authentication.

Solution: Check your TheOddsAPI API key in n8n Credentials. Re-enter or regenerate your key as needed under Credentials > HTTP Header Auth.

Problem: “No records created in Airtable”

Cause: Incorrect Airtable base, table ID, or field mappings in the Airtable node.

Solution: Verify that your Airtable Personal Access Token has write permissions. Double-check base and table IDs from your Airtable dashboard. Confirm exact field names and mappings in n8n’s Airtable node.

Problem: “Merge node returns empty results”

Cause: The event and results datasets don’t have matching id values or data format inconsistencies.

Solution: Ensure both HTTP requests use consistent keys for id, and inspect JSON outputs. Adjust mappings or pre-process data if needed using Code nodes.

Pre-Production Checklist ✅

  • Confirm API keys are valid and have enough quota.
  • Test HTTP requests individually with sample data to verify responses.
  • Verify Airtable base and table IDs and ensure permissions are set correctly.
  • Run the workflow manually first to confirm record creation and updates.

Deployment Guide

Once tested, activate both schedule triggers in n8n. Monitor the workflow logs initially to ensure data correctly flows and updates in Airtable as expected. This workflow runs automatically twice per day, ensuring your NHL betting data is fresh and accurate with minimal effort.

FAQs

Q: Can I use this workflow for sports other than NHL hockey?
A: Yes! Simply change the sport key in the HTTP request URLs to any supported by TheOddsAPI.

Q: Does this workflow consume a lot of API credits?
A: The data is pulled twice daily, so the API usage is minimal, but monitor your quota with TheOddsAPI plans.

Q: Is my betting data secure with this automation?
A: Yes, data is stored securely in your Airtable account and API credentials are kept safe within n8n.

Conclusion

By following this guide, you’ve automated the tedious daily process of fetching NHL event schedules and results using TheOddsAPI and updating Airtable — just like Jake wanted. This setup saves you hours each day and eliminates manual errors, providing reliable, up-to-date betting data at your fingertips.

Next, you could enhance this workflow by integrating bookmaker odds data, adding notifications via Slack for finished games, or expanding to additional sports leagues. Automation frees your time for smarter betting research, and n8n makes it accessible even if you’re new to automation.

Keep experimenting and customize this workflow to your exact needs. You’re now empowered with a powerful sports data automation pipeline!

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free