GET
/
contentsearch
/
v2
/
search
Search your site
curl --request GET \
  --url https://api.hubapi.com/contentsearch/v2/search
{
  "total": 10912,
  "offset": 0,
  "limit": 10,
  "results": [
    {
      "id": 24314356,
      "score": 2.536124,
      "type": "BLOG_POST",
      "domain": "blog.hubspot.com",
      "url": "https://blog.hubspot.com/blog/tabid/6307/bid/11692/Inbound-Marketing-Vs-Outbound-Marketing.aspx",
      "featuredImageUrl": "https://cdn2.hubspot.net/hubfs/53/assets/hubspot.com/buzz/HubSpotOpenGraph.png",
      "language": "en-us",
      "title": "Inbound <span class=\"hs-search-highlight hs-highlight-title\">Marketing</span> Vs. Outbound <span class=\"hs-search-highlight hs-highlight-title\">Marketing</span>",
      "description": "This blog post is one of several <span class=\"hs-search-highlight hs-highlight-html\">Marketing</span> Transformation Success Stories we'll be featuring in celebration of  <span class=\"hs-search-highlight hs-highlight-html\">Marketing</span> Transformation Week , April 4-8, 2011....",
      "authorFullName": "Kipp Bodnar",
      "tags": [
        "Inbound Marketing"
      ],
      "publishedDate": 1302130260000
    }
  ],
  "searchTerm": "marketing",
  "page": 0
}

Required Scopes

This API requires one of the following scopes:
  • content

Query Parameters

portalId
string
required

The ID of the portal the contact search should be performed against.

term
string
required

The term to be used in the content search.

type
enum<string>[]

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.

domain
string[]

Specifies the domain(s) to be searched. Can be one or more of the portal's connected domains. Defaults to all domains.

language
string

Specifies the language of content to be searched. This parameter should obey the ISO639-1 format (e.g. es for Spanish).

property
enum<string>[]

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.

groupId
string[]

Specifies which blog(s) to be searched by blog ID. Can be used multiple times to search more than one blog.

tableId
string

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.

hubdbQuery
string

Specify a HubDB query to further filter the search results. Used in tandem with the tableId parameter above.

pathPrefix
string[]

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.

matchPrefix
boolean
default:true

Inverts the behavior of the pathPrefix filter when set to 'false'. (Defaults to true)

length
enum<string>

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.

Available options:
LONG,
SHORT
analytics
boolean
default:false

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
boolean
default:false

Specifies whether or not you are showing autocomplete results. Defaults to false. If you're not showing autocomplete results, this parameter should be excluded.

popularityBoost
number
default:1

Specifies how strongly a result is boosted based on its view count. Defaults to 1.0.

maxBoost
number
default:5

Specifies the maximum amount a result will be boosted based on its view count. Defaults to 5.0.

boostRecent
string

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).

offset
integer
default:0

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
integer
default:10

Specifies the number of results to be returned in a single response. Defaults to 10, maximum limit is 100.

Required range: x <= 100

Response

200 - application/json

successful operation

The response is of type object.