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

# Search documents and content

> Performs a full-text search across document and explore indices, returning a unified, paginated list of results.

**How pagination works:**
1. Results from the **document index** are returned first
2. Once exhausted, results from the **explore index** follow
3. Use `offset` and `limit` to page through the combined set

Date filters are supported via `date_gte` and `date_lte`.



## OpenAPI

````yaml POST /api/v1/search/
openapi: 3.0.3
info:
  title: Sacra API
  version: 1.0.0
  description: >-
    The Sacra API currently supports querying News, Documents, Companies and
    Categories that enable you to use Sacra research within your own
    application.


    ## **Getting started guide**


    To start using the APIs, you need to:


    - Only available to **Platforms** and **Funds** tier members. (See
    [here](https://sacra.com/pricing/))
        
    - You must use a valid API Key to send requests to the API endpoints. You
    can generate your API key in the Api Keys section of your [Organization
    Settings](https://sacra.com/orgs/settings/general/).
        
    - The API returns request responses in JSON format. When an API request
    returns an error, it is sent in the JSON response as an error key.
        

    ## Authentication


    The Sacra API uses Tokens for authentication.


    You can generate a Sacra API Key/Token in the Api Keys section of your
    [Organization Settings](https://sacra.com/orgs/settings/general/).


    You must include an API Key/Token in each request to the Sacra API with the
    **Authorization** request header.


    ### Authentication error response


    If a Token is missing, malformed, or invalid, you will receive an HTTP 401
    Unauthorized response code.


    ### **Need some help?**


    In case you have questions, we will eventually provide tutorials and a FAQ
    page. But for now you can check out the
    [#developers](https://discord.gg/mTswyV8gg3) channel in our community
    [Discord](https://discord.gg/mTswyV8gg3), there’s a good chance our
    community has an answer for you.


    ## Authorization


    | **Key** | **Value** |

    | --- | --- |

    | Authorization | Token {{API_KEY}} |
servers:
  - url: https://sacra.com
    description: Production
security: []
tags:
  - name: Companies
  - name: Categories
  - name: Events
  - name: News
  - name: Documents
  - name: Filings
  - name: Embeds
  - name: Metrics
  - name: Funding (Legacy)
paths:
  /api/v1/search/:
    post:
      tags:
        - Documents
      summary: Search documents and content
      description: >-
        Performs a full-text search across document and explore indices,
        returning a unified, paginated list of results.


        **How pagination works:**

        1. Results from the **document index** are returned first

        2. Once exhausted, results from the **explore index** follow

        3. Use `offset` and `limit` to page through the combined set


        Date filters are supported via `date_gte` and `date_lte`.
      operationId: search_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SearchRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SearchRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
              examples:
                SearchResults:
                  value:
                    query: kraken revenue
                    total_results: 125
                    page: 0
                    per_page: 10
                    results:
                      - document_id: kraken-at-1-5b-up-128-yoy
                        type: document
                        title: Kraken at $1.5B up 128% YoY
                        excerpt: >-
                          After the crypto decline in 2022-2023, Kraken posted a
                          Sacra-estimated $1.5B in revenue for 2024...
                        url: /research/kraken-at-1-5b-up-128-yoy
                        date: '2025-03-06T00:00:00-05:00'
                        highlight:
                          title: <em>Kraken</em> at $1.5B up 128% YoY
                          content: >-
                            After the crypto decline, <em>Kraken</em> posted a
                            Sacra-estimated $1.5B in <em>revenue</em>...
                      - document_id: kraken
                        type: company
                        title: Kraken
                        excerpt: ''
                        url: /kraken
                        date: '2026-02-09T00:00:00-05:00'
                        highlight:
                          title: <em>Kraken</em>
          description: Search results with pagination metadata.
        '400':
          content:
            text/plain:
              schema:
                type: string
                example: Invalid JSON in request body.
          description: Invalid JSON in request body or invalid date filters.
        '500':
          content:
            text/plain:
              schema:
                type: string
                example: 'Overall search processing error: connection timeout'
          description: Search processing error.
      security:
        - SacraAPIAuthentication: []
components:
  schemas:
    SearchRequest:
      type: object
      properties:
        query:
          type: string
          description: The search term or question.
        limit:
          type: integer
          default: 10
          description: Maximum results per page (default 10, max 50).
        offset:
          type: integer
          default: 0
          description: Number of results to skip for pagination.
        date_gte:
          type: string
          description: >-
            Inclusive ISO date/datetime lower bound for result dates (e.g.
            `2025-01-01`).
        date_lte:
          type: string
          description: >-
            Inclusive ISO date/datetime upper bound for result dates (e.g.
            `2025-12-31`).
      required:
        - query
    SearchResponse:
      type: object
      properties:
        query:
          type: string
        total_results:
          type: integer
          description: Total hits across both indices.
        page:
          type: integer
          description: Current page number (offset / limit).
        per_page:
          type: integer
          description: Results requested per page (the limit).
        results:
          type: array
          items:
            $ref: '#/components/schemas/SearchResult'
      required:
        - page
        - per_page
        - query
        - results
        - total_results
    SearchResult:
      type: object
      properties:
        document_id:
          type: string
        type:
          type: string
          description: e.g. `document`, `company`, `interview`, `category`.
        title:
          type: string
        excerpt:
          type: string
        url:
          type: string
        date:
          type: string
          nullable: true
        highlight:
          type: object
          additionalProperties: {}
          description: >-
            Algolia highlight markup. Keys vary (e.g. `title`, `content`,
            `uid`).
      required:
        - date
        - document_id
        - excerpt
        - highlight
        - title
        - type
        - url
  securitySchemes:
    SacraAPIAuthentication:
      type: apiKey
      in: header
      name: Authorization
      description: |-
        Authenticate using one of two formats:

        - **Organization/user token:** `Token <your-token>`
        - **Stytch JWT:** `Bearer <your-jwt>`

````