Skip to main content

The Analytics API allows you to export analytics and reporting data from HubSpot. It’s primarily used to connect metrics tracked in HubSpot to those stored in other business intelligence tools.

Use case for this API: You're using HubSpot’s blogging and landing page tools, but not the CRM. You want to see the traffic and leads tracked in HubSpot next to the sales activity and deal progression from your CRM to get a fuller sense of your business performance. You use the Analytics API to integrate HubSpot's reporting data with your CRM.

The Analytics API is designed around the functionality of HubSpot's various reporting tools. The data returned by these APIs will mimic the data you would see in those tools. For example, when pulling sources data, the results would be similar to what you would see in the sources report.

For more details about how the sources report works, please see the article linked here. For more details about the page performance report, please see the article linked here.

Many endpoints allow you to drill down into the results using the d1 and d2 parameters. The available drill down options are going to depend on the data being requested. For example, when pulling sources data, the first level drill down options (using the d1 parameter) would be the different source types you'd see in the in the sources report (such as organic, direct, or offline). When drilling down into organic search (d1=organic), the second level drilldown (the d2 parameter) would be a specific keyword, allowing you to get the details for which search engine led to traffic for that specific keyword. When looking for which values you can use for drilling down, it's a good idea to start with the total summary (using total for the :time_period) and looking at the breakdowns in that summary data.

Access to data from the Analytics API will depend on the connected HubSpot account's permissions. For example, to pull analytics data for landing pages, the account would need access to create landing pages. To get analytics data broken down by category, the account would need access to the data in the sources report.

If the account does not have access to the requested data, you will receive a 403 error response. For the full breakdown of the required plan for each feature, see the table below.

Analytics API featureRequired plan
Get analytics data breakdowns
  • totals
Marketing Hub Professional, or Enterprise, or HubSpot CMS
  • sessions
Marketing Hub Professional, or Enterprise, or HubSpot CMS
  • sources
Marketing Hub Starter, Professional, or Enterprise, or HubSpot CMS

Note: Starter plans will not be able to use the &d1= or &d2= drilldown parameters.
  • geolocation
Marketing Hub Starter, Professional, or Enterprise, or HubSpot CMS

Note: Starter plans will not be able to use the &d1= or &d2= drilldown parameters.
  • utm-:utm_type
Marketing Hub Professional, or Enterprise, or HubSpot CMS
Get analytics data for specific objects
  • event-completions
Marketing Hub Enterprise
  • forms
HubSpot Free CRM
  • pages
Marketing Hub Professional or Enterprise
  • social-assists
Marketing Hub Professional or Enterprise
Get data for HubSpot hosted content
  • landing-pages
Marketing Hub Professional or Enterprise, or HubSpot CMS
  • standard-pages
Marketing Hub Professional or Enterprise, or HubSpot CMS
  • blog-posts
Marketing Hub Professional or Enterprise, or HubSpot CMS
  • listing-pages
Marketing Hub Professional or Enterprise, or HubSpot CMS
  • knowledge-articles
Marketing Hub Professional or Enterprise, or HubSpot CMS
Get all analytics viewsMarketing Hub Professional or Enterprise

The Analytics API limits how much data can be returned in a request. If you exceed those limits, you'll receive one of the following errors:

  • 403 response code - The account does not have access to feature required to access this data. See the table above for a full breakdown of the plans required for each feature.
  • 413 response code with RESULT_POINT_LIMIT_EXCEEDED - Returned when there are too many time data points. When using a :time_period of daily, weekly, or monthly, the results are limited to 500 time points. Try narrowing the time range between the start and end dates, or using a wider time period (monthly instead of weekly for example).
  • 501 response code with RESULT_LIMIT_EXCEEDED - Returned when there are too many breakdowns in the response. When using a total or summarize option for the :time_period, there is a limit of 2 million breakdowns for the response. Try using filters, or removing filters if you're including a large number of filters, or narrowing the time range between the start and end dates.
  • 501 response code with SCAN_TIME_EXCEEDED - Returned when the processing time out is hit. Try narrowing the amount of data you're requesting by using filters or narrowing the range between the start and end dates.

Below you can see examples of responses you'd receive from the Analytics API. The actual stats that you may get are heavily dependent on the data requested. (See the Knowledge Base articles linked above for data descriptions.)

Example data when pulling total stats or stats broken down by specific criteria:

Example data when pulling data for a specific time period (in this case, daily):