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

# Notion

> Query Notion pages and databases

export const IndexedSearch = () => <Tooltip tip="Indexed search uses advanced semantic, hybrid, and graph search methods to find the most relevant results. It's very fast and accurate, but requires upfront indexing of data.">
        <span className="text-sky-600">
            <Icon icon="database" size={14} color="#0084d1" iconType="solid" /> Indexed  Search
        </span>
    </Tooltip>;

export const LiveSearch = () => <Tooltip tip="Live search uses AI to search your integrations native APIs in real-time. This is slower than indexed search and often not as accurate, but does not store any data on Hyperspell's servers and is always up to date.">
        <span className="text-emerald-600">
            <Icon icon="bolt" size={14} color="#009966" iconType="solid" /> Live Search</span>
    </Tooltip>;

export const ConnectView = ({integration, image}) => {
  return <Frame caption={`Hyperspell Connect lets your users easily connect their ${integration} account.`}><svg width="565" height="264" viewBox="0 0 565 264" fill="none" xmlns="http://www.w3.org/2000/svg">
        <rect width="565" height="264" fill="#F5F5F5" />
        <rect width="565" height="264" fill="#FBFBFC" />
        <text fill="#23272E" font-family="Finlandica" font-size="20" letter-spacing="0em"><tspan x="33" y="49">This app uses Hyperspell to securely connect to your data.</tspan></text>
        <rect x="34.5" y="103.5" width="497" height="56" rx="7.5" fill="white" stroke="#E5E7EB" />
        <rect x="34.5" y="178.5" width="497" height="56" rx="7.5" stroke="#E5E7EB" />
        <text fill="#23272E" font-family="Finlandica" font-size="16" letter-spacing="0em"><tspan x="34" y="82.1">Please connect the following accounts to continue:</tspan></text>
        <text fill="#23272E" font-family="Finlandica" font-size="16" letter-spacing="0em"><tspan x="90" y="137.1">{integration}</tspan></text>
        <text fill="#23272E" font-family="Finlandica" font-size="16" letter-spacing="0em"><tspan x="90" y="212.1">Return to app</tspan></text>
        <path d="M503 133H513" stroke="#697282" stroke-width="1.5" stroke-linecap="round" />
        <path d="M508.5 128.5L513 133L508.5 137.5" stroke="#697282" stroke-width="1.5" stroke-linecap="round" />
        <svg x="48" y="117" width="32" height="32">
            <image href={image} width="32" height="32" />
        </svg>
        <path d="M60 207.5L73 207.5C74.1046 207.5 75 206.605 75 205.5L75 203" stroke="#697282" stroke-width="1.5" stroke-linecap="round" />
        <path d="M64.5 212L60 207.5L64.5 203" stroke="#697282" stroke-width="1.5" stroke-linecap="round" />
    </svg></Frame>;
};

# Overview

The Notion integration allows you to query and index Notion pages and databases. It supports both <LiveSearch /> and <IndexedSearch />.

## Authentication

The Notion integration requires an OAuth connection, and is availble in [Hyperspell Connect](/usage/connect) without any additional setup:

<ConnectView integration="Notion" image="https://app.nango.dev/images/template-logos/notion.svg" />

Note that during the OAuth flow, users will be asked to select which pages in their Notion workspace they would like to give access to.

## Search Options

The Notion integration does not support any custom search options.

## Resources

The Notion integration returns `Document` resources:

<Expandable title="Document Schema">
  <ResponseField name="resource_id" type="string" required>
    The unique identifier of the page or database
  </ResponseField>

  <ResponseField name="source" type="string" required>
    The provider that fetched the document, which is `notion` if this integration is used to query or index it.
  </ResponseField>

  <ResponseField name="title" type="string">
    The title of the page
  </ResponseField>

  <ResponseField name="summary" type="text" required={false}>
    A summary of the document that can be fed directly into LLMs. When retrieved from the `/query` endpoint, this may summarize only the sections of the document returned as highlights (ie. parts relevant to your query). Otherwise, it will summarize the entire document.
  </ResponseField>

  <ResponseField name="data" type="elements[]" required={false}>
    A structured representation of the page's content. This field is only returned if the resource is returned from the `/documents/get` endpoint. If the website is returned from the `/query` endpoint, this field will be empty and the `highlights` field will contain the relevant sections of the website.
  </ResponseField>

  <ResponseField name="highlights" type="highlight[]" required={false}>
    A list of highlights from the page relevant to the query. This field is only returned if the resource is returned from the `/query` endpoint.
  </ResponseField>
</Expandable>
