{"id":27,"date":"2025-09-14T10:05:11","date_gmt":"2025-09-14T10:05:11","guid":{"rendered":"https:\/\/aiwinningtips.com\/?page_id=27"},"modified":"2025-10-05T18:24:32","modified_gmt":"2025-10-05T18:24:32","slug":"fixtures","status":"publish","type":"page","link":"https:\/\/aiwinningtips.com\/?page_id=27","title":{"rendered":"Fixtures"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"27\" class=\"elementor elementor-27\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-b180460 e-flex e-con-boxed e-con e-parent\" data-id=\"b180460\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-60a4ce5 elementor-widget elementor-widget-shortcode\" data-id=\"60a4ce5\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"><div style=\"color:white; background:#111; padding:10px;\">API not reachable<\/div><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-e35b62a e-flex e-con-boxed e-con e-parent\" data-id=\"e35b62a\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-156f9d3 elementor-widget elementor-widget-html\" data-id=\"156f9d3\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>Football & Horse Racing Odds<\/title>\n<style>\n  body { font-family: Arial, sans-serif; background: #0d1117; color: #ffffff; padding: 20px; }\n  h1 { color: #ffdd57; margin-bottom: 20px; }\n  .league { margin-top: 30px; font-size: 1.2em; color: #ff7f50; }\n  table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }\n  th, td { padding: 10px; text-align: left; border-bottom: 1px solid #2c2f3a; vertical-align: middle; }\n  th { background: #161b22; }\n  tr { background: #1b1f28; }\n  tr:hover { background: #252a38; }\n  .highlight-green { color: #00ff00; font-weight: bold; }\n  .highlight-yellow { color: #ffff00; font-weight: bold; }\n  .highlight-red { color: #ff4d4d; font-weight: bold; }\n  .bookmaker-logo { width: 25px; height: 25px; vertical-align: middle; margin-right: 5px; }\n<\/style>\n<\/head>\n<body>\n<h1>Football & Horse Racing Odds<\/h1>\n<div id=\"odds-container\">Loading odds...<\/div>\n\n<script>\nconst API_KEY = \"a70a7ca5238540f4c0b75d9bd254d9b0\"; \/\/ <--- Replace with your API key\nconst REGIONS = \"uk\";\nconst MARKETS = \"h2h\"; \/\/ For football\nconst CACHE_TIME = 30 * 60 * 1000; \/\/ 30 minutes\nconst AUTO_REFRESH = 30 * 60 * 1000; \/\/ 30 minutes auto-refresh\n\n\/\/ Top football leagues for free plan\nconst FOOTBALL_LEAGUES = [\n    \"soccer_epl\",\n    \"soccer_champ\",\n    \"soccer_primera\",\n    \"soccer_serie_a\",\n    \"soccer_bundesliga\"\n];\n\n\/\/ Horse racing\nconst HORSE_RACING = [\"horse_uk\"]; \/\/ UK horse racing\n\nfunction oddsToProbability(odds) {\n    return odds ? (1 \/ odds * 100).toFixed(1) : 0;\n}\n\nfunction getColorClass(value, max, min) {\n    if (value === max) return 'highlight-green';\n    if (value === min) return 'highlight-red';\n    return 'highlight-yellow';\n}\n\nasync function fetchOdds(sport) {\n    const url = `https:\/\/api.the-odds-api.com\/v4\/sports\/${sport}\/odds\/?regions=${REGIONS}&markets=${MARKETS}&apiKey=${API_KEY}`;\n    try {\n        const response = await fetch(url);\n        if (!response.ok) throw new Error(`API request failed for ${sport}`);\n        return await response.json();\n    } catch (err) {\n        console.error(err);\n        return [];\n    }\n}\n\nasync function fetchAllOdds() {\n    const container = document.getElementById(\"odds-container\");\n\n    const cached = localStorage.getItem(\"odds_cache\");\n    const cacheTime = localStorage.getItem(\"odds_cache_time\");\n    if (cached && cacheTime && (Date.now() - cacheTime < CACHE_TIME)) {\n        container.innerHTML = cached;\n        return;\n    }\n\n    let html = \"\";\n\n    \/\/ Football\n    for (const league of FOOTBALL_LEAGUES) {\n        const matches = await fetchOdds(league);\n        if (matches.length === 0) continue;\n\n        html += `<div class=\"league\">${league.toUpperCase()}<\/div>`;\n        html += `<table>\n                    <tr>\n                        <th>Match<\/th>\n                        <th>Bookmaker<\/th>\n                        <th>Odds (1X2)<\/th>\n                        <th>Predicted %<\/th>\n                    <\/tr>`;\n\n        matches.forEach(match => {\n            const home = match.home_team;\n            const away = match.away_team;\n            const bookmaker = match.bookmakers[0];\n            const bookmakerName = bookmaker?.title || \"-\";\n            const bookmakerLogo = bookmaker?.logo || \"\";\n            const outcomes = bookmaker?.markets[0]?.outcomes || [];\n\n            const probs = outcomes.map(o => ({name: o.name, value: parseFloat(oddsToProbability(o.price))}));\n            const maxProb = Math.max(...probs.map(p => p.value));\n            const minProb = Math.min(...probs.map(p => p.value));\n\n            const oddsText = outcomes.map(o => `${o.name}: ${o.price}`).join(\" | \");\n            const probText = probs.map(p => `<span class=\"${getColorClass(p.value, maxProb, minProb)}\">${p.name}: ${p.value}%<\/span>`).join(\" | \");\n\n            html += `<tr>\n                        <td>${home} vs ${away}<\/td>\n                        <td>${bookmakerLogo ? `<img decoding=\"async\" src=\"${bookmakerLogo}\" class=\"bookmaker-logo\" \/>` : \"\"}${bookmakerName}<\/td>\n                        <td>${oddsText}<\/td>\n                        <td>${probText}<\/td>\n                     <\/tr>`;\n        });\n\n        html += `<\/table>`;\n    }\n\n    \/\/ Horse Racing\n    for (const raceCode of HORSE_RACING) {\n        const races = await fetchOdds(raceCode);\n        if (races.length === 0) continue;\n\n        html += `<div class=\"league\">HORSE RACING (${raceCode.toUpperCase()})<\/div>`;\n        html += `<table>\n                    <tr>\n                        <th>Race<\/th>\n                        <th>Bookmaker<\/th>\n                        <th>Runners & Odds<\/th>\n                        <th>Predicted %<\/th>\n                    <\/tr>`;\n\n        races.forEach(race => {\n            const raceName = race.name || \"Race\";\n            const bookmaker = race.bookmakers[0];\n            const bookmakerName = bookmaker?.title || \"-\";\n            const bookmakerLogo = bookmaker?.logo || \"\";\n            const outcomes = bookmaker?.markets[0]?.outcomes || [];\n\n            const probs = outcomes.map(o => ({name: o.name, value: parseFloat(oddsToProbability(o.price))}));\n            const maxProb = Math.max(...probs.map(p => p.value));\n            const minProb = Math.min(...probs.map(p => p.value));\n\n            const oddsText = outcomes.map(o => `${o.name}: ${o.price}`).join(\" | \");\n            const probText = probs.map(p => `<span class=\"${getColorClass(p.value, maxProb, minProb)}\">${p.name}: ${p.value}%<\/span>`).join(\" | \");\n\n            html += `<tr>\n                        <td>${raceName}<\/td>\n                        <td>${bookmakerLogo ? `<img decoding=\"async\" src=\"${bookmakerLogo}\" class=\"bookmaker-logo\" \/>` : \"\"}${bookmakerName}<\/td>\n                        <td>${oddsText}<\/td>\n                        <td>${probText}<\/td>\n                     <\/tr>`;\n        });\n\n        html += `<\/table>`;\n    }\n\n    container.innerHTML = html;\n    localStorage.setItem(\"odds_cache\", html);\n    localStorage.setItem(\"odds_cache_time\", Date.now());\n}\n\n\/\/ Initial fetch\nfetchAllOdds();\n\n\/\/ Auto-refresh safely every 30 minutes\nsetInterval(fetchAllOdds, AUTO_REFRESH);\n<\/script>\n<\/body>\n<\/html>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-41248666 e-flex e-con-boxed e-con e-parent\" data-id=\"41248666\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-6039cecf e-con-full e-flex e-con e-child\" data-id=\"6039cecf\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-6e14fd56 elementor-widget elementor-widget-heading\" data-id=\"6e14fd56\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Upcoming Fixtures<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-12fb300c elementor-widget elementor-widget-text-editor\" data-id=\"12fb300c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Stay updated with the latest fixtures across various sports. Each entry includes the date, time, and competing teams, making it easier for you to plan upcoming matches and events. This section is frequently updated to ensure you have the most current information at your fingertips.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-33ad8fa4 e-con-full e-flex e-con e-child\" data-id=\"33ad8fa4\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-82c776b elementor-widget elementor-widget-heading\" data-id=\"82c776b\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Latest Match Details<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-326114a0 elementor-widget elementor-widget-text-editor\" data-id=\"326114a0\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Explore the detailed information for all upcoming matches. Get insights into when and where the games are taking place, as well as the teams that will be competing. This is designed to keep you informed and engaged with your favorite sports.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-605f98eb e-flex e-con-boxed e-con e-parent\" data-id=\"605f98eb\" data-element_type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-51256226 e-con-full e-flex e-con e-child\" data-id=\"51256226\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-406abb92 elementor-widget elementor-widget-heading\" data-id=\"406abb92\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Get Winning Sports Insights Today<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5fb07247 elementor-widget elementor-widget-text-editor\" data-id=\"5fb07247\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Subscribe now for exclusive sports tips that keep you ahead of the game. Join our community and start making informed decisions.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2dc48643 elementor-mobile-button-align-stretch elementor-button-align-stretch elementor-widget elementor-widget-form\" data-id=\"2dc48643\" data-element_type=\"widget\" data-settings=\"{&quot;button_width&quot;:&quot;30&quot;,&quot;step_next_label&quot;:&quot;Submit&quot;,&quot;step_previous_label&quot;:&quot;Go Back&quot;,&quot;button_width_tablet&quot;:&quot;40&quot;,&quot;button_width_mobile&quot;:&quot;100&quot;,&quot;step_type&quot;:&quot;number_text&quot;,&quot;step_icon_shape&quot;:&quot;circle&quot;}\" data-widget_type=\"form.default\">\n\t\t\t\t\t\t\t<form class=\"elementor-form\" method=\"post\" name=\"Subscribe Today\" aria-label=\"Subscribe Today\">\n\t\t\t<input type=\"hidden\" name=\"post_id\" value=\"27\"\/>\n\t\t\t<input type=\"hidden\" name=\"form_id\" value=\"2dc48643\"\/>\n\t\t\t<input type=\"hidden\" name=\"referer_title\" value=\"Fixtures\" \/>\n\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"queried_id\" value=\"27\"\/>\n\t\t\t\n\t\t\t<div class=\"elementor-form-fields-wrapper elementor-labels-above\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-type-email elementor-field-group elementor-column elementor-field-group-name elementor-col-70 elementor-md-60\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<input size=\"1\" type=\"email\" name=\"form_fields[name]\" id=\"form-field-name\" class=\"elementor-field elementor-size-sm  elementor-field-textual\" placeholder=\"Your email address\">\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<div class=\"elementor-field-group elementor-column elementor-field-type-submit elementor-col-30 e-form__buttons elementor-md-40 elementor-sm-100\">\n\t\t\t\t\t<button class=\"elementor-button elementor-size-sm\" type=\"submit\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Join Now<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/button>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/form>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2f5e76b4 elementor-widget elementor-widget-text-editor\" data-id=\"2f5e76b4\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>By clicking Join Now, you acknowledge our Terms of Service.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Football &#038; Horse Racing Odds Football &#038; Horse Racing Odds Loading odds&#8230; Upcoming Fixtures Stay updated with the latest fixtures across various sports. Each entry includes the date, time, and competing teams, making it easier for you to plan upcoming matches and events. This section is frequently updated to ensure you have the most current [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-27","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/aiwinningtips.com\/index.php?rest_route=\/wp\/v2\/pages\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aiwinningtips.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/aiwinningtips.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/aiwinningtips.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aiwinningtips.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27"}],"version-history":[{"count":5,"href":"https:\/\/aiwinningtips.com\/index.php?rest_route=\/wp\/v2\/pages\/27\/revisions"}],"predecessor-version":[{"id":732,"href":"https:\/\/aiwinningtips.com\/index.php?rest_route=\/wp\/v2\/pages\/27\/revisions\/732"}],"wp:attachment":[{"href":"https:\/\/aiwinningtips.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}