Guide / Quote sportive in Google Sheets

Quote sportive in Google Sheets

Dal team di dino.markets · Aggiornato il 25 nov 2026

Questa guida mette in un foglio di calcolo le moneyline, gli spread e i totali NFL di tre bookmaker. Uno script scrive il file e Sheets lo importa.

Scrivi il file CSV

Crea una chiave nella dashboard, esportala come DINO_API_KEY, poi esegui questo con Python 3.

import csv
import json
import os
from urllib.request import Request, urlopen

URL = "https://api.dino.markets/v2/odds?league=nfl&books=draftkings,fanduel,pinnacle&limit=100"
request = Request(URL, headers={"Authorization": f"Bearer {os.environ['DINO_API_KEY']}"})

with urlopen(request, timeout=30) as response:
    events = json.load(response)["events"]

with open("odds.csv", "w", newline="") as file:
    rows = csv.writer(file)
    rows.writerow(["start_time", "away", "home", "book", "market", "outcome", "point", "decimal", "american", "updated_at"])
    count = 0
    for event in events:
        team = {p["role"]: p["name"] for p in event["participants"]}
        for book in event["books"]:
            for market in book["markets"]:
                for o in market["outcomes"]:
                    rows.writerow([event["start_time"], team.get("away"), team.get("home"), book["name"], market["key"],
                                   o["name"], o.get("point"), o["price"], o["american"], market["updated_at"]])
                    count += 1

print(f"{count} rows for {len(events)} games in odds.csv")

Eseguito il 25 nov 2026 alle 03:33 UTC:

Output
306 rows for 30 games in odds.csv

Le prime righe del file:

start_time,away,home,book,market,outcome,point,decimal,american,updated_at
2026-11-26T01:00:00Z,Green Bay Packers,Los Angeles Rams,DraftKings,moneyline,Los Angeles Rams,,1.746,-134,2026-11-25T03:22:14Z
2026-11-26T01:00:00Z,Green Bay Packers,Los Angeles Rams,DraftKings,moneyline,Green Bay Packers,,2.140,+114,2026-11-25T03:22:14Z
2026-11-26T01:00:00Z,Green Bay Packers,Los Angeles Rams,DraftKings,spread,Los Angeles Rams,-2.5,1.917,-109,2026-11-25T01:56:41Z
2026-11-26T01:00:00Z,Green Bay Packers,Los Angeles Rams,DraftKings,spread,Green Bay Packers,2.5,1.909,-110,2026-11-25T01:56:41Z

Importalo in Sheets

In un foglio Google, scegli File, poi Importa, poi Carica, e seleziona odds.csv. Ogni prezzo è una riga, quindi puoi filtrare per partita, bookmaker o mercato.

Aggiorna i prezzi

Esegui di nuovo lo script e importa il nuovo file al posto del vecchio foglio. Ogni esecuzione costa 1 credito.

Chiedi altre quote

Cambia league con un valore qualsiasi di GET /v2/leagues, che è gratuito, e cambia books con i bookmaker che segui. La pagina delle fonti li elenca.

Domande

Serve un componente aggiuntivo?

No. Lo script scrive un semplice file CSV che Sheets importa.

Il foglio si aggiorna da solo?

Non con questo metodo. Esegui di nuovo lo script e importa il nuovo file.

Quanto costa un aggiornamento?

1 credito. Lo script fa una chiamata, e l'esecuzione di questa guida ha restituito 30 partite.

Cos'è updated_at?

Il momento in cui abbiamo visto per la prima volta i prezzi attuali di quel mercato.