Ver categorias

Como conectar o Stripe ao Google Sheets - Consultar dados de pagamento com SQL

Conectar o Stripe ao Google Sheets

Obtenha dados de Listrado em Planilhas Google

Importe dados em tempo real da sua conta Stripe para o Google Sheets e atualize-os quando quiser. Sem uploads de CSV, sem Apps Script, sem copiar e colar. Leva cerca de dez minutos na primeira vez, e o plano gratuito cobre esse custo.

Cerca de 10 minutos Não é necessário programar As credenciais permanecem com você. Qualquer navegador, qualquer dispositivo
Teve alguma dúvida? É só perguntar. Aberto Suporte Em Fluxos de Consulta (menu no canto superior direito → Suporte) e envie-nos uma mensagem. Pessoas reais leem as mensagens, e "Não sei o que esta tela está pedindo" é uma pergunta perfeitamente válida.

O resultado final será o que você obterá.

Logotipo listradoUma planilha do Google que exibe os resultados em tempo real de uma consulta SQL na sua conta Stripe, com um botão que busca as linhas mais recentes sempre que os dados forem alterados. Assim:

O Stripe armazena seus dados por trás de sua API. Para importá-los para o Google Sheets, geralmente é necessário exportar um arquivo CSV do painel do Stripe sempre que precisar de novos números. O Query Streams elimina essa necessidade: um pequeno programa auxiliar, chamado Agente, executa a consulta no local onde seus dados estão armazenados, e um complemento do Google Sheets solicita as linhas desejadas. Somente os resultados são transmitidos por meio de uma conexão criptografada, e o Google Sheets pode ser acessado de qualquer lugar: em qualquer navegador e em qualquer dispositivo.

ONDE O AGENTE CORREQualquer computador ou servidor sempre ligado com acesso à internet.Sua ListracontaAs chaves ficam aqui.Agente de fluxos de consultapossui as credenciaisFluxos de consultalink criptografadopela internet · apenas resultadosONDE QUER QUE VOCÊ ESTEJAQualquer navegador: laptop, tablet, celular, ChromebookPlanilhas GoogleAs fileiras chegam em uma folha.
O Agente trabalha em conjunto com seus dados. Sua planilha fica armazenada na nuvem do Google. Abra-a em qualquer lugar e as linhas aparecerão para você.

O que você vai precisar

Uma conta do Query Streams

O plano gratuito é suficiente para este guia. Cadastre-se em my.querystreams.com.

O Agente em qualquer computador sempre ligado

Um pequeno programa que roda em segundo plano e faz chamadas ao Stripe quando o Google Sheets solicita. Ele só precisa de acesso à internet.

Seu login do Stripe

Você fará login no Stripe uma única vez e concederá acesso de leitura. Nenhuma senha é digitada nos Fluxos de Consulta.

Qual computador receberá o Agente? Qualquer máquina que esteja sempre ligada e que já consiga acessar sua conta Stripe. O Google Sheets pode estar em qualquer lugar.Ele é executado no seu navegador.

Conecte-o em cinco etapas

  1. Crie sua conta

    Vá para my.querystreams.com e inscreva-se. Escolha o Gratuito plano. É um plano real, não uma versão de teste, e inclui a conexão da sua conta Stripe e a execução de consultas a partir do Google Sheets.

  2. Instale o Agente em qualquer computador que esteja sempre ligado.

    Faça login e abra DownloadInstale o Agente em qualquer computador ou servidor que esteja sempre ligado e com acesso à internet. Leva apenas um minuto e, a partir daí, ele inicia automaticamente.

    Por que um programa pequeno em vez de um driver? O Agente é um único instalador para Windows, Mac ou Linux (cerca de 85 MB no Windows, um pouco mais de 100 MB no Mac e Linux) que funciona silenciosamente em segundo plano. Ele estabelece uma única conexão de saída criptografada com o Query Streams, da mesma forma que um navegador, portanto, você não precisa abrir nenhuma porta de firewall nem configurar uma VPN. Suas chaves permanecem nessa máquina e as linhas são enviadas para onde você estiver, pela internet, se necessário. A única coisa do seu lado é o complemento.

    A página de download mostra Sua chave de acessoCole o código no Agente quando solicitado e aguarde até que o crachá exiba a mensagem. Conectado a fluxos de consultaEssa é a única coisa que você faz no próprio Agente.

    Guias completos, se você quiser: Janelas, Mac, Linux.

  3. Aponte para sua conta Stripe.

    De volta ao seu navegador, abra Agentes de dados (sob Dados (no menu superior). Seu agente está listado lá. Clique Adicionar conector e escolha Listrado. Need your Stripe credentials first? Open the walkthrough, then fill in:

    Create your Stripe credentials (about 8 minutes)

    Follow this with Stripe open in another tab. Query Streams keeps what you create here so your Agent can use it, and only ever reads from Stripe.

    Who can do this
    Account owner, Super Administrator, Administrator or Developer (the Stripe roles that can create API keys)
    Recomendado
    Restricted API key with Read-only permissions (rk_live_… for live data, rk_test_… for a sandbox)

    Antes de começar

    • A Stripe login with the Account owner, Super Administrator, Administrator or Developer role. Other roles (Analyst, View Only, Support and so on) cannot create API keys.
    • Access to the email inbox or phone Stripe sends verification codes to. Stripe asks for a code before it creates the key.
    • The Query Streams wizard open in another tab (Data Agents → Add connector → Stripe) with your Agent online, so you can paste the key the moment Stripe shows it.

    Steps

    1. Sign in and choose live data or a sandbox

      Sign in to the Stripe Dashboard. Stripe keeps live data and sandbox (test) data apart, and each has its own keys. For your real payments, stay in your business account, not a sandbox. For test data, open the Dashboard’s account picker, click Sandboxes, and open the sandbox you want.

      A live key cannot read sandbox data, and a sandbox key cannot read live data. If you want both, create one key in each and add each one as its own Stripe connector in Query Streams.

    2. Open the API keys page

      Open the API keys page. From inside the Dashboard you can also click Developers (bottom-left) and choose API keys. The page has two lists: Standard keys (publishable and secret keys) and Restricted keys.

      Using a sandbox? Open the sandbox first (step 1). Each sandbox has its own API keys page and its own keys.

    3. Start a restricted key

      In the Restricted keys list, click Create restricted key. Some accounts show it as + Create restricted key.

      Don’t use the publishable key (pk_…). It can’t read account data. A secret key (sk_…) also works in Query Streams, but it can do anything in your account, including refunds and payouts. Stripe recommends restricted keys, and Query Streams only needs to read.

    4. Say how the key will be used

      Stripe asks how you will use the key. Choose Building your own integration, then click Continue.

      Don’t choose Authorizing agent access to your account. That option tags the key for AI agents and adds Stripe’s approval rules. If you chose Providing this key to another website by mistake, tick Customize permissions for this key on the next screen. If you leave it unticked, Stripe gives the key its default permissions instead of the read-only list in step 7.

    5. Start from no permissions

      Stripe offers ready-made permission templates or a start from zero permissions. Choose to start from zero (pick your own permissions), so every permission begins at None.

      Stripe changes the wording on this screen often. Look for an option worded like Start from scratch or Choose my own, not a template. If the screen is not there, go straight to step 6.

    6. Name the key

      In Key name, type a name you will recognise later, for example Query Streams (read-only).

    7. Set Read on the 13 resources Query Streams syncs

      Each resource row has three choices: None, Read and Write. Click Read on these 13 rows and leave every other row at None. Under Core: Balance, Balance transaction sources, Charges and Refunds, Customers, Disputes, Events, Payment Intents, Payouts, Products. Under Billing: Coupons, Invoices, Prices, Subscriptions. To find a row fast, press Ctrl+F (Cmd+F on a Mac) and type the first word of its name.

      Never choose Write. Query Streams only reads, so a key with only Read can’t create charges, refunds or payouts, even if it leaks. You need Events even if you never sync the events table, because Query Streams reads Stripe’s event list to pick up changes between syncs. If you use Connect, leave the connected-account permissions at None. If a row name doesn’t match what you see, click Read on the All core resources and All Billing resources header rows instead. The key is still read-only, but it can read more than Query Streams uses.

    8. Create the key

      Click Create key.

    9. Enter the verification code

      Stripe sends a verification code by email or text message. Type it into the dialog. If the dialog doesn’t move on by itself, click Continue.

      No code? Check spam, or the phone number on your Stripe profile.

    10. Copy the key

      Stripe now shows the new key. It starts with rk_live_ (or rk_test_ in a sandbox). Click the key value to copy it, then paste it straight into Stripe Secret Key in the Query Streams wizard.

      In live mode, Stripe shows a key you created only this once and can’t reveal it again. Sandbox keys can be revealed at any time. Don’t send the key by email or chat. Query Streams stores it for your Agent and only ever reads with it.

    11. Note where the key is used

      In Add a note, type where the key is used, for example Query Streams Agent on the office computer. Then click Done. The key now appears in the Restricted keys list.

      The note shows up whenever you or a colleague later review your keys, so nobody expires this one by accident.

    Permissions to grant

    ResourceAcessoUsed for
    ClientesLercustomers table. Test connection also reads it first.
    Charges and RefundsLercharges and refunds tables. One row covers both, and there is no separate Refunds row.
    Payment IntentsLerpayment_intents table
    InvoicesLerinvoices and invoice_items tables. Invoice items have no row of their own.
    SubscriptionsLersubscriptions and subscription_items tables
    EquilíbrioLerbalance_transactions table (Stripe’s list of balance transactions, formerly called Balance history)
    Balance transaction sourcesLerbalance_transactions table: lets each transaction link to the charge, refund or payout behind it. Stripe says this also grants Read on Balance and Payouts.
    PayoutsLerpayouts table
    DisputesLerdisputes table
    ProdutosLerproducts table
    PreçosLerprices table
    CouponsLercoupons table
    EventsLerevents table, and the change feed that keeps customers, subscriptions, invoices, invoice items, charges, payment intents, refunds, disputes, payouts, products, prices and coupons up to date between syncs

    Paste into Query Streams

    Chave secreta do Stripe
    The restricted key you copied in step 10 (starts with rk_live_ or rk_test_). A secret key (sk_live_ or sk_test_) also works, but it can do far more than read.

    Common problems

    Test connection fails with Invalid API key.

    Why: Part of the key was missed when copying, a space was added, the publishable key (pk_…) was pasted, or someone expired or rotated the key in Stripe.

    Fix: The key must start with rk_ or sk_. Paste it again with nothing before or after it. If you no longer have it (Stripe shows live keys only once), create a new restricted key (steps 3 to 11) and paste that one.

    Test connection says Connected, but some tables stay empty and their sync shows a Stripe permission error (403). Newer Agents also show a warning under Test connection that names the tables the key cannot read.

    Why: The key is missing Read on that table’s row. Stripe’s error message names the missing permission, for example rak_event_read means Events.

    Fix: On the Stripe API keys page, click the ⋯ menu next to the key, choose Edit key, set the missing row to Read, and save. The key itself does not change, so there is nothing to paste again. Click Test connection again in Query Streams.

    Connected, but you only see test data, or the tables are empty even though you take real payments.

    Why: The key comes from a sandbox (rk_test_) when you wanted live data, or the other way round.

    Fix: Check how the key starts. For live data, use the account picker to leave the sandbox, create the key again (steps 2 to 11), then open the connector in Data Agents, click Edit, and paste it into Stripe Secret Key. Keep test and live as separate connectors.

    A connector that used to work stops syncing with Invalid API key.

    Why: Someone rotated or expired the key in Stripe. A rotated key keeps working only until the expiration chosen at rotation, which is at most 7 days.

    Fix: Create a new restricted key, or copy the replacement from the rotation. In Query Streams, open the connector, click Edit, paste the key into Stripe Secret Key, click Test connection, then click Save.

    You can’t see Create restricted key, or the API keys page won’t open.

    Why: Your Stripe role can’t manage API keys. Analyst, View Only and support roles can’t.

    Fix: Ask your Stripe account owner, an Administrator or a Developer to create the key for you, or to change your role.

    Stripe emails you that it blocked a request, and syncs fail even though the key is correct.

    Why: An access policy on the key (IP addresses or Advanced) doesn’t allow the Agent computer’s internet address, or it blocks a VPN or proxy that the computer uses.

    Fix: On the API keys page, click ⋯ next to the key, choose Manage access policy, and either choose a policy that allows the Agent computer’s public IP address or choose None. Then click Save.

    The key was exposed (sent in an email or chat, or saved in a shared file), or someone who had it left your team.

    Why: Anyone holding the key can read everything its permissions allow.

    Fix: On the API keys page, click ⋯ next to the key and choose Rotate key. In Expiration, pick Now to cut off the old key at once, then click Rotate API key. Copy the new key, and paste it into the connector (Edit → Stripe Secret Key → Test connection → Save).

    You want Query Streams to stop reading this Stripe account.

    Why: Deleting the connector does not disable the key. It stays valid in Stripe until you expire it.

    Fix: On the API keys page, click ⋯ next to the key, choose Expire key, and click Expire key again to confirm. Then delete the connector in Data Agents.

    Limits to know

    • Events go back 30 days. Stripe’s event list reaches only 30 days back, so the events table never holds more than the last 30 days. Query Streams also reads events to pick up changes between syncs, so if a connector is switched off for more than about four weeks, its next sync reads its tables again in full.
    • Request speed: Stripe allows 100 API requests per second in live mode and 25 in a sandbox, and most individual endpoints allow 25. Each request returns at most 100 records, so a first sync of 1,000,000 charges is about 10,000 requests, roughly 7 minutes at 25 per second. Sandbox syncs are slower.
    • Monthly read allowance: Stripe expects an account’s read requests to average no more than 500 per transaction over a rolling 30 days, with a minimum of 10,000 a month. Every enabled table makes at least one request each time it syncs, so on a new or low-volume account, set longer sync intervals on tables you don’t need minute by minute.
    • One mode per key: a key reads only the mode it was created in (live, or one particular sandbox).
    • Connect: the key reads your own account’s objects only. Payments on connected accounts are not synced.
    • Showing the key again: Stripe shows a live key you created only once, while sandbox keys can be revealed at any time. When you rotate a key, the old one keeps working for at most 7 days.

    Steps verified 8 October 2026. Sources: docs.stripe.com/keys, docs.stripe.com/keys/restricted-api-keys, docs.stripe.com/keys-best-practices, docs.stripe.com/stripe-apps/reference/permissions, docs.stripe.com/sandboxes, docs.stripe.com/testing-use-cases, docs.stripe.com/rate-limits, docs.stripe.com/api/events/list, docs.stripe.com/api/balance_transactions/list, docs.stripe.com/api/errors, docs.stripe.com/get-started/account/teams/roles, docs.stripe.com/workbench, support.stripe.com/questions/plugin-user-migration-guide, stripe.com/sessions/2026/building-security-first-stripe, posthog.com/docs/cdp/sources/stripe, help.chaserhq.com/use-chaser-with-stripe, homerunner.io/docs/creating-stripe-restrict-key-for-homer…, chargebee.com/docs/reveal/transactions/get-started/stripe…, nango.dev/docs/api-integrations/stripe-api-key/connect, fivetran.com/docs/connectors/applications/stripe/troubles….

    Nome da conexão
    Qualquer nome que você reconheça mais tarde, como Banco de Dados de Vendas.
    Chave secreta do Stripe
    Sua chave secreta do Stripe pode ser encontrada no painel do Stripe, em Desenvolvedores, Chaves de API; ela começa com sk_live_ ou sk_test_.

    Clique em Teste de conexãoQuando lê Conectado, clique SalvarA conexão chega ao seu agente em poucos segundos.

    O teste falhou? Usually a missing permission, or a credential from the wrong Stripe account. The walkthrough above lists the common problems and their fixes.

  4. Adicionar fluxos de consulta ao Google Sheets

    Abra qualquer planilha do Google e acesse Extensões → Complementos → Obter complementos, procurar Fluxos de consultae clique InstalarOu instale-o diretamente de Consultar fluxos no Google Workspace MarketplaceO Google pedirá que você permita o complemento; isso é normal.

    Depois disso, estará presente em todas as Planilhas Google que você abrir: um ícone do Query Streams no painel lateral à direita, também listado em ExtensõesNão há necessidade de fazer login separadamente. O sistema reconhece a conta do Google que você já utiliza, portanto, o e-mail precisa ser o mesmo cadastrado na sua conta do Query Streams.

  5. Puxe sua primeira mesa.

    Clique no ícone "Consultar Fluxos" no painel lateral à direita da planilha (ou encontre-o em "Acessar Fluxos"). Extensões). Escolher Fluxo de consulta e selecione a conexão que você acabou de fazer.

    Digite a consulta que deseja executar. Esta consulta extrai algumas colunas de uma tabela. stripe.faturas mesa:

    Exemplo · SQL
    SELECT number, status, amount_due / 100.0 AS amount_due, currency FROM stripe.invoices ORDER BY created DESC LIMIT 100;

    Sob Folha de Destino Selecione a aba onde as linhas devem ser exibidas e clique em Executar consultaAs linhas aparecem nessa aba em um ou dois segundos. Clique em "Executar consulta" novamente sempre que os dados forem alterados e a aba será atualizada automaticamente.

    Não conhece SQL? Em vez disso, crie a consulta no portal Query Streams. Construtor de consultas Exibe suas tabelas e colunas para que você possa apontar e clicar. Nos planos Business, você também pode usar o Nova em linguagem natural ("mostre-me os clientes nos EUA") e ele gera o SQL para você. Salve a consulta e ela estará a um clique de distância no portal e na lista de Consultas Salvas do complemento, a partir do plano Personal Core.

É isso. Seus dados estão na planilha e permanecem atualizados com um clique. Nada saiu da sua rede, exceto as linhas que você solicitou.

Boas próximas jogadas

  • Salvar consulta no portal, para que você possa executá-lo novamente com um clique, a partir do Google Sheets ou do Excel.
  • Adicionar um filtro como um intervalo de datas, para que a mesma consulta possa responder "este mês" sem precisar editar.
  • Compartilhe os resultados Com um colega. Eles veem as fileiras, não suas credenciais.

Perguntas que as pessoas fazem

A minha conta Stripe precisa estar no mesmo computador em que uso o Planilhas Google?

Não. Apenas o agente precisa estar onde sua conta do Stripe está instalada. O Google Sheets funciona no seu navegador em qualquer dispositivo. Abra o complemento com a mesma conta do Google e suas conexões estarão lá.

Meus dados são copiados para o Query Streams?

Não. O agente executa a consulta no local onde seus dados estão armazenados e envia apenas as linhas retornadas. Nada é sincronizado ou armazenado nesse meio tempo.

O plano gratuito realmente cobre isso?

Sim. A versão gratuita é um plano permanente, não um período de teste com prazo de validade. Veja exatamente o que está incluído no plano. página de preços.

A planilha atualiza sozinha?

Clique em Executar Consulta novamente sempre que desejar as linhas mais recentes. Para uma planilha que seja atualizada automaticamente, sem que ninguém precise fazer nada, configure uma Automação no portal do Query Streams (Streams → Automação). Ela está disponível em todos os planos.

Ainda com dificuldades? Aberto Suporte Em Fluxos de Consulta, informe-nos em qual etapa você está e o que você vê. Nós o conectaremos.
O Query Streams também conecta os mesmos dados aExcelClaude, Cursor e ChatGPTuma API RESTe mais
Atualizado em outubro 8, 2026

Desenvolvido por BetterDocs