By Rudderstack Team

How to load data from Hubspot to Google BigQuery

This post helps you with loading your data from HubSpot to BigQuery. If you are looking to get analytics-ready data without the manual hassle you can integrate HubSpot to BigQuery with RudderStack, so you can focus on what matters, getting value out of your customers’ data.

Extract your data from HubSpot

The Hubspot APIs are following the REST architecture, which can be accessed through HTTP. As a RESTful API, interacting with it can be achieved by using tools like CURL or Postman or by using HTTP clients for your favorite language or framework.

A few suggestions:

Responses of the API are all in JSON, including errors although HTTP codes are also returned to indicate errors. Hubspot maintains some official SDKs for their APIs, like the hapipy client for python, also unofficial clients can be found.

Hubspot API Authentication

Hubspot API allows two types of authentication. OAuth and API keys. Hubspot encourages the use of oAuth for any serious integration and suggests using basic authentication with API keys only for testing and rapid prototyping purposes.

Hubspot API rate limiting

HubSpot public endpoints are powered by the same underlying technology that powers the core HubSpot application. As a result, HubSpot engineering closely monitors usage of the public APIs to ensure a quality experience for users of a HubSpot application.

Below, you’ll find the limits by which a single integration (as identified by an access token) can consume HubSpot public APIs.

  1. Integrations cannot consume the HubSpot API at a rate greater than 10 requests/second.
  2. Polling of HubSpot APIs should occur at intervals of 5 minutes or more.
  3. Total requests to the HubSpot APIs should not exceed 10,000 in a 24 hour period.
  4. Failed requests to the HubSpot APIs may not exceed 5% of total syncs.
  5. All data passed to HubSpot must be properly encoded, and use application/json formatting.
  6. Integrations should use HubSpot’s OAuth protocol.
  7. Integrators must store time-to-live (TTL) data for OAuth access tokens as well as refresh tokens. Unauthorized (401) requests are not a valid indicator that a new access token must be retrieved.
  8. Integrators should use their own public and documented APIs when working with HubSpot APIs.
  9. We reserve the right to change or deprecate the APIs over time – we will provide developers ample notification in those cases.

Endpoints and available Resources

Hubspot API is actually a collection of a large number of APIs. Something that makes sense if we consider that Hubspot is actually more than one product and each one of these products is quite complex on its own. The APIs are the following:

  • Calendar API. Anything that has to do with calendars in Hubspot and their possible operations.
  • Companies APIs. When we talk about business and customers we talk about companies, so here is your API for interacting with companies.
  • Companies properties APIs. Companies are important for Hubspot and there’s a lot of functionality around them so there’s an auxiliary API just for working with properties of companies.
  • Contacts APIs. Contacts are the fundamental building block to HubSpot – they store lead-specific data that makes it possible to leverage much of the functionality in HubSpot, from marketing automation, to lead scoring to smart content.
  • Contact Lists APIs. API for managing the lists of your contacts.
  • Contact properties APIs. Similar to companies, this API allows you to interact with the properties of your contacts.
  • COS Blog API. Interact with Blogs throughs the Hubspot platform.
  • COS Blog Authors API. API for interacting with the authors of your blogs.
  • COS Blog Comments API. Exposes functionality about the comments of your APIs.
  • COS Blog Posts API. Anything related to the posts of your Blog.
  • COS Blog Topics API. Manage the topics of your Blog.
  • COS Domains API. Manage your Domains through this API.
  • COS Files API. Operations concerning file management inside Hubspot.
  • COS Layouts API. Manage the layouts of your pages through this API.
  • COS Page Publishing API. Operations linked with publishing content through Hubspot’s platform.
  • COS Sitemaps API. Operations related to the management of sitemaps for the sites you create through the Hubspot platform.
  • COS Templates API. API for managing the templates of your sites.
  • COS URL Mappings API. Operations for URL mappings for the sites inside Hubspot.
  • Deals API. Anything that has to do with deals inside your CRM.
  • Deal Pipelines API. Manage the sales pipelines through this API.
  • Deals Properties API. Again, manage the properties of your deals.
  • Email API. Anything about emailing from within the HubSpot platform.
  • Email Events API. Track and interact with events that happen inside emails.
  • Engagements API. Anything related to customer engagement inside the HubSpot platform.
  • Events API. Event handling for Hubspot.
  • Forms API. Manage custom forms that you create inside the platform.
  • Keywords API. Operations about keywords for SEO.
  • Owners API. Anything related to the Owner.
  • Social Media API. API for interacting with Social media through Hubspot’s platform.
  • Transactional Email API. The transactional email functionality of Hubspot.
  • Workflows API. Define and manage sales and marketing workflows.

From all the above endpoints we can pull data out of the platform, so it is easy to understand the richness of the data we can get from a platform like Hubspot. Let’s assume, as an example, that we want to get all the Deals data. By executing a GET request like this GET /deals/v1/deal/recent/modified we can get all the recently modified deals. The parameters that we can pass to the call are the following:

  • count: for specifying the number of results per page of the response.
  • offset: for paginating through all available results.
  • since: a timestamp for defining from which exact time you would like to fetch data from.

As we said earlier, results from a Hubspot API are always in JSON, so if we successfully execute the above query we’ll get the following results back: