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:
To pull data from the Hubspot API to Google Sheets easily and without writing any code, first install and open the Apipheny Google Sheets add-on. Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs (including the Hubspot API), save API requests, schedule API requests, and more. Click here if you want to learn more about Apipheny.
1. Install Apipheny by clicking the Install button on this page.
2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons option in the top menu. In the add-ons menu, you should see Apipheny.
Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets.
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 obtain an API Endpoint URL 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: https://developers.hubspot.com/docs/v2/overview
The menu on the left contains a list of the available APIs each with its own endpoints.
Clicking on an API scrolls to that API’s section, containing a list of associated endpoints. For instance, the Contacts List API scrolls to the list of its 12 endpoints: Create a contact list, Get contact lists, all the way to Remove contact from a list:
All API calls to HubSpot should be made to the https://api.hubapi.com root domain:
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>
Its’ documentation contains a short description, 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=<your API key>
<your API key> is where you enter the API key that we got in step 3. Do not include the carrots “<>”.
Headers are not required for this request.
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, such as: