Quick overview
This scheduled workflow pulls UK back and lay odds from the OddsRelay API, matches each bookmaker back price to the best available exchange lay price, and keeps a Google Sheets oddsmatcher tab up to date by adding, updating, and removing rows based on configurable rating and liquidity rules.
How it works
- Runs every 30 minutes on a schedule trigger.
- Calls the OddsRelay API in quote mode to estimate token cost and stops the run if it exceeds the configured maxTokensPerRun.
- Fetches the matched odds board from OddsRelay using your sport/competition, market, bookmaker, and exchange filters.
- Reads the existing rows from Google Sheets to compare what is already tracked.
- Calculates ratings for each back/lay pair (including exchange commission), keeps only pairs meeting minRating and minLayAvailable, and determines which sheet rows no longer exist on the board.
- Deletes rows from Google Sheets that have left the board and then appends or updates the kept pairs using row_key as the unique identifier.
Setup
- Create an OddsRelay account, generate an API key, and add an HTTP Header Auth credential in n8n with header name x-api-key and your key, then select it in both OddsRelay HTTP Request steps.
- Create a Google Sheet with row_key in cell A1, connect Google Sheets OAuth2 credentials in n8n, and set sheetUrl and sheetName in the Settings step.
- Review and adjust the Settings values (board, sport/competitions, markets, bookmakers, exchanges, commissionPercent, minRating, minLayAvailable, and maxTokensPerRun) to match your coverage and token budget.
Requirements
- An OddsRelay API key (sign up at app.oddsrelay.io)
- A Google account for Google Sheets
- No community nodes: only n8n's own nodes
Customization
board: standard, 2up or bog. For bog, set sport to horse_racing, empty competitions and set markets to win.
sport or competitions (competition keys from the API's /v2/sports); markets, bookmakers and exchanges as comma-separated keys from /v2/sports and /v2/bookmakers, empty for all.
commissionPercent, minRating and minLayAvailable shape what is kept. Add your own columns (a tick, a note): they stay beside their row while it is on the board.
maxTokensPerRun caps what one run may spend. Each run spends the call's price, so pick a schedule that suits your plan. Paid plans are for your own use; a tool that serves other people runs on Enterprise.
Additional info
- Rows the workflow did not write (no
row_key) are left alone. Values are written as they are (Cell Format: Let n8n format).
- Removing rows takes one call to Google per run of neighbouring rows, so a run where many events have started makes many calls. If Google refuses one (its limit on writes a minute), the run stops and the next one picks up from the sheet as it is.
- The retries and the failure branch were checked on n8n 2.43.7.
- API docs: https://oddsrelay.io/docs