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

# Get Audio Transcription

> Retrieve the transcription for an audio file

Retrieve the transcription data for a specific audio file, including word-level timestamps.

<CodeGroup>
  ```python Python theme={null}
  import videodb

  conn = videodb.connect(api_key="your_api_key")
  coll = conn.get_collection()
  audio = coll.get_audio("audio_id")

  # Get full transcript with timestamps
  transcript = audio.get_transcript()

  # Get transcript for a time range
  transcript = audio.get_transcript(start=10, end=60)

  # Segment by sentence
  transcript = audio.get_transcript(segmenter="sentence", force=True)

  # Group every 10 words
  transcript = audio.get_transcript(segmenter="word", length=10, force=True)

  # Fixed-duration audio segments (e.g., 5-second chunks)
  transcript = audio.get_transcript(segmenter="time", length=5, force=True)

  # Get plain text transcript
  text = audio.get_transcript_text()
  ```

  ```javascript Node.js theme={null}
  import { connect } from 'videodb';

  const conn = connect({ apiKey: 'your_api_key' });
  const coll = await conn.getCollection();
  const audio = await coll.getAudio('audio_id');

  // Get full transcript with timestamps
  const transcript = await audio.getTranscript();

  // Get transcript for a time range
  const rangeTranscript = await audio.getTranscript(10, 60);

  // Segment by sentence
  const sentenceTranscript = await audio.getTranscript(0, audio.length, 'sentence', 1, true);

  // Group every 10 words
  const wordGroups = await audio.getTranscript(0, audio.length, 'word', 10, true);

  // Fixed-duration audio segments
  const timeTranscript = await audio.getTranscript(0, audio.length, 'time', 5, true);

  // Get plain text transcript
  const text = await audio.getTranscriptText();
  ```
</CodeGroup>

### Audio segmentation

Audio transcription can be segmented independently from any video frame or scene segmentation.

| Parameter | Type | Default | Description |
| :- | :- | :- | :- |
| `segmenter` | str | `"word"` | How to split the transcript: `"word"`, `"sentence"`, or `"time"` |
| `length` | int | `1` | Group size: words for `word`, sentences for `sentence`, or seconds for `time` |
| `start` | float | — | Start time in seconds |
| `end` | float | — | End time in seconds |

<Note>
  * Use `start` and `end` parameters to retrieve a specific time range
  * Use `segmenter="word"` with `length=1` for word-level timestamps
  * SDK helpers return timestamp entries with `start`, `end`, and `text`
  * The raw API response wraps those entries as `data.word_timestamps` plus `data.text`
  * The `engine` parameter selects which transcription engine's output to retrieve
</Note>

### Raw response shape

```json theme={null}
{
  "success": true,
  "status": "completed",
  "data": {
    "text": "Welcome to VideoDB.",
    "word_timestamps": [
      {"start": 0.2, "end": 0.7, "text": "Welcome"},
      {"start": 0.7, "end": 0.9, "text": "to"},
      {"start": 0.9, "end": 1.4, "text": "VideoDB."}
    ]
  }
}
```

Silence ranges may be included with `text: "-"`.

<CardGroup cols={2}>
  <Card title="Create Transcription" icon="plus" href="/api-reference/audio/create_audio_transcription">
    Generate a new transcription
  </Card>

  <Card title="Get Audio" icon="music" href="/api-reference/audio/get_audio">
    Retrieve audio file details
  </Card>
</CardGroup>


## OpenAPI

````yaml GET /audio/{audio_id}/transcription/
openapi: 3.0.3
info:
  title: VideoDB Server API
  description: >
    VideoDB Server API for video, audio, and image processing with AI
    capabilities.

    This API provides comprehensive video management, search, indexing, and
    AI-powered features.
  version: 1.0.0
  contact:
    name: VideoDB Support
    url: https://videodb.io
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.videodb.io
    description: Production server
  - url: https://staging-api.videodb.io
    description: Staging server
security:
  - ApiKeyAuth: []
tags:
  - name: Authentication
    description: User authentication and API key management
  - name: Collections
    description: Collection management operations
  - name: Videos
    description: Video upload, processing, and management
  - name: Audio
    description: Audio management operations
  - name: Images
    description: Image management operations
  - name: Search
    description: Content search and indexing
  - name: AI Generation
    description: AI-powered content generation
  - name: Billing
    description: Billing and usage management
  - name: RTStream
    description: Real-time streaming operations
  - name: Utilities
    description: Utility endpoints
  - name: Meeting
    description: Meeting recording and management
  - name: Capture
    description: Capture session management for recording streams
  - name: Editor
    description: Timeline editor operations
  - name: Transcode
    description: Media transcoding operations
  - name: Assets
    description: Cross-collection asset listing
paths:
  /audio/{audio_id}/transcription/:
    get:
      tags:
        - Audio
      summary: Get audio transcription
      parameters:
        - name: audio_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^a-
            example: a-12345
        - name: engine
          in: query
          schema:
            type: string
            example: default
        - name: start
          in: query
          schema:
            type: number
            default: 0
            example: 0
        - name: end
          in: query
          schema:
            type: number
            default: -1
            example: 60
      responses:
        '200':
          description: Audio transcription data
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  status:
                    type: string
                    enum:
                      - completed
                      - processing
                      - failed
                    example: completed
                  data:
                    type: object
                    properties:
                      transcript:
                        type: array
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                              example: Hello world
                            start:
                              type: number
                              example: 1.5
                            end:
                              type: number
                              example: 3.2
        '404':
          description: Transcription not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Error message
        error_code:
          type: string
          example: ERROR_CODE
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: API key for authentication (sk-xxx format)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.