Ask Nova, get SQL + charts
Meet Nova Database REST APIOne key per partner. No credentials shared.
Build an API AutomationScheduled sync to 6+ platforms
Explore API to SQLQuery APIs with SQL, no code
Explore AI Database MCPClaude, Cursor, ChatGPT & Grok talk to your data
Connect AIQuery Streams transforms your HubSpot CRM into SQL-queryable tables, letting you import live contacts, companies, deals, tickets, and pipeline data directly into Google Sheets. No API coding, no manual exports—just write SQL and get real-time CRM analytics in your spreadsheet. Sign up free at QueryStreams.com and start querying your HubSpot account in minutes.
25+ HubSpot Tables
Query contacts, deals, tickets, companies, and all engagement history
5-Minute Sync
Deals and tickets update every 5 minutes — pipeline always current
AES-256 Encrypted
API cache and credentials stored with military-grade encryption
Secure Sharing
Share query results without exposing your HubSpot credentials
What HubSpot Data Can You Access?
Query Streams syncs your HubSpot API data to an encrypted local cache, exposing it as SQL-queryable tables. Every table includes a raw_data JSON column with the complete API response — including all custom properties.
Core CRM
- contacts
- companies
- deals
- tickets
- owners
- pipelines & stages
Engagements
- calls
- emails
- meetings
- notes
- tasks
- communications
Commerce
- quotes
- invoices
- subscriptions
- payments
- products
- line_items
Marketing
- forms & submissions
- marketing_events
- feedback_submissions
- lists
- workflows
- associations
Prerequisites
Query Streams Network Agent
Installed as a Windows service on your network. Creates a secure outbound-only connection.
Install the Agent →HubSpot Account
Any HubSpot plan — Free, Starter, Professional, or Enterprise.
HubSpot Private App Token
A pat-xxx access token from a HubSpot Private App. No OAuth or browser redirects needed.
Google Sheets Add-on
Query Streams add-on installed from the Google Workspace Marketplace.
Get Google Sheets Add-on →Setup Guide
Step 1: Install the Query Streams Network Agent
- Log in to my.querystreams.com and go to Network Agents
- Click Download Agent and run the installer
- The agent installs as a Windows service and connects automatically
- Your agent appears as Online in the portal within 30 seconds
Step 2: Create a HubSpot Private App
Private Apps give you a simple access token — no OAuth flow, no browser redirects, no refresh token rotation.
- Log in to your HubSpot account
- Click the gear icon → Integrations → Private Apps
- Click Create a private app and give it a name (e.g., “Query Streams”)
- Go to the Scopes tab and enable:
crm.objects.contacts.read,crm.objects.companies.read,crm.objects.deals.read,crm.objects.owners.read,tickets,e-commerce - Click Create app, then Show token and copy the
pat-xxxtoken
Step 3: Add the HubSpot Connector
- Open the Network Agent interface at
http://localhost:1823 - Click Add Connection → select HubSpot
- Paste your Private App Access Token (
pat-xxx) - Click Test Connection — Query Streams validates your token and displays your HubSpot portal ID
- Click Next — when prompted, keep Install Query Library queries enabled to get 20–50 pre-built HubSpot queries
- Click Save — the initial sync starts immediately
Step 4: Configure Your Sync Schedule
All HubSpot tables sync automatically. Adjust frequencies per table based on how time-sensitive the data is:
Step 5: Install the Google Sheets Add-on and Run Queries
- Open Google Sheets → Extensions → Add-ons → Get add-ons
- Search for “Query Streams” and click Install
- Grant the required permissions
- Click Extensions → Query Streams → Open to launch the sidebar
- Sign in with your Query Streams account
- Click Saved Queries → open the HubSpot folder — pre-built queries are organized by Pipeline, Contacts, Companies, Sales, and Support
- Select a query, adjust any filters, and click Run — live HubSpot data populates the sheet
You’re connected!
Your HubSpot data is live in Google Sheets. Run any saved query on demand — or parallel-run multiple queries into separate sheet tabs simultaneously.
Example HubSpot SQL Queries
Write custom queries in the Query Builder at my.querystreams.com and run them directly from Google Sheets.
SELECT
p.label AS pipeline,
ps.label AS stage,
COUNT(d.id) AS deal_count,
SUM(d.amount) AS total_value,
AVG(d.amount) AS avg_deal_size
FROM hubspot.deals d
JOIN hubspot.pipelines p ON d.pipeline = p.id
JOIN hubspot.pipeline_stages ps ON d.dealstage = ps.id
WHERE d.closedate >= CURRENT_DATE
AND d.closedate <= CURRENT_DATE + INTERVAL '90 days'
GROUP BY p.label, ps.label, ps.display_order
ORDER BY ps.display_order;
SELECT
o.first_name || ' ' || o.last_name AS rep,
COUNT(CASE WHEN json_extract_string(d.raw_data, '$.properties.hs_is_closed_won') = 'true' THEN 1 END) AS won,
COUNT(CASE WHEN json_extract_string(d.raw_data, '$.properties.hs_is_closed') = 'true'
AND json_extract_string(d.raw_data, '$.properties.hs_is_closed_won') = 'false' THEN 1 END) AS lost,
ROUND(
COUNT(CASE WHEN json_extract_string(d.raw_data, '$.properties.hs_is_closed_won') = 'true' THEN 1 END)::DECIMAL /
NULLIF(COUNT(CASE WHEN json_extract_string(d.raw_data, '$.properties.hs_is_closed') = 'true' THEN 1 END), 0) * 100, 1
) AS win_rate_pct
FROM hubspot.deals d
JOIN hubspot.owners o ON d.hubspot_owner_id = o.id
WHERE d.updated_at >= CURRENT_DATE - INTERVAL '90 days'
GROUP BY o.id, o.first_name, o.last_name
ORDER BY win_rate_pct DESC;
SELECT
lifecyclestage,
COUNT(*) AS contact_count,
ROUND(COUNT(*)::DECIMAL / SUM(COUNT(*)) OVER () * 100, 1) AS pct
FROM hubspot.contacts
WHERE lifecyclestage IS NOT NULL
GROUP BY lifecyclestage
ORDER BY
CASE lifecyclestage
WHEN 'subscriber' THEN 1
WHEN 'lead' THEN 2
WHEN 'marketingqualifiedlead' THEN 3
WHEN 'salesqualifiedlead' THEN 4
WHEN 'opportunity' THEN 5
WHEN 'customer' THEN 6
ELSE 99
END;
Share HubSpot Reports Without Sharing Credentials
Frequently Asked Questions
❓ What HubSpot plan do I need? +
🔒 Is my HubSpot data secure? +
⚙️ Can I access custom HubSpot properties? +
raw_data JSON column. Access any custom property using: json_extract_string(raw_data, '$.properties.your_custom_field')✏️ Can Query Streams modify my HubSpot data? +
.read permissions.⏱️ How fresh is the data in Google Sheets? +
lastmodifieddate filter to only fetch changed records.Related Guides
Category: API Connectors
Tags: HubSpot, Google Sheets, Google Sheets Add-on, CRM Data, HubSpot API, SQL Queries, Live Data, Contacts, Companies, Deals, Tickets, Pipeline, Sales Analytics, Query Streams
Meta Description: Connect HubSpot to Google Sheets with Query Streams. Import live contacts, companies, deals, and pipeline data using SQL queries. No API coding required.

