View Categories

How to Connect Shopify to Google Sheets – Query E-Commerce Data with SQL

7 min read

Query Streams transforms your Shopify store data into SQL-queryable tables, letting you import live orders, products, customers, and inventory directly into Google Sheets. No API coding, no manual exports—just write SQL queries and get real-time e-commerce data in your spreadsheet. Sign up free at QueryStreams.com and start querying your Shopify store in minutes.

16 Shopify Tables

Orders, products, inventory, customers, fulfillments, and more

5-Minute Order Sync

Orders and line items refresh every 5 minutes for near-real-time sales tracking

AES-256 Encrypted

Your Shopify API credentials are stored securely on your network, never in the cloud

Any Shopify Plan

Works with Basic, Shopify, Advanced, and Plus — no special plan required

What Shopify Data Can You Access?

Query Streams syncs your Shopify Admin API data to an AES-256 encrypted local cache, transforming it into SQL-queryable tables. Every table includes a raw_data JSON column with the complete API response—including multi-currency amounts, custom note attributes, tax lines, and more.

Sales & Orders

  • orders Sales orders with status, amounts, and customer info
  • order_line_items Individual items with SKU, quantity, and pricing
  • fulfillments Shipment and tracking information
  • transactions Payment transactions with gateway details
  • refunds Refund records with line item breakdown
  • abandoned_checkouts Cart abandonment for recovery campaigns

Products & Catalog

  • products Product catalog with title, vendor, and status
  • variants Product variants with SKU, pricing, and inventory
  • collections Custom and smart product collections
  • price_rules Discount rules and promotions
  • discount_codes Coupon codes with usage counts

Inventory

  • inventory_levels Stock quantities by location
  • locations Warehouses and store locations

Customers

  • customers Profiles with order history and lifetime value
  • draft_orders Pending and incomplete orders

Prerequisites

1
Query Streams Account

Sign up free — no credit card required

2
Query Streams Network Agent

Windows service installed on your network. Install guide

3
Shopify Store

Active Shopify store on any plan (Basic, Shopify, Advanced, or Plus)

4
Shopify Custom App

A custom app in Shopify Dev Dashboard with Admin API scopes (we’ll create this)

5
Google Sheets

With the Query Streams add-on installed from Google Workspace Marketplace

Setup Guide

1Install Agent
2Create App
3Add Connector
4Sync Schedule
5Install Add-on

Step 1: Install the Query Streams Network Agent

  1. Log in to my.querystreams.com
  2. Navigate to Network Agents in the left sidebar
  3. Click Download Agent and run the Windows installer
  4. The agent installs as a Windows service and connects automatically
  5. Your agent appears as “Online” in the portal within 30 seconds

Step 2: Create a Shopify Custom App

  1. Go to partners.shopify.com and log in
  2. Navigate to AppsCreate appCreate app manually
  3. Name your app (e.g., “Query Streams Data Connector”) and click Create app
  4. In your app settings, go to ConfigurationAdmin API integrationConfigure
  5. Select the required scopes: read_orders, read_products, read_customers, read_inventory, read_locations, read_fulfillments, read_price_rules, read_discounts
  6. Click Save, then go to the Overview tab
  7. Copy your Client ID (32-character hex string)
  8. Click Show secret to reveal your Client Secret
  9. Install the app on your store

Query Streams only requests read scopes. It never creates, updates, or deletes orders, products, customers, or any Shopify data.

Step 3: Add the Shopify Connector

  1. Open the Network Agent interface at http://localhost:1823
  2. Click Add Connection and select Shopify
  3. Enter your Store URL (e.g., your-store.myshopify.com), Client ID, and Client Secret
  4. Click Test Connection — Query Streams exchanges credentials for an access token
  5. On success, you’ll see your store name, plan, and verified API scopes
  6. Click Next to configure sync schedules and install pre-built queries

Step 4: Configure Your Sync Schedule

Orders & Line ItemsEvery 5 minutes
Fulfillments / TransactionsEvery 15 minutes
Products & VariantsEvery 15 minutes
Customers & InventoryEvery 15 minutes
CollectionsHourly
LocationsEvery 6 hours

All 16 tables sync by default. Disable any table by setting its interval to Never. Click Save — the initial sync starts immediately.

Step 5: Install the Google Sheets Add-on

  1. Open Google Sheets in your browser
  2. Go to ExtensionsAdd-onsGet add-ons
  3. Search for “Query Streams”
  4. Click Install and grant the required permissions
  5. Access it via ExtensionsQuery StreamsOpen
  6. Sign in with your Query Streams account credentials
  7. Or install directly: Install Query Streams for Google Sheets

You’re connected! Open Query Streams in Google Sheets, click Saved Queries, and find your Shopify folder with pre-built queries for daily sales, top products, inventory alerts, and more. Select any query and click Run to pull live data.

Example Shopify SQL Queries

Daily Sales Summary (Last 30 Days)
SELECT
    DATE(created_at) AS order_date,
    COUNT(*) AS order_count,
    SUM(total_price) AS revenue,
    AVG(total_price) AS avg_order_value
FROM shopify.orders
WHERE financial_status = 'paid'
  AND created_at >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY DATE(created_at)
ORDER BY order_date DESC;
Top Products by Revenue
SELECT
    p.title AS product,
    p.vendor,
    SUM(li.quantity) AS units_sold,
    SUM(li.price * li.quantity) AS revenue
FROM shopify.order_line_items li
JOIN shopify.products p ON li.product_id = p.id
JOIN shopify.orders o ON li.order_id = o.id
WHERE o.financial_status = 'paid'
  AND o.created_at >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY p.id, p.title, p.vendor
ORDER BY revenue DESC
LIMIT 20;
Low Stock Alert
SELECT
    p.title AS product,
    v.title AS variant,
    v.sku,
    il.available AS stock_qty,
    l.name AS location
FROM shopify.inventory_levels il
JOIN shopify.variants v ON il.inventory_item_id = v.inventory_item_id
JOIN shopify.products p ON v.product_id = p.id
JOIN shopify.locations l ON il.location_id = l.id
WHERE il.available < 10
  AND l.active = true
ORDER BY il.available ASC;

Share Shopify Reports Without Sharing Credentials

Open any Shopify query in the Query Builder → click the Sharing tab → enter email addresses → click Share. Recipients get live Shopify data in their Google Sheets add-on — without access to your API credentials, store admin, or SQL code.

Frequently Asked Questions

Do I need a Shopify Plus plan to use Query Streams?
No. Query Streams works with any Shopify plan, including Basic, Shopify, and Advanced. Plus stores benefit from higher API rate limits, but Query Streams handles rate limiting automatically on all plans.
Why does Query Streams need a Custom App instead of a private app?
Shopify discontinued private apps in favor of custom apps for the Admin API. Custom apps provide the same read-only access but use OAuth client credentials — a more secure and standard authentication approach supported by all Shopify plans.
Can I connect multiple Shopify stores?
Yes. Add a separate connector for each store — each with its own Custom App credentials. All stores appear as distinct data sources in the query builder, so you can even JOIN data across stores in a single SQL query.
How are Shopify amounts formatted in SQL?
Unlike Stripe, Shopify returns amounts as decimal values (e.g., 99.99 not 9999), so no conversion is needed in your SQL queries. Multi-currency amounts are available in the raw_data JSON column.

Related Guides

Category: API Connectors

Tags: Shopify, Google Sheets, API, E-commerce, SQL, Orders, Inventory, Real-Time Data

Meta Description: Connect Shopify to Google Sheets with SQL. Query orders, products, inventory, and customers live — no API coding required. Step-by-step setup guide.

Updated on June 3, 2026

Powered by BetterDocs