There's a new version of the HubSpot API

As of November 30, 2022, HubSpot API keys are no longer a supported authentication method for accessing HubSpot APIs. Instead, you should use a private app access token or OAuth to authenticate API calls. Learn more about this change and how to migrate an API key integration to use a private app instead.

Search your site

Last updated June 14, 2022

GET /contentsearch/v2/search

Method Details

HTTP Methods:

GET

Response Format:

json

Requires Authentication?

No

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing

Required Scope:

content

For a given portal, return any content related to a search term from your HubSpot hosted site. Searches can return data from the specified content types, domains, or URL paths.

Note: This endpoint is used to search for content accross multiple domains. For information on the site search modules or searching for content on a single subdomain, check out this Knowledge Base article.

Required Parameters How to use Description
Portal ID ?portalId= The ID of the portal the contact search should be performed against.
Search Term &term= The term to be used in the content search.

Optional Filter Parameters How to use Description
Type &type= Specifies the type of content to search. Can be one or more of SITE_PAGE, LANDING_PAGE, BLOG_POST, LISTING_PAGE, and KNOWLEDGE_ARTICLE. Defaults to all content types except LANDING_PAGE and KNOWLEDGE_ARTICLE.

Include the parameter multiple times to search across multiple types, e.g. &type=SITE_PAGE&type=BLOG_POST
Domain &domain= Specifies the domain(s) to be searched. Can be one or more of the portal's connected domains. Defaults to all domains.
Language &language= Specifies the language of content to be searched. This parameter should obey the ISO639-1 format (e.g. es for Spanish).
property &property= Specifies which properties to search for (defaulting to all properties). Options are title, description, and html. For blog posts, additional search properties are author_full_name, author_handle, and tag.
Group ID &groupId= Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog.
Table ID &tableId= Specifies a specific HubDB table to search. Only returns results from the specified table. Can be used in tandem with the hubdbQuery parameter to further filter results.
HubDB Query &hubdbQuery= Specify a HubDB query to further filter the search results. Used in tandem with the tableId parameter above.
Path Prefix &pathPrefix= Specifies a path prefix to filter search results. Will only return results with URL paths that start with the specified parameter. Can be used multiple times. Has a limit of 30 characters. 
Match Prefix &matchPrefix= Inverts the behavior of the pathPrefix filter when set to 'false'. (Defaults to true)
Optional Result Parameters How to use Description
Length &length= Specifies the length of the search results. Can be set to LONG or SHORT. Setting this parameter to SHORT will return a short highlight of the meta description. Setting this parameter to LONG will build the snippet based on the html/content of the page. If you are not using the snippet, setting this parameter to SHORT will give a slight performance improvement.
Analytics &analytics= Specifies whether or not to enable tracking links. Defaults to false. When set to true, the content's URL will be replaced with a tracking link.
Autocomplete &autocomplete= Specifies whether or not you are showing autocomplete results. Defaults to false. If you're not showing autocomplete results, this parameter should be excluded.
Optional Score Parameters How to use Description
Popularity Boost &popularityBoost= Specifies how strongly a result is boosted based on its view count. Defaults to 1.0.
Maximum Boost &maxBoost= Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0.
Recency Boost &boostRecent= Specifies a relative time window where scores of documents published outside this time window decay. This can only be used for blog posts. For example, boostRecent=10d will boost documents published within the last 10 days. Supported timeunits are ms (milliseconds), s (seconds), m (minutes), h (hours), d (days).
Optional Paging Parameters How to use Description
Offset &offset= Used to page through the results. If there are more results than specified by the limit= parameter, you will need to use the offset returned in the first request to get the next set of results.
Limit &limit= Specifies the number of results to be returned in a single response. Defaults to 10, maximum limit is 100.