Log close soccer back and lay price matches with OddsRelay and Google Sheets
Quick overview
Description
Quick overview This workflow runs every 15 minutes to pull OddsRelay matched odds for soccer match result markets across selected bookmakers and exchanges, calculates back-vs-lay ratings (including exchange commission), filters the closest matches, and appends qualifying rows to Google Sheets. How it works A Schedule Trigger starts each run. Settings holds your sheet, the sport or competitions, markets, bookmakers and exchanges to read, your exchange commission, the lowest rating to log, the least money needed at the lay price, how far a price must move to be logged again, and the most tokens one run may spend. Check the price asks the OddsRelay API what the Standard matched board call costs (quote=true, which is free). If that is above your cap, Stop: over your cap ends the run with the price in the error, before anything is read. Read the matched board fetches bookmaker back prices beside exchange lay prices through n8n's HTTP Request node and a Header Auth credential. Read the log then reads the rows already in your sheet. Compare with the log (Code) puts each back price beside the lowest exchange lay with at least minLayAvailable at that price, rates the pair (back / lay x 100, and the same after your commission) and keeps pairs at or above minRating. A pair goes on only if the sheet has no row for it yet (change is new) or its back or lay price has moved by minMovePercent or more since its last row (change is moved, with the earlier prices beside it). Add the new rows (Google Sheets, Append Row) writes them. A run with nothing new writes nothing, so repeat runs add no duplicates. Each OddsRelay call is tried three times. One that still fails goes to Explain the failure, and Stop: the API call failed ends the run with the status, the API's error code and request id, and what to do. The sheet is not changed. Setup Sign up at app.oddsrelay.io and copy your API key. Free gives you 50,000 tokens for 14 days from sign-up, with no card, then no tokens until you choose a plan, on the same key. Create a Header Auth credential with Name x-api-key and your API key as the Value, and select it in Check the price and Read the matched board. Make an empty Google Sheet. In Settings, set sheetUrl to its URL and sheetName to its tab, then connect your Google Sheets account in Read the log and Add the new rows. The first run writes the column names. Run the workflow once and check the sheet, run it again to see that nothing is added twice, then publish it. 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 sport (such as soccer) or competitions (comma-separated competition keys from the API's /v2/sports, such as soccer_english_premier_league); competitions is used when it is set. markets, bookmakers and exchanges: comma-separated keys from /v2/sports and /v2/bookmakers; leave one empty for all. commissionPercent, minRating, minLayAvailable and minMovePercent (0 logs every change) shape what is logged. 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 A pair's last row is the one with the latest checked_at, so the sheet can be sorted or filtered freely. Values are written as they are (Cell Format: Let n8n format), so the times stay text that sorts in order. Each run reads the whole sheet, and the log only grows: move old rows to another tab now and then. The retries and the failure branch were checked on n8n 2.43.7. API docs: https://oddsrelay.io/docs. An n8n automation workflow template by oddsrelay.
Community Metrics
Author
oddsrelay
Platform
web
Pricing model
free
Categories
- Automation
Tags
- n8n
- workflow
- google-sheets
- http-request
- code
Capabilities
- 3 nodes