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

# Create Search

> Search the web with a natural language query and get back a deduplicated list of relevant links with titles and descriptions.

It will search for the query semantically across the web and return results.

Optionally, pass `scrape_options` to also scrape every returned URL and embed `markdown_content` / `html_content` directly into each link. Page scrapes are billed automatically against your team via the underlying /v1/scrapes endpoint.

See [Search feature](/features/search).



## OpenAPI

````yaml openapi/search.json POST /v1/searches
openapi: 3.0.3
info:
  title: Search API
  version: 1.1.0
servers:
  - url: https://api.olostep.com
security: []
paths:
  /v1/searches:
    post:
      summary: Create Search
      description: >-
        Search the web with a natural language query and get back a deduplicated
        list of relevant links with titles and descriptions.


        It will search for the query semantically across the web and return
        results.


        Optionally, pass `scrape_options` to also scrape every returned URL and
        embed `markdown_content` / `html_content` directly into each link. Page
        scrapes are billed automatically against your team via the underlying
        /v1/scrapes endpoint.


        See [Search feature](/features/search).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                  description: The search query in natural language.
                  example: What's going on with OpenAI's Sora shutting down?
                limit:
                  type: integer
                  description: Maximum number of links to return after deduplication.
                  minimum: 1
                  maximum: 25
                  default: 12
                  example: 10
                include_domains:
                  type: array
                  description: >-
                    Restrict results to these domains. Bare hosts only — leading
                    `http(s)://` and trailing slashes are stripped
                    automatically.
                  items:
                    type: string
                  example:
                    - nytimes.com
                    - wsj.com
                exclude_domains:
                  type: array
                  description: >-
                    Exclude results from these domains. Bare hosts only —
                    leading `http(s)://` and trailing slashes are stripped
                    automatically.
                  items:
                    type: string
                  example:
                    - reddit.com
                scrape_options:
                  $ref: '#/components/schemas/ScrapeOptions'
              required:
                - query
            examples:
              minimal:
                summary: Minimal — query only
                value:
                  query: Best Answer Engine Optimization startups
              withScrape:
                summary: With scrape_options + domain filters + limit
                value:
                  query: What's going on with OpenAI's Sora shutting down?
                  limit: 10
                  include_domains:
                    - nytimes.com
                    - wsj.com
                  exclude_domains:
                    - pinterest.com
                  scrape_options:
                    formats:
                      - markdown
                    remove_css_selectors: default
                    timeout: 25
      responses:
        '200':
          description: Successful response with search results.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: search_9bi0sbj9xa
                  object:
                    type: string
                    example: search
                  created:
                    type: integer
                    example: 1760327323
                  metadata:
                    type: object
                  query:
                    type: string
                    example: Best Answer Engine Optimization startups
                  credits_consumed:
                    type: integer
                    description: >-
                      Total credits consumed by this request: 5 base search
                      credits + sum of per-page scrape credits when
                      scrape_options was used.
                    example: 10
                  result:
                    type: object
                    properties:
                      json_content:
                        type: string
                        description: Stringified JSON of the full search result.
                      json_hosted_url:
                        type: string
                        description: URL to the hosted JSON file on S3.
                        nullable: true
                      links:
                        type: array
                        description: >-
                          Deduplicated list of relevant links found across
                          multiple searches. Each link may include
                          `markdown_content` and/or `html_content` when
                          scrape_options was provided.
                        items:
                          $ref: '#/components/schemas/SearchLink'
                      size_exceeded:
                        type: boolean
                        description: >-
                          True when inline per-link content exceeded the 9MB
                          safety cap. When true, content fields are nulled in
                          the response — use json_hosted_url to fetch the full
                          payload.
                      credits_consumed:
                        type: integer
                        description: Same value as the top-level credits_consumed.
        '400':
          description: >-
            Bad Request — validation failed (missing query, invalid limit,
            unsupported scrape_options.formats value, etc.). Response body is `{
            "message": "<reason>" }`.
        '401':
          description: Invalid API Key
        '500':
          description: Internal Server Error
      security:
        - Authorization: []
components:
  schemas:
    ScrapeOptions:
      type: object
      description: >-
        Optional. When provided, each returned link is also scraped and its
        content embedded into the response. Per-page scrape credits are billed
        automatically by the underlying /v1/scrapes endpoint.
      properties:
        formats:
          type: array
          description: >-
            Output formats to request for each scraped page. Defaults to
            ['markdown'] when omitted. For now only 'html' and 'markdown' are
            supported on /v1/searches.
          items:
            type: string
            enum:
              - html
              - markdown
          default:
            - markdown
          example:
            - markdown
        remove_css_selectors:
          type: string
          description: >-
            Option to remove certain CSS selectors from the content. Forwarded
            to /v1/scrapes. Defaults to 'default' which strips
            ['nav','footer','script','style','noscript','svg',[role=alert],[role=banner],[role=dialog],[role=alertdialog],[role=region][aria-label*=skip
            i],[aria-modal=true]]. Pass 'none' to disable, or a JSON-stringified
            array of selectors to remove.
          default: default
        timeout:
          type: integer
          description: >-
            Wallclock budget in seconds for the entire scrape phase. After this
            elapses, the search returns with whatever links are available —
            content fields will be null for any links that hadn't finished
            scraping.
          minimum: 1
          maximum: 60
          default: 25
    SearchLink:
      type: object
      properties:
        url:
          type: string
          description: The URL of the result.
        title:
          type: string
          nullable: true
          description: The title of the result page.
        description:
          type: string
          nullable: true
          description: A short snippet or description of the result.
        markdown_content:
          type: string
          nullable: true
          description: >-
            Markdown content of the page. Only present when
            scrape_options.formats includes 'markdown'. Null if the scrape
            failed, was empty, or hit the global timeout. For Reddit comment
            URLs, this is generated from the @olostep/reddit-post parser's
            structured JSON for higher quality.
        html_content:
          type: string
          nullable: true
          description: >-
            HTML content of the page. Only present when scrape_options.formats
            includes 'html'. Null if the scrape failed, was empty, or hit the
            global timeout.
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.

````