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

# Get Subtitle Result

> Retrieves the transcript of a subtitle run using the provided `run_id`, for every language on the run.

Fetches the result of a completed subtitle run: the source language plus each target language from [Create Subtitle](create-subtitle).

* **By default** (no query params) you get the **structured JSON transcript**: one language returns `{ "transcript": [ {start, end, text, speaker}, ... ] }`; multiple languages return an object keyed by language ID with that same shape per language.
* **When you pass `format_type` and/or `data_type`**, every language on the run is exported. One language returns `{ "transcript": <presigned url | raw text> }`; multiple languages return an object keyed by language ID, each value `{ "transcript": <presigned url | raw text> }`. Same parameter values as [Get Transcription Result](get-transcription-run-result).

<Info>
  Use the `run_id` returned when you created the subtitle run. The run must have finished processing and must be a subtitle project.
</Info>

If the run was created with `formatting_options` on [Create Subtitle](create-subtitle), every language's segments already follow subtitle timing and length rules. The response shape stays the same; only where each segment starts and ends differs.

## Choosing your output

| Parameter            | Values                                                  | Behaviour                                                                                                                |
| :------------------- | :------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------- |
| *(none)*             | n/a                                                     | Structured JSON: one language → `{ "transcript": [ ... ] }`; many → `{ "<lang_id>": { "transcript": [ ... ] }, ... }`    |
| `data_type=file`     | `srt` / `vtt` / `txt` via `format_type` (default `txt`) | One language → `{ "transcript": "<presigned url>" }`; many → `{ "<lang_id>": { "transcript": "<presigned url>" }, ... }` |
| `data_type=raw_data` | `srt` / `vtt` / `txt` via `format_type` (default `txt`) | Same shapes as `file`, but each `transcript` value is the rendered text inline                                           |

`format_type` (`srt`/`vtt`/`txt`) and `data_type` (`raw_data`/`file`) use the exact same values as [Get Transcription Result](get-transcription-run-result). For a single language only, use [Get Subtitle Result for Language](get-subtitle-result-for-language).

## Implementation Example

```python [expandable] theme={null}
import requests

API_KEY = "your_api_key_here"
RUN_ID = 12345

url = f"https://client.camb.ai/apis/sub-result/{RUN_ID}"
headers = {"x-api-key": API_KEY}

# 1) Default: structured JSON for every language
result = requests.get(url, headers=headers).json()
if "transcript" in result:
    for segment in result["transcript"]:
        print(f"[{segment['start']} - {segment['end']}] {segment['speaker']}: {segment['text']}")
else:
    for language_id, language_result in result.items():
        print(f"\nLanguage {language_id}:")
        for segment in language_result["transcript"]:
            print(f"  [{segment['start']} - {segment['end']}] {segment['speaker']}: {segment['text']}")

# 2) Export: SRT file URL for every language
srt = requests.get(
    url, headers=headers, params={"format_type": "srt", "data_type": "file"}
).json()
if "transcript" in srt:
    print(f"SRT file: {srt['transcript']}")
else:
    for language_id, payload in srt.items():
        print(f"Language {language_id}: {payload['transcript']}")

# 3) Export: raw VTT text inline for every language
vtt = requests.get(
    url, headers=headers, params={"format_type": "vtt", "data_type": "raw_data"}
).json()
if "transcript" in vtt:
    print(vtt["transcript"][:150])
else:
    for language_id, payload in vtt.items():
        print(f"Language {language_id}:\n{payload['transcript'][:150]}")
```

## Understanding the Response Structure

### Default: structured transcript (no params)

#### Single language on the run

```json theme={null}
{
  "transcript": [
    { "start": 5.0,  "end": 12.0, "text": "Welcome to our discussion on AI.", "speaker": "SPEAKER_0" },
    { "start": 13.0, "end": 18.0, "text": "Thank you for having me.",         "speaker": "SPEAKER_1" }
  ]
}
```

#### Multiple languages on the run

```json [expandable] theme={null}
{
  "1": {
    "transcript": [
      { "start": 5.0, "end": 12.0, "text": "Welcome to our discussion on AI.", "speaker": "SPEAKER_0" }
    ]
  },
  "23": {
    "transcript": [
      { "start": 5.0, "end": 12.5, "text": "Bienvenidos a nuestra discusión sobre IA.", "speaker": "SPEAKER_0" }
    ]
  }
}
```

| Field     | Description                            |
| :-------- | :------------------------------------- |
| `start`   | Start time of the segment (seconds)    |
| `end`     | End time of the segment (seconds)      |
| `text`    | Text for the segment, in that language |
| `speaker` | Speaker identifier                     |

### Export: file (`data_type=file`)

#### Single language

```json theme={null}
{ "transcript": "https://storage.example.com/.../output_transcript.srt?..." }
```

#### Multiple languages

```json theme={null}
{
  "1":  { "transcript": "https://storage.example.com/.../en_us/output_transcript.srt?..." },
  "23": { "transcript": "https://storage.example.com/.../es_es/output_transcript.srt?..." }
}
```

`transcript` is a presigned URL to the rendered file. The file content matches your `format_type`:

#### TXT (`format_type=txt`)

```
[00:00:05 - 00:00:12] SPEAKER_0: Welcome to our discussion on AI.
[00:00:13 - 00:00:18] SPEAKER_1: Thank you for having me.
```

#### SRT (`format_type=srt`)

```
1
00:00:05,000 --> 00:00:12,000
SPEAKER_0: Welcome to our discussion on AI.

2
00:00:13,000 --> 00:00:18,000
SPEAKER_1: Thank you for having me.
```

#### VTT (`format_type=vtt`)

```
WEBVTT

00:00:05.000 --> 00:00:12.000
SPEAKER_0: Welcome to our discussion on AI.

00:00:13.000 --> 00:00:18.000
SPEAKER_1: Thank you for having me.
```

### Export: raw data (`data_type=raw_data`)

The same rendered content is returned inline as a string (flat for one language, keyed by language ID for many):

```json theme={null}
{ "transcript": "1\n00:00:05,000 --> 00:00:12,000\nSPEAKER_0: Welcome to our discussion on AI.\n\n..." }
```

```json theme={null}
{
  "1":  { "transcript": "1\n00:00:05,000 --> 00:00:12,000\nSPEAKER_0: Welcome...\n\n..." },
  "23": { "transcript": "1\n00:00:05,000 --> 00:00:12,500\nSPEAKER_0: Bienvenidos...\n\n..." }
}
```

<Info>The presigned file URL expires after 24 hours, so download your file soon.</Info>

## Fetching Multiple Runs at Once

Need subtitles for several runs? Use [Fetch Subtitle Run Results](fetch-subtitles-runs-results) (`POST /apis/sub-results`). It accepts the same optional `format_type` / `data_type` query params.

## Building a Complete Workflow

* [Create Subtitle](create-subtitle): submit your media for subtitle generation
* [Get Subtitle Task Status](poll-subtitle-result): determine when your subtitles are ready


## OpenAPI

````yaml get /sub-result/{run_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /sub-result/{run_id}:
    get:
      tags:
        - Apis
      summary: Get Subtitle Result
      description: >-
        Get the result for your subtitle project by using the run_id. Returns
        the structured JSON transcript for every language on the run by default
        (a single `SubtitleResult` when the run has one language, or an object
        keyed by language ID when it has multiple). Passing `format_type`
        (`srt`/`vtt`/`txt`) and/or `data_type` (`raw_data`/`file`) exports every
        language and returns either `{ "transcript": <presigned url | raw text>
        }` for one language or `{ "<lang_id>": { "transcript": <presigned url |
        raw text> }, ... }` for many — same parameter values as the
        transcription-result and dubbing `/transcript` endpoints.
      operationId: get_subtitle_result_sub_result__run_id__get
      parameters:
        - name: run_id
          in: path
          required: true
          description: >-
            The unique identifier for the run, which was generated during the
            subtitle creation process and returned upon task completion.
          schema:
            $ref: '#/components/schemas/RunIDParam'
            title: Run Id
        - name: format_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/TranscriptFileFormat'
              - type: 'null'
            title: Format Type
          description: >-
            Subtitle format for the transcript export: `srt`, `vtt` or `txt`.
            When omitted (and `data_type` is also omitted) the structured JSON
            transcript is returned instead of an exported file. Applies to every
            language on the run.
        - name: data_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/TranscriptDataType'
              - type: 'null'
            title: Data Type
          description: >-
            How the exported transcript is returned once
            `format_type`/`data_type` is set: `file` returns a presigned URL,
            `raw_data` returns the raw text. Same values as the dubbing
            `/transcript` and transcription-result endpoints. In export mode the
            effective defaults are `format_type=txt`, `data_type=file`. Applies
            to every language on the run.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubtitleRunResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    RunIDParam:
      type: integer
      title: Run ID
      description: >-
        The unique identifier for the run, which was generated during the
        creation process and returned upon task completion.
    TranscriptFileFormat:
      type: string
      enum:
        - srt
        - vtt
        - txt
      default: txt
      title: TranscriptFileFormat
    TranscriptDataType:
      type: string
      enum:
        - raw_data
        - file
      default: file
      title: TranscriptDataType
    SubtitleRunResult:
      title: Subtitle Run Result
      anyOf:
        - $ref: '#/components/schemas/SubtitleResult'
          title: Single Language
        - title: Multiple Languages
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SubtitleResult'
          description: >-
            Keyed by language ID, each value a SubtitleResult. Present when the
            run has more than one language.
      description: >-
        The result of a subtitle run: a single SubtitleResult when the run has
        one language, or an object keyed by language ID when it has multiple. In
        export mode (`format_type`/`data_type`), each `transcript` value is a
        presigned URL or raw text instead of a dialogue array.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SubtitleResult:
      type: object
      title: SubtitleResult
      properties:
        transcript:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/DialogueItem'
            - type: string
          description: >-
            Structured dialogue array by default; a string (presigned URL for
            `data_type=file`, or raw text for `data_type=raw_data`) in export
            mode.
      description: >-
        One language of a subtitle run: structured dialogue segments by default,
        or an exported transcript string when `format_type`/`data_type` are set.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DialogueItem:
      type: object
      description: >-
        A JSON that represents a single piece of dialogue or speech within a
        given time range. It includes details about the timing (start and end),
        the content of the dialogue (text), and the speaker who delivers the
        dialogue
      properties:
        start:
          type: number
          format: float
          title: Start Time
          description: The start time (in seconds) of the dialogue.
        end:
          type: number
          format: float
          title: End Time
          description: The end time (in seconds) of the dialogue.
        text:
          type: string
          title: Dialogue Text
          description: The actual text content of the dialogue spoken by the speaker.
        speaker:
          type: string
          title: Speaker Name
          description: The name or identifier of the speaker delivering the dialogue.
      required:
        - start
        - end
        - text
        - speaker
      title: DialogueItem
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        The `x-api-key` is a custom header required for authenticating requests
        to our API. Include this header in your request with the appropriate API
        key value to securely access our endpoints. You can find your API key(s)
        in the 'API' section of our studio website.

````