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

# Word search

> <Note>To search through a transcription created on our EU server, replace `api.assemblyai.com` with `api.eu.assemblyai.com`.</Note>
Search through the transcript for keywords. You can search for individual words, numbers, or phrases containing up to five words or numbers.




## OpenAPI

````yaml openapi.yaml GET /v2/transcript/{transcript_id}/word-search
openapi: 3.1.0
info:
  title: AssemblyAI API
  description: AssemblyAI API
  version: 1.3.4
  termsOfService: https://www.assemblyai.com/legal/terms-of-service
  contact:
    name: API Support
    email: support@assemblyai.com
    url: https://www.assemblyai.com/docs/
servers:
  - url: https://api.assemblyai.com
    description: AssemblyAI API
    x-fern-server-name: Default
security:
  - ApiKey: []
tags:
  - name: transcript
    description: Transcript related operations
    externalDocs:
      url: https://www.assemblyai.com/docs/guides/transcribing-an-audio-file
  - name: streaming
    description: Streaming Speech-to-Text
    externalDocs:
      url: https://www.assemblyai.com/docs/streaming/universal-streaming
paths:
  /v2/transcript/{transcript_id}/word-search:
    get:
      tags:
        - transcript
      summary: Search words in transcript
      description: >
        <Note>To search through a transcription created on our EU server,
        replace `api.assemblyai.com` with `api.eu.assemblyai.com`.</Note>

        Search through the transcript for keywords. You can search for
        individual words, numbers, or phrases containing up to five words or
        numbers.
      operationId: wordSearch
      parameters:
        - name: transcript_id
          x-label: Transcript ID
          in: path
          description: ID of the transcript
          required: true
          schema:
            type: string
        - name: words
          x-label: Words
          in: query
          description: Keywords to search for
          required: true
          style: form
          explode: false
          schema:
            type: array
            items:
              x-label: Word
              type: string
      responses:
        '200':
          description: Word search response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WordSearchResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
components:
  schemas:
    WordSearchResponse:
      x-label: Word search response
      type: object
      x-fern-sdk-group-name: transcripts
      additionalProperties: false
      properties:
        id:
          x-label: Transcript ID
          description: The ID of the transcript
          type: string
          format: uuid
        total_count:
          x-label: Total count of matches
          description: >-
            The total count of all matched instances. For e.g., word 1 matched 2
            times, and word 2 matched 3 times, `total_count` will equal 5.
          type: integer
        matches:
          x-label: Matches
          description: The matches of the search
          type: array
          items:
            $ref: '#/components/schemas/WordSearchMatch'
            x-label: Match
      required:
        - id
        - total_count
        - matches
      example:
        id: d5a3d302-066e-43fb-b63b-8f57baf185db
        total_count: 10
        matches:
          - text: smoke
            count: 6
            timestamps:
              - - 250
                - 650
              - - 49168
                - 49398
              - - 55284
                - 55594
              - - 168888
                - 169118
              - - 215108
                - 215386
              - - 225944
                - 226170
            indexes:
              - 0
              - 136
              - 156
              - 486
              - 652
              - 698
          - text: wildfires
            count: 4
            timestamps:
              - - 1668
                - 2346
              - - 33852
                - 34546
              - - 50118
                - 51110
              - - 231356
                - 232354
            indexes:
              - 4
              - 90
              - 140
              - 716
    WordSearchMatch:
      type: object
      x-label: Word search match
      x-fern-sdk-group-name: transcripts
      additionalProperties: false
      properties:
        text:
          x-label: Text
          description: The matched word
          type: string
        count:
          x-label: Count
          description: The total amount of times the word is in the transcript
          type: integer
        timestamps:
          x-label: Timestamps
          description: An array of timestamps
          type: array
          items:
            $ref: '#/components/schemas/WordSearchTimestamp'
            x-label: Timestamp
        indexes:
          x-label: Indexes
          description: >-
            An array of all index locations for that word within the `words`
            array of the completed transcript
          type: array
          items:
            x-label: Index
            type: integer
      required:
        - text
        - count
        - timestamps
        - indexes
      example:
        text: smoke
        count: 6
        timestamps:
          - - 250
            - 650
          - - 49168
            - 49398
          - - 55284
            - 55594
          - - 168888
            - 169118
          - - 215108
            - 215386
          - - 225944
            - 226170
        indexes:
          - 0
          - 136
          - 156
          - 486
          - 652
          - 698
    Error:
      x-label: Error
      type: object
      additionalProperties: true
      required:
        - error
      properties:
        error:
          x-label: Error message
          description: Error message
          type: string
        status:
          x-label: Status
          type: string
          const: error
      example:
        error: Transcript creation error, audio_url not found
    WordSearchTimestamp:
      x-label: Word search timestamp
      description: >-
        An array of timestamps structured as [`start_time`, `end_time`] in
        milliseconds
      x-fern-sdk-group-name: transcripts
      type: array
      items:
        x-label: Timestamp
        description: Timestamp in milliseconds
        type: integer
      example:
        - 250
        - 650
  responses:
    BadRequest:
      x-label: Bad request
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: This is a sample error message
    Unauthorized:
      x-label: Unauthorized
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Authentication error, API token missing/invalid
    NotFound:
      x-label: Not found
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Not found
    TooManyRequests:
      x-label: Too many requests
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Too Many Requests
      headers:
        Retry-After:
          description: The number of seconds to wait before retrying the request
          schema:
            type: integer
    InternalServerError:
      x-label: Internal server error
      description: An error occurred while processing the request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: >-
              Internal server error. Please retry your request. If the error
              persists, please contact support@assemblyai.com for more
              information.
    ServiceUnavailable:
      x-label: Service unavailable
      description: Service unavailable
    GatewayTimeout:
      x-label: Gateway timeout
      description: Gateway timeout
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

````