Search API Connector Documentation


Import HubSpot Data to Google Sheets

In this guide, we’ll walk through how to pull data from the HubSpot API directly into Google Sheets, using the API Connector add-on for Sheets.

There are 2 ways to connect to the HubSpot API:

  • Preset “Connect” button (OAuth) premium
  • Personal API key. Please check the appendix for detailed instructions to retrieve your token.


Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Connect to the HubSpot API

We’ll first initiate the connection to the HubSpot API.

  1. Open up Google Sheets and click Add-ons > API Connector > Manage Connections.
  2. In the list of available connections, find HubSpot Contacts and click Connect.
  3. You’ll be asked to select an account and authorize the connection. Click “Connect app”.
  4. Back on the connections screen, you can verify that the account is now connected.

Part 2: Create Your API Request URL

For this request we’ll access data about your contacts.

  • API root:
  • Endpoint: /crm/v3/objects/contacts
  • Query strings: ?limit=100

Putting it together, we get the full API Request URL:

Part 3: Pull HubSpot Data into Google Sheets

Now let’s copy and paste that URL into API Connector.

  1. Open up Google Sheets and click Add-ons > API Connector > Open.
  2. In the Create tab, enter the API URL we just created.
  3. Under OAuth, choose HubSpot.
  4. We don’t need any headers so just leave that section blank.
  5. Create a new tab and click ‘Set current’ to use that tab as your data destination.
  6. Name your request and click Run. A moment later you’ll see information about your CRM contacts in your sheet.

Part 4: More Example API URLs

You can experiment with endpoints and query strings as described in the documentation to see other types of HubSpot data, but if you just want to jump in and get a feel for it, try the following example URLs. HubSpot’s API is is split into separate APIs for CRM, Analytics, etc, so this is just a sampling of the different types of endpoints you can find.

HubSpot’s API is in the midst of a migration to v3 of their API. Not all endpoints have been moved over, so you may need to toggle between their new API docs and their legacy docs. In addition, not all endpoints are available on all plans.
  • Analytics API: high level metrics for May 2021
  • Analytics API: metrics broken down by source
  • CRM API: Companies
  • CRM API: Deals
  • Marketing API: Emails

Part 5: Handle Pagination

HubSpot limits the number of records returned in each request. By default, only 10 records will be returned unless you paginate through records as described in their documentation. This is why we set the limit=100 parameter in our example queries above.

To get more than 100 records, you need to use the cursor value returned in the property as shown above.

With API Connector you can either run those request URLs manually or loop through them automatically with pagination handling (paid feature), like this:

  • API URLenter your request URL as usual, including the limit=100 parameter
  • Pagination typecursor
  • Next token parameterafter
  • Next token
  • Number of pagesenter the number of pages you’d like to fetch

Appendix: Connect with a HubSpot API Key

This section is provided as an alternative to the method described above. Instead of clicking HubSpot in the Connections manager, you will retrieve your own API key.
  1. If you haven’t already, log into your HubSpot account. Click on the settings icon in the header bar.
  2. This will open the settings menu in the sidebar. Click Account Setup > Integrations > API Key.
  3. Click Create key to generate an API key.
  4. You’ll now see your API access key. Congrats 🙂 Copy it and keep it safe, we’ll need it in a moment.
  5. To make requests, append this value to the end of your URL like this: &hapikey=YOUR_API_KEY (since you’re using an API key, leave OAuth set to None). For example:
Previous Import Harvest Data to Google Sheets
Next Import Hunter Data to Google Sheets

2 thoughts on “Import HubSpot Data to Google Sheets”

  1. This pagination method doesn’t work when fetching companies. I’m using with the cursor / after / settings for pagination, but I can’t get more than 100. Any ideas?

    • Your URL is for HubSpot’s v2 API, while the instructions above are for v3. They’ve made significant changes between the 2 versions so the v3 pagination method doesn’t work for v2 (and vice versa).
      If you use v2, you’d enter your URL like
      Then, under pagination, you’d enter pagination = offset-limit, offset parameter = offset, limit parameter = limit.

      If you use v3, your URL would instead look like, and you should be able to use the pagination method as shown in the article. Let me know if that works for you!


Leave a Comment

Table of Contents