HubSpot offers a broad range of marketing, sales, and customer service software that works together with their core CRM product. Their various packages and platforms feature a significant degree of interoperability, creating a powerful business-focused ecosystem.
In this tutorial, you’ll learn how to connect the Hubspot REST API to Google Sheets in 5 steps using the Apipheny add-on:
Apipheny is an API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more. There is a 30 day free trial included.
1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install
2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.
In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.
Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new
1. In your HubSpot account, click the Settings icon in the main navigation bar:
2. In the left sidebar menu, navigate to Integrations > API key:
3. If a key has never been generated for your account, click the Create key button:
Copy the key somewhere safe because you will need it in the next steps.
If you’ve already generated an API key, you can click Show to display your key:
In this section, we’ll show you how to browse the Hubspot API documentation to find an endpoint that retrieves the specific information you need from your Hubspot account.
If you already know your URL, or you want to use the same example URL as us, just skip to Step 4.
First, open the Hubspot API documentation page:
The menu on the left, starting with CRM API, contains a list of the available APIs each with its own endpoints.
Clicking on an API takes you to that API’s section, containing a list of associated endpoints.
All API calls to HubSpot should be made to the https://api.hubapi.com root domain:
https://api.hubapi.com
One of the available endpoints, the one we’re using in this example, is Get contact lists:
https://api.hubapi.com/contacts/v1/lists?count=number_of_contacts&hapikey=API_Key
Each endpoint’s documentation contains the HTTP method used (GET) and the link you should append to the root domain for querying this endpoint (/contacts/v1/lists):
For endpoints that accept parameters, this documentation is where you would find them listed and explained, along with example inputs and responses.
Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the Import tab. With the Import tab open, enter these details into the add-on:
Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method.
API URL: In Step 3, we explained how you can find the Hubspot REST API endpoint that you need. Now copy the complete URL (root domain + endpoint) into the Apipheny add-on, where it says API URL Path, followed by any GET parameters required for your query.
For this example, we are using the Get all contacts API endpoint, to get all contacts:
https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=API_key
API_key is where you enter the API key that we got in step 3.
Headers are not required for this request, so you can leave that section blank in Apipheny.
Here’s what our API request looked like:
Click the Run button at the bottom of the Apipheny add-on and then wait for the Hubspot API data to be added to your Google Sheet:
After making a successful request to the Hubspot API, try querying a different endpoint, or try using one of the more advanced features in the Apipheny add-on.
Make a GET request
Make a POST request
PUT, PATCH, & DELETE Requests
Save requests for later
Schedule requests for automatic updates
Reference cell values in requests
=APIPHENY custom function
Stack multiple URLs in a single request
Run all saved requests at once
Modify your request settings
Import & export saved API settings
Ahrefs API
Airtable API
Alpha Vantage API
Asana API
Binance API
Clickup API
Coingecko API
Coinmarketcap API
Coinbase API
Constant Contact API
Discord API
Drift API
Etsy API
Eventbrite API
Facebook Graph API
Facebook Ads API
Figma API
Github API
Google SERP API
Hubspot API
Hunter API
What is an API?
What is an API URL?
What are parameters?
What is an endpoint?
What is an API key/token?
What is basic authentication?
What are headers?
What is a GET request?
What is a POST request?