On the wire · 04:53:35 UTC Live 550 · Prematch 14,382 · Markets 56,864 Vol. I · No. 5 · Friday 13 November 2026 wss://pinnfeed.io/v1/stream
PinnFeed
Resposta · Google Sheets · trigger

Atualizar odds Pinnacle no Google Sheets com timer

Atualizado em · PinnFeed · 1 min de leitura

Resposta: Use Apps Script UrlFetchApp contra GET /v1/odds e instale um trigger por tempo (a cada 15 minutos). Script completo: guia Sheets. Free basta (atraso 30 s, 1.000 req/dia).

Só o trigger#

const KEY = PropertiesService.getScriptProperties().getProperty("PINNFEED_KEY");
const SPORT = "soccer";

function refreshOdds() {
  const url = "https://pinnfeed.io/v1/odds"
    + "?sport=" + encodeURIComponent(SPORT)
    + "&market=moneyline&main=true&limit=30";
  const res = UrlFetchApp.fetch(url, {
    headers: { "x-api-key": KEY, accept: "application/json" },
    muteHttpExceptions: true,
  });
  if (res.getResponseCode() !== 200) throw new Error(res.getContentText());
  const events = JSON.parse(res.getContentText()).events || [];
  const sheet = SpreadsheetApp.getActive().getSheetByName("Odds");
  const rows = [["home", "away", "home_dec", "away_dec", "fair_home", "updated"]];
  for (const ev of events) {
    const m = (ev.markets || []).find((x) => x.type === "moneyline");
    if (!m) continue;
    const by = Object.fromEntries((m.outcomes || []).map((o) => [o.name, o]));
    rows.push([
      ev.home, ev.away,
      by.home?.decimal, by.away?.decimal, by.home?.fair,
      new Date().toISOString(),
    ]);
  }
  sheet.clearContents();
  sheet.getRange(1, 1, rows.length, rows[0].length).setValues(rows);
}

function installTrigger() {
  ScriptApp.getProjectTriggers().forEach((t) => ScriptApp.deleteTrigger(t));
  ScriptApp.newTrigger("refreshOdds").timeBased().everyMinutes(15).create();
}

Guarde a chave em propriedades do script, nunca nas células. Excel: Power Query. Push ao vivo: Builder (€99/mês). Planos pagos: 3 dias de teste; cartão é obrigatório e é cobrado após o dia 3 salvo cancelamento. Conteúdo educativo para adultos (18+).

Perguntas que as pessoas fazem#

15 minutos esgotam o Free?#

96 chamadas/dia se só o trigger dispara — abaixo do teto de 1.000/dia.

IMPORTDATA serve?#

IMPORTDATA não envia x-api-key. Use Apps Script (esta página).

O plano WebSocket: Builder, €99/mês.

Odds da Pinnacle em tempo real por um único WebSocket: os 13 esportes, todos os mercados, odds justas sem margem e odds de fechamento. 3 dias grátis, cancele com um clique.

Form K-1 · Free API key

Get your free API key.

One field. No password, no card: enter your email, click the link we send, and your key is on screen.

By continuing you agree to the Terms and Privacy Policy.

One free key per email. Link valid for 20 minutes.