> ## Documentation Index
> Fetch the complete documentation index at: https://developers.hubspot.jp/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Search your site

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

export const ScopesList = ({scopes = [], description = "この API には、次のいずれかのスコープが必要です。"}) => {
  if (!scopes || scopes.length === 0) {
    return null;
  }
  const sortedScopes = scopes.sort((a, b) => a.localeCompare(b));
  return <div>
      <div className="text-sm mb-2">{description}</div>
      <div>
        {sortedScopes.map((scope, index) => <div key={index}>
            <code>
              <span className="text-xs">{scope}</span>
            </code>
          </div>)}
      </div>
    </div>;
};

<Accordion title="Scope requirements">
  <ScopesList scopes={['content']} />
</Accordion>


## OpenAPI

````yaml specs/legacy/v2/site-search-v2.json GET /contentsearch/v2/search
openapi: 3.0.1
info:
  title: Site Search API
  description: >-
    Use the site search API to return HubSpot-hosted content based on search
    terms. Content can be searched across multiple domains. You can also
    retrieve all indexed data for a specific website page, blog post, or
    knowledge base article using its ID.
  version: v2
servers:
  - url: https://api.hubapi.com
security: []
tags:
  - name: Site Search
paths:
  /contentsearch/v2/search:
    get:
      tags:
        - Site Search
      summary: Search your site
      description: >-
        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.
      operationId: searchContent
      parameters:
        - name: portalId
          in: query
          required: true
          description: The ID of the portal the contact search should be performed against.
          schema:
            type: string
        - name: term
          in: query
          required: true
          description: The term to be used in the content search.
          schema:
            type: string
        - name: type
          in: query
          description: >-
            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.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - SITE_PAGE
                - LANDING_PAGE
                - BLOG_POST
                - LISTING_PAGE
                - KNOWLEDGE_ARTICLE
        - name: domain
          in: query
          description: >-
            Specifies the domain(s) to be searched. Can be one or more of the
            portal's connected domains. Defaults to all domains.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: language
          in: query
          description: >-
            Specifies the language of content to be searched. This parameter
            should obey the ISO639-1 format (e.g. es for Spanish).
          schema:
            type: string
        - name: property
          in: query
          description: >-
            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.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - title
                - description
                - html
                - author_full_name
                - author_handle
                - tag
        - name: groupId
          in: query
          description: >-
            Specifies which blog(s) to be searched by blog ID. Can be used
            multiple times to search more than one blog.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: tableId
          in: query
          description: >-
            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.
          schema:
            type: string
        - name: hubdbQuery
          in: query
          description: >-
            Specify a HubDB query to further filter the search results. Used in
            tandem with the tableId parameter above.
          schema:
            type: string
        - name: pathPrefix
          in: query
          description: >-
            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.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              maxLength: 30
        - name: matchPrefix
          in: query
          description: >-
            Inverts the behavior of the pathPrefix filter when set to 'false'.
            (Defaults to true)
          schema:
            type: boolean
            default: true
        - name: length
          in: query
          description: >-
            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.
          schema:
            type: string
            enum:
              - LONG
              - SHORT
        - name: analytics
          in: query
          description: >-
            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.
          schema:
            type: boolean
            default: false
        - name: autocomplete
          in: query
          description: >-
            Specifies whether or not you are showing autocomplete results.
            Defaults to false. If you're not showing autocomplete results, this
            parameter should be excluded.
          schema:
            type: boolean
            default: false
        - name: popularityBoost
          in: query
          description: >-
            Specifies how strongly a result is boosted based on its view count.
            Defaults to 1.0.
          schema:
            type: number
            default: 1
        - name: maxBoost
          in: query
          description: >-
            Specifies the maximum amount a result will be boosted based on its
            view count. Defaults to 5.0.
          schema:
            type: number
            default: 5
        - name: boostRecent
          in: query
          description: >-
            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).
          schema:
            type: string
        - name: offset
          in: query
          description: >-
            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.
          schema:
            type: integer
            default: 0
        - name: limit
          in: query
          description: >-
            Specifies the number of results to be returned in a single response.
            Defaults to 10, maximum limit is 100.
          schema:
            type: integer
            default: 10
            maximum: 100
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                    description: Total number of results
                  offset:
                    type: integer
                    description: Offset used in query
                  limit:
                    type: integer
                    description: Limit used in query
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: Content ID
                        score:
                          type: number
                          description: Search relevance score
                        type:
                          type: string
                          description: Content type
                        domain:
                          type: string
                          description: Domain where content is hosted
                        url:
                          type: string
                          description: URL of the content
                        language:
                          type: string
                          description: Content language
                        title:
                          type: string
                          description: Content title
                        description:
                          type: string
                          description: Content description
                        authorFullName:
                          type: string
                          description: Author full name
                        tags:
                          type: array
                          items:
                            type: string
                          description: Content tags
                  cacheKey:
                    type: string
                    description: Cache key for the search results
                  page:
                    type: integer
                    description: Current page number
              examples:
                basic_search:
                  summary: Basic search results
                  value:
                    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

````