> ## 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 Dubbing Result

> Retrieves the result of a specific end to end dubbing run using the provided `run_id`.

Retrieve the completed results of your dubbing process with this endpoint. Once your dubbing task has finished processing, this API call provides access to the final dubbed media files along with a detailed transcript of the content. This allows you to seamlessly integrate the dubbed content into your applications, content management systems, or distribution platforms without requiring additional processing.

## Understanding Dubbing Results

When you request the results of a completed dubbing task, our system returns a comprehensive package including:

* **Dubbed Video**: A complete video file with the original visuals and newly generated voiceover in your target language.
* **Dubbed Audio**:  An isolated audio track containing only the synthesized speech in your target language.
* **Complete Transcript**: A detailed, time-coded transcript of the dubbed content with speaker identification.

This multi-format approach gives you flexibility in how you utilize and distribute your newly localized content across various platforms and use cases.

## Accessing You Dubbed content

To retrieve your dubbing results, you'll need the `run_id` that was provided when during the polling of your dubbing task. This identifier uniquely tracks your specific dubbing task through our processing pipeline.

### Example Request with Python

Here's how to fetch your completed dubbing results using Python:

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

# Your API authentication
headers = {
    "x-api-key": "your-api-key",  # Replace with your actual API key
    "Content-Type": "application/json"
}

def get_dubbing_result(run_id):
    """
    Retrieves the complete results of a finished dubbing task.
    Returns URLs to the final media files and a detailed transcript.
    """
    try:
        response = requests.get(
            f"https://client.camb.ai/apis/dub-result/{run_id}",
            headers=headers
        )

        # Verify the request was successful
        response.raise_for_status()

        # Extract the dubbing results
        result_data = response.json()

        print(f"Successfully retrieved dubbing results for Run ID: {run_id}")
        print(f"Video URL: {result_data['output_video_url']}")
        print(f"Audio URL: {result_data['output_audio_url']}")
        print(f"Transcript contains {len(result_data['transcript'])} dialogue entries")

        return result_data

    except requests.exceptions.RequestException as e:
        print(f"Error retrieving dubbing results: {e}")
        if hasattr(e, 'response') and e.response is not None:
            print(f"Response content: {e.response.text}")
        return None

run_id = 12345 # Replace with your actual `run_id` from the dubbing request
dubbing_results = get_dubbing_result(run_id)

# Process the transcript if results were successfully retrieved
if dubbing_results and 'transcript' in dubbing_results:
    print("\nTranscript Preview:")
    for i, dialogue in enumerate(dubbing_results['transcript'][:3]):  # Show first 3 entries
        print(f"Speaker {dialogue['speaker']}: {dialogue['text']} [{dialogue['start']} - {dialogue['end']}]")

    if len(dubbing_results['transcript']) > 3:
        print("... and more dialogue entries")
```


## OpenAPI

````yaml get /dub-result/{run_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /dub-result/{run_id}:
    get:
      tags:
        - Apis
      summary: Get Dubbed Run Info
      operationId: get_dubbed_run_info_dubbed_run_info__run_id__get
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/RunIDParam'
          description: >-
            The unique identifier for the run, which was generated during the
            end to end dub creation process and returned upon task completion.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunInfoResponse'
        '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.
    RunInfoResponse:
      properties:
        video_url:
          type: string
          title: Output Video URL
          description: Direct link to download the complete dubbed video file.
        audio_url:
          type: string
          title: Output Audio URL
          description: Direct link to download the isolated dubbed audio track.
        transcript:
          type: array
          items:
            $ref: '#/components/schemas/DialogueItem'
          title: Transcript
          description: >-
            Array of dialogue items containing speaker identification, timing
            information and textual transcript for each dialogue item.
      type: object
      title: RunInfoResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
    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
  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.

````