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

# Run a search without a body



## OpenAPI

````yaml /api-reference/search.json get /api/search/query
openapi: 3.1.0
info:
  title: truscan search
  version: 1.0.0
  description: >-
    A web search API. One query is fanned out across many independent sources,
    then deduplicated, extracted, ranked, and returned with a score it will
    explain. Every response uses the {success, result, message} envelope except
    where noted.
servers:
  - url: https://api.truscan.co
    description: Production
security: []
paths:
  /api/search/query:
    get:
      summary: Run a search without a body
      operationId: searchByQuery
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
            maxLength: 512
        - name: tier
          in: query
          description: >-
            Search depth. Deeper tiers widen recall and read more pages, and are
            priced higher by the billing service.
          schema:
            type: string
            enum:
              - instant
              - fast
              - auto
              - deep
              - deep_reasoning
            default: instant
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 10
        - name: enrich
          in: query
          description: Fetch and extract page bodies. Default true.
          schema:
            type: string
            enum:
              - '0'
              - '1'
              - 'true'
              - 'false'
        - name: format
          in: query
          schema:
            type: string
            enum:
              - json
              - markdown
              - text
            default: json
        - name: raw
          in: query
          description: >-
            With format=markdown or text, return the rendered document itself
            instead of the envelope.
          schema:
            type: string
            enum:
              - '1'
        - name: site
          in: query
          schema:
            type: string
        - name: lang
          in: query
          schema:
            type: string
        - name: freshness
          in: query
          schema:
            type: string
            enum:
              - any
              - day
              - week
              - month
              - year
        - name: category
          in: query
          schema:
            type: string
            enum:
              - general
              - news
              - science
              - images
              - videos
              - it
      responses:
        '200':
          description: >-
            Ranked results. With raw=1 the body is text/markdown or text/plain
            and is NOT enveloped.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchEnvelope'
            text/markdown:
              schema:
                type: string
            text/plain:
              schema:
                type: string
        '422':
          $ref: '#/components/responses/Failure'
        '429':
          $ref: '#/components/responses/Failure'
        '502':
          $ref: '#/components/responses/Failure'
components:
  schemas:
    SearchEnvelope:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        result:
          $ref: '#/components/schemas/SearchResponse'
    SearchResponse:
      type: object
      properties:
        id:
          type: string
        query:
          type: string
        tier:
          type: string
          enum:
            - instant
            - deep
            - deep_reasoning
          description: >-
            The tier this search actually ran at, which is what billing charges
            for.
        total:
          type: integer
        format:
          type: string
          enum:
            - json
            - markdown
            - text
        rendered:
          type: string
          description: The markdown or text view. Empty for format=json.
        results:
          type: array
          items:
            $ref: '#/components/schemas/Result'
        stats:
          $ref: '#/components/schemas/Stats'
    Failure:
      type: object
      properties:
        success:
          type: boolean
          const: false
        message:
          type: string
          description: Written for a person.
        result:
          type: object
          properties:
            code:
              type: string
    Result:
      type: object
      properties:
        rank:
          type: integer
        url:
          type: string
          format: uri
        title:
          type: string
        snippet:
          type: string
        domain:
          type: string
        score:
          type: number
        components:
          $ref: '#/components/schemas/Components'
        published_at:
          type: string
          format: date-time
        content:
          $ref: '#/components/schemas/Content'
    Stats:
      type: object
      properties:
        took_ms:
          type: integer
        recall_ms:
          type: integer
        enrich_ms:
          type: integer
        candidates:
          type: integer
        deduped:
          type: integer
        enriched:
          type: integer
        cached:
          type: boolean
    Components:
      type: object
      description: >-
        The score, itemised, so a caller can tune against real output instead of
        guessing.
      properties:
        consensus:
          type: number
          description: Independent engine agreement.
        position:
          type: number
          description: The upstream sources' own ranking.
        lexical:
          type: number
          description: BM25 over title, snippet and body.
        proximity:
          type: number
          description: How close the query terms sit to each other.
        authority:
          type: number
          description: An offline host-quality prior.
        freshness:
          type: number
          description: Age decay. Zero unless the query asked for recency.
    Content:
      type: object
      properties:
        text:
          type: string
          description: Readable prose with navigation, banners and footers removed.
        markdown:
          type: string
          description: The same content with headings, lists and links preserved.
        excerpt:
          type: string
        words:
          type: integer
        lang:
          type: string
        author:
          type: string
        site_name:
          type: string
        truncated:
          type: boolean
        error:
          type: string
          description: >-
            Why this page has no content. Present instead of an empty text
            field, which would be indistinguishable from a genuinely empty page.
        highlights:
          type: array
          items:
            $ref: '#/components/schemas/Highlight'
    Highlight:
      type: object
      description: >-
        A passage that matched, with its offsets into content.text, so a UI can
        render it without re-running the match.
      properties:
        text:
          type: string
        start:
          type: integer
        end:
          type: integer
        score:
          type: number
  responses:
    Failure:
      description: >-
        The envelope with success false. result carries the machine-readable
        code and nothing else; the HTTP status line carries the real status.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Failure'

````