查看类别

如何将 HubSpot 连接到 Google Sheets - 使用 SQL 查询 CRM 数据

连接 · HubSpot 到 Google Sheets

从以下来源获取数据 HubSpot 进入 谷歌工作表

将 HubSpot 帐户中的实时数据导入 Google Sheets,并随时刷新。无需上传 CSV 文件、使用 Apps Script 或复制粘贴。首次操作大约只需十分钟,而且免费套餐即可满足所有需求。

大约10分钟 无需编程 凭证将一直随您保留 任何浏览器,任何设备
遇到任何问题?尽管问我们。 打开 支持 请在“查询流”(右上角菜单 → 支持)中给我们发送消息。我们会安排专人阅读您的消息,“我不知道这个屏幕需要什么”就是一个很好的问题。

你最终会得到什么

HubSpot标志一个 Google 表格,实时显示针对您的 HubSpot 帐户执行 SQL 查询的结果,并带有一个按钮,可在数据更改时自动更新最新行。例如:

HubSpot 将您的数据存储在其 API 之后。通常,每次需要新数据时,都需要从 HubSpot 控制面板导出 CSV 文件才能将其导入 Google Sheets。Query Streams 则避免了这一步骤:一个名为 Agent 的小型辅助程序会在您的数据所在位置运行查询,然后 Google Sheets 插件会向其请求所需的行。只有查询结果会通过加密链接传输,因此 Google Sheets 可以随时随地访问:任何设备上的任何浏览器。

特工奔跑的地方任何始终在线且联网的计算机或服务器您的 HubSpot帐户钥匙留在这里查询流代理持有凭证查询流加密链接通过互联网 · 仅显示结果无论你身在何处任何浏览器:笔记本电脑、平板电脑、手机、Chromebook谷歌工作表一行行数据以表格形式呈现
代理程序与您的数据共存。您的表格存储在 Google 云端。无论身在何处打开它,数据行都会同步显示。

你需要准备什么

查询流帐户

免费版足以满足本指南的需求。请注册: my.querystreams.com.

任何始终在线的计算机上的代理

这是一个在后台运行的小程序,当 Google Sheets 发出请求时,它会调用 HubSpot。它只需要网络连接即可。

您的 HubSpot 登录信息

您只需登录一次 HubSpot 并授予读取权限。查询流中无需输入任何密码。

哪个计算机获得代理? 任何始终在线且能够访问您的 HubSpot 帐户的设备。 Google Sheets 可以放在任何地方它在浏览器中运行。

分五步连接

  1. 创建您的帐户

    前往 my.querystreams.com 并注册。选择 免费 计划。这是一个正式的计划,不是试用版,它涵盖了连接您的 HubSpot 帐户以及从 Google Sheets 运行查询的内容。

  2. 在任何始终开机的计算机上安装代理程序。

    登录,打开 下载然后将代理程序安装到任何始终在线且可访问互联网的计算机或服务器上。安装只需一分钟,安装完成后即可自动启动。

    为什么使用小型程序而不是驱动程序? 该代理程序只需在 Windows、Mac 或 Linux 系统上安装一次(Windows 系统下约 85 MB,Mac 和 Linux 系统下略超过 100 MB),即可在后台静默运行。它会像浏览器一样,与 Query Streams 建立一条加密的出站连接,因此您无需打开任何防火墙端口或设置 VPN。您的密钥保留在本地计算机上,查询数据会传输到您所在的任何位置,必要时甚至会通过互联网传输。您这边只需要安装该插件即可。

    下载页面显示 您的访问密钥当代理提示时,将其粘贴到代理中,然后等待徽章读取。 已连接到查询流这是你在代理程序本身上唯一需要做的事情。

    完整攻略(如果您需要): Windows, 苹果, Linux.

  3. 将其指向您的 HubSpot 帐户

    返回浏览器,打开 数据代理 (在下面 数据 (在顶部菜单中)。您的经纪人信息就在那里。点击 添加连接器 并选择 HubSpot. Need your HubSpot credentials first? Open the walkthrough, then fill in:

    Create your HubSpot credentials (about 5 minutes)

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

    Who can do this
    Super admin, or a user with the Developer tools access permission (service keys). Legacy private apps need a Super admin.
    受到推崇的
    Service key with read-only scopes (Development → Keys → Service Keys). HubSpot recommends service keys for scheduled data syncs to BI tools and warehouses, and is removing the option to create new legacy private apps.

    开始之前

    • A HubSpot login that is a Super admin or has the Developer tools access permission. A service key can only be given scopes your own HubSpot user already has.
    • Know which HubSpot account you want to query. A key only reads the account it was created in, so create it in that account, not in a test or sandbox account.
    • Decide which HubSpot tables you want. Contacts, Companies, Deals, Owners, Pipelines, Pipeline Stages and Properties are on by default; every extra table needs its own read scope (see Permissions).
    • The Query Streams Agent installed and online on an always-on computer, and the Query Streams portal open in another tab: Data Agents → Add connector → HubSpot.

    Steps

    1. Sign in to HubSpot

      Open HubSpot in a new tab and sign in as a Super admin, or as a user with the Developer tools access permission.

      If you belong to more than one HubSpot account, switch to the one whose data you want before you continue. The key only works for the account it is created in.

    2. Open Development

      In the left main navigation, near the bottom, click Development (the </> icon). The Development page opens with its own sidebar: Overview, Projects, Legacy Apps, Monitoring, Keys and more.

      No Development item? Your HubSpot user is not a Super admin and lacks Developer tools access. Ask a Super admin to create the key, or to give you that permission.

    3. Open Service Keys

      In the Development sidebar, click Keys to expand it, then click Service Keys (it has a Beta badge). The Service Keys page opens; if you have none yet it says No Service Keys Created.

      Do not use Personal Access Key or Developer API Key, which sit just above Service Keys in the same menu. They are developer-tool keys and will not connect. Some accounts also reach this page from Settings (gear icon) → Integrations → Service Keys.

    4. Click Create service key

      In the top right of the Service Keys page, click Create service key. The Create Service Key page opens with a Name box and a Scopes section.

    5. Name the key

      In Name, type a name you will recognise later, for example Query Streams read-only. HubSpot shows this name in its logs.

      The name must be unique in your HubSpot account.

    6. Open the scope picker

      Next to Selected scopes, click + Add new scope. A panel opens on the right with a Find a scope search box and a checkbox for each scope.

    7. Tick the four required scopes

      Type each name into Find a scope and tick its checkbox: crm.objects.contacts.read, crm.objects.companies.read, crm.objects.deals.read, crm.objects.owners.read. These four cover every table Query Streams syncs by default.

      Tick only scopes that end in .read. Query Streams only reads from HubSpot; it never needs a .write scope.

    8. Tick scopes for any extra tables

      For each extra table you want, tick its scope from the Permissions list below. For example: crm.objects.tickets.read for Tickets; crm.objects.line_items.read for Line Items, Taxes, Discounts and Fees; crm.lists.read for Lists. Skip this step if the default tables are enough.

      You can add scopes later without making a new key (open the key, then Edit).

    9. Click Update

      Click Update in the right panel. The panel closes and your scopes are listed under Selected scopes.

    10. Check the scope list

      Read through Selected scopes. If anything ends in .write, click Delete next to it. Expand Summary of selected scopes if you want a plain-language list of what the key can see.

    11. Create the key

      Click Create in the top right, then confirm in the dialog box that opens.

    12. Open your new key

      Go to Development → Keys → Service Keys and click the name of the key you just created. Its details page opens with a Service Key box.

    13. Show and copy the key

      In the Service Key box the value is partly hidden and starts with pat- (for example pat-na1-…). Click Show under it, then click Copy.

      Use Copy rather than selecting the text by hand: a missing character, a trailing space or the hidden dots will fail the test. HubSpot does not show the key only once; you can come back and click Show again. Treat it like a password.

    14. Paste it into Query Streams and test

      In the Query Streams portal open Data Agents, click Add connector and choose HubSpot. Paste the key into App Access Token, type a Connection name, then click Test connection. The result reads Connected.

      Query Streams stores the key for your Agent and only ever reads your HubSpot data.

    15. Match the tables to your scopes

      On the Sync step that follows, leave on only the HubSpot tables whose scopes you ticked in steps 7 and 8, then finish the wizard.

      A table switched on without its scope fails to sync with a Forbidden error. Add the scope to the key (step 8) or switch the table off.

    Alternatives

    Use a legacy private app token

    Your account already has a legacy private app you want to reuse. HubSpot is removing the option to create new ones: accounts created on or after 28 September 2026 already cannot, and older accounts lose it on 26 October 2026. Existing private apps and their tokens keep working.

    Who can do this: Super admin

    1. Open Legacy Apps

      In HubSpot click Development in the left main navigation, then Legacy Apps in the Development sidebar.

      Older HubSpot navigation called this Settings → Integrations → Private Apps.

    2. Open your private app, or start a new one

      If the app is listed, click its name and go to step 6 (or step 5 to add scopes). If not, and the button is still there, click Create legacy app in the top right and choose Private in the dialog box.

      No Create legacy app button means creation is already switched off for your account. Use a service key (main steps) instead.

    3. Name the new app

      On the Basic Info tab, enter a name such as Query Streams read-only. The logo and description are optional.

    4. Add the read scopes

      Click the Scopes tab, click Add new scope, tick the same scopes as in main steps 7 and 8, then click Update. Then click Create app in the top right, read the access-token message in the dialog box and click Continue creating.

    5. Add scopes to an existing app (only if needed)

      On the app’s page click Edit app in the top right, open the Scopes tab, add the missing read scopes and save. The token string does not change when you change scopes.

    6. Show and copy the token

      On the app’s page click the Auth tab. Under Access token click Show token, then click Copy. The token starts with pat-. Paste it into App Access Token as in main step 14.

      If the HubSpot user who created the app is removed from HubSpot, some calls fail with USER_DOES_NOT_HAVE_PERMISSIONS. Rotate the token (Rotate next to it) and paste the new one, or move to a service key.

    Use a developer-platform app’s static auth token

    Your team has already built a HubSpot app on the new developer platform with the HubSpot CLI, configured with static auth and private distribution. Building one needs the CLI; if you don’t have one, use a service key.

    Who can do this: Super admin, or a user with a developer seat, to view the token; Super admin or the HubSpot Marketplace access permission to install the app

    1. Open the project

      In HubSpot click Development, then Projects in the sidebar, then the name of the project that holds your app.

    2. Open the app

      On the project’s Overview tab, under Project Components, click the app’s name.

    3. Open the Distribution tab

      Click the Distribution tab.

    4. Install the app if it isn’t yet

      Under Manage distribution your current HubSpot account is listed. Click Install now, check that the access requested matches the read scopes you configured, then click Connect app.

      A static-token app can be installed in only one standard HubSpot account at a time.

    5. Show and copy the token

      Once installed, the Distribution tab shows an access token. Click Show to reveal it, copy it, and paste it into App Access Token as in main step 14.

      If you change the app’s scopes later, reinstall it with the Reinstall URL on the Distribution tab, or the new scopes won’t apply.

    Permissions to grant

    Resource访问Used for
    crm.objects.联系人.读取读Required. hubspot.contacts, plus the activity tables hubspot.calls, hubspot.emails, hubspot.meetings, hubspot.notes, hubspot.tasks and hubspot.communications (HubSpot’s activity APIs use this scope), and contact fields in hubspot.properties and hubspot.associations.
    crm.objects.companies.read读Required. hubspot.companies, and company fields in hubspot.properties and hubspot.associations.
    crm.对象.交易.读取读Required. hubspot.deals, the deal pipelines in hubspot.pipelines and hubspot.pipeline_stages, and deal fields in hubspot.properties and hubspot.associations.
    crm.对象.所有者.读取读Required. hubspot.owners, the HubSpot users who own records, so deals and contacts can be joined to a rep’s name.
    crm.objects.tickets.read读Only if you sync Tickets: hubspot.tickets and the ticket pipelines in hubspot.pipelines and hubspot.pipeline_stages. Older apps may show the legacy tickets scope instead, which also allows changes.
    crm.objects.products.read读Only if you sync Products: hubspot.products. Search the picker for products; HubSpot’s products API accepts this scope, although HubSpot’s scope reference page does not list it yet.
    crm.objects.line_items.read读Only if you sync Line Items, Taxes, Discounts or Fees: hubspot.line_items, hubspot.taxes, hubspot.discounts, hubspot.fees.
    crm.objects.quotes.read读Only if you sync Quotes: hubspot.quotes.
    crm.objects.invoices.read读Only if you sync Invoices: hubspot.invoices.
    crm.objects.subscriptions.read读Only if you sync Subscriptions: hubspot.subscriptions (HubSpot commerce subscriptions).
    crm.objects.commercepayments.read读Only if you sync Payments: hubspot.payments (HubSpot commerce payments).
    crm.objects.marketing_events.read读Only if you sync Marketing Events: hubspot.marketing_events.
    formsRead and write (HubSpot has no read-only forms scope)Only if you sync Forms or Form Submissions: hubspot.forms and hubspot.form_submissions. Query Streams only reads them.
    crm.objects.feedback_submissions.read读Only if you sync Feedback: hubspot.feedback_submissions. Service Hub Professional or Enterprise only. HubSpot’s scope reference spells it crm.objects.feedback_submission.read, so search the picker for feedback.
    crm.lists.read读Only if you sync Lists: hubspot.lists.
    自动化Read and write (HubSpot has no read-only workflows scope)Only if you sync Workflows: hubspot.workflows. Professional or Enterprise accounts only. Query Streams only reads workflow definitions.
    crm.schemas.custom.read读Only if you sync Custom Schemas: hubspot.schemas (custom object definitions). Enterprise accounts only.

    Paste into Query Streams

    应用程序访问令牌
    The service key you copied in step 13 (it starts with pat-), or a legacy private app token, or a developer-platform app’s static auth token

    Common problems

    Test connection fails with Invalid or expired access token, straight after you pasted a new key.

    Why: The value is not an app or service key. The usual mix-up is the Personal Access Key or Developer API Key, which sit next to Service Keys under Development → Keys and are for HubSpot’s developer tools.

    Fix: Go to Development → Keys → Service Keys, open your key, click Show, then Copy, and paste that into App Access Token. Test connection again; it reads Connected.

    The wizard says Not a valid HubSpot app token before it even tests.

    Why: Only part of the key was pasted: the text doesn’t start with pat- and is very short or contains a space.

    Fix: Back in HubSpot click Show, then use the Copy link (don’t select the text by hand) and paste again.

    You can’t see Development in HubSpot’s left navigation, or Service Keys is missing under Keys.

    Why: Your HubSpot user is not a Super admin and doesn’t have the Developer tools access permission.

    Fix: Ask a Super admin in your company to create the key (steps 2 to 13) and paste it into the wizard, or to grant you Developer tools access.

    Test connection reads Connected, but one table fails to sync with a Forbidden error or stays empty.

    Why: The key is missing the read scope for that table, or your HubSpot plan doesn’t include that feature (Workflows needs Professional or Enterprise; Custom Schemas needs Enterprise; Feedback needs Service Hub Professional or Enterprise).

    Fix: Open the key (Development → Keys → Service Keys → key name), click Edit, add the scope from the Permissions list and save, then sync again. If your plan doesn’t include the feature, switch that table off in the connection’s Sync settings.

    Syncs that used to work start failing with Invalid or expired access token.

    Why: Someone rotated or deleted the key. Rotate and expire now stops the old key at once; Rotate and expire later stops it after 7 days.

    Fix: Copy the current key from Development → Keys → Service Keys → key name → Show → Copy. In Data Agents, edit the HubSpot connection, paste it into App Access Token and run Test connection.

    With a legacy private app token, some tables fail with USER_DOES_NOT_HAVE_PERMISSIONS.

    Why: The HubSpot user who created the private app was removed from the account.

    Fix: Rotate the app’s token (Development → Legacy Apps → app → Rotate) and paste the new token into the connection, or create a service key instead.

    You can’t find Create legacy app, or HubSpot’s docs call private apps legacy.

    Why: HubSpot is retiring creation of new legacy private apps (already off for accounts created on or after 28 September 2026; off for older accounts from 26 October 2026). Existing private apps keep working.

    Fix: Create a service key (main steps). Existing private app tokens can stay in place.

    Data in Query Streams doesn’t match what you see in HubSpot.

    Why: The key was created in a different HubSpot account (for example a test or sandbox account).

    Fix: Switch to the right HubSpot account, create a key there, and paste it into the connection.

    Limits to know

    • HubSpot’s limits for service keys and private apps: 100 requests per 10 seconds per key on Free and Starter, 190 on Professional and Enterprise, 250 with the API Limit Increase add-on. The Agent paces itself to the lowest of these, so the first full sync of a large CRM can take a while.
    • Daily limit per HubSpot account: 250,000 requests on Free and Starter, 625,000 on Professional, 1,000,000 on Enterprise. It is shared by every private app and service key in the account, so other integrations use the same budget.
    • HubSpot’s CRM search, which the Agent uses to fetch only changed records, allows 5 requests per second per account and at most 10,000 results per query.
    • Some tables depend on your HubSpot plan: Workflows (Professional or Enterprise), Custom Schemas (Enterprise), Feedback (Service Hub Professional or Enterprise).
    • Service keys are in public beta (since 10 February 2026), so HubSpot may change details. HubSpot recommends rotating keys every six months.
    • New legacy private apps can’t be created in accounts made on or after 28 September 2026, nor in older accounts from 26 October 2026. Existing apps and tokens keep working.

    Steps verified 8 October 2026. Sources: developers.hubspot.com/docs/apps/developer-platform/build…, developers.hubspot.com/changelog/service-keys, developers.hubspot.com/blog/hubspot-service-keys-the-righ…, developers.hubspot.com/changelog/legacy-private-app-creat…, developers.hubspot.com/docs/apps/legacy-apps/private-apps…, developers.hubspot.com/docs/apps/developer-platform/build…, developers.hubspot.com/docs/apps/developer-platform/build…, developers.hubspot.com/docs/apps/developer-platform/build…, developers.hubspot.com/docs/getting-started/developer-ove…, developers.hubspot.com/docs/apps/developer-platform/build…, developers.hubspot.com/docs/developer-tooling/platform/us…, developers.hubspot.com/docs/api-reference/latest/crm/sear…, knowledge.hubspot.com/user-management/hubspot-user-permis…, developers.hubspot.com/docs/api-reference/legacy/crm/obje…, developers.hubspot.com/docs/api-reference/legacy/crm/acti…, developers.hubspot.com/docs/api-reference/legacy/crm/acti…, developers.hubspot.com/docs/api-reference/legacy/crm/obje…, developers.hubspot.com/docs/api-reference/legacy/crm/obje…, developers.hubspot.com/docs/api-reference/legacy/crm/pipe…, developers.hubspot.com/docs/api-reference/legacy/crm/obje…, developers.hubspot.com/docs/api-reference/legacy/automati…, developers.hubspot.com/docs/api-reference/legacy/marketin…, developers.hubspot.com/docs/api-reference/legacy/account/…, docs.n8n.io/integrations/builtin/credentials/hubspot.

    连接名称
    任何你以后会记住的名称,例如销售数据库。
    应用程序访问令牌
    HubSpot 私有应用令牌(以 pat- 开头),可在“设置”、“集成”、“私有应用”、“您的应用”、“身份验证”选项卡下找到。

    点击 测试连接当它读到 已连接, 点击 节省连接会在几秒钟内到达您的代理。

    测试失败? Usually a missing permission, or a credential from the wrong HubSpot account. The walkthrough above lists the common problems and their fixes.

  4. 将查询流添加到 Google 表格

    打开任意一个 Google 表格,然后转到 扩展程序 → 附加组件 → 获取附加组件搜索 查询流然后点击 安装或者直接从这里安装 Google Workspace Marketplace 上的查询流谷歌会要求你允许安装该插件;这是正常现象。

    之后,您打开的每个 Google 表格中都会出现“查询流”图标,位于右侧边栏,也列在“查询流”下方。 扩展无需单独登录。它会识别您已在使用的 Google 帐户,因此该电子邮件地址必须与您的 Query Streams 帐户所用的电子邮件地址一致。

  5. 把你的第一张桌子拉过来

    单击工作表右侧侧面板中的“查询流”图标(或在下方找到它)。 扩展)。 选择 查询流 选择你刚刚建立的连接。

    输入要运行的查询语句。以下查询语句会从数据库中提取几列数据。 HubSpot 优惠 桌子:

    示例 · SQL
    SELECT dealname, dealstage, amount, closedate FROM hubspot.deals ORDER BY closedate DESC LIMIT 100;

    在下面 目的地表 选择行应该落入的选项卡,然后单击 运行查询数据行会在一两秒内显示在该标签页中。如果数据发生更改,请随时再次单击“运行查询”,标签页将自动更新。

    不懂SQL? 请改在 Query Streams 门户中构建查询。 查询生成器 它会显示您的表格和列,方便您进行点击操作。在商业版套餐中,您还可以用简单的英语向 Nova 提问(例如“显示美国的客户”),它会自动为您生成 SQL 查询语句。保存查询后,您只需在门户网站或从个人版到更高版本的插件的“已保存查询”列表中点击一下即可访问该查询。

就是这样。 您的数据已保存在表格中,只需单击一下即可保持最新状态。除了您请求的行之外,没有任何数据会离开您的网络。

下一步行动不错。

  • 保存查询 在门户网站中,您可以一键再次运行它,也可以从 Google Sheets 或 Excel 中运行。
  • 添加筛选器 例如日期范围,这样同一个查询就可以回答“本月”而无需编辑。
  • 分享结果 与同事一起操作。他们看到的是行,而不是你的凭证。

人们提出的问题

我必须在运行 Sheets 的电脑上安装 HubSpot 账户吗?

不,只有代理需要与你的 HubSpot 帐户位于同一位置。Google Sheets 可以在任何设备的浏览器中运行。使用同一个 Google 帐户打开插件,你的联系人就会自动连接。

我的数据会被复制到查询流吗?

不。代理程序会运行查询,找到您的数据,然后只发送返回的行。中间不会进行任何同步或存储操作。

免费套餐真的包含这些吗?

是的。“免费”是一个永久有效的方案,而不是会过期的试用期。请查看具体包含内容。 定价页面.

表格会自动刷新吗?

如需获取最新行,请再次单击“运行查询”。要设置工作表自动刷新(无需用户手动操作),请在“查询流”门户(“流”→“自动化”)中设置自动化。此功能在所有套餐中均有提供。

还是不行? 打开 支持 请在“查询流”中告诉我们您当前处于第几步以及您看到的内容。我们会帮您连接。
查询流也将相同的数据连接到在 ExcelClaude、Cursor 和 ChatGPTREST API以及更多
更新 10 月 8, 2026

Powered by BetterDocs