> ## 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.

# Retrieve Story Results

> Access completed story conversion outputs and transcripts using the unique run identifier

Obtain the final products of your story conversion process through this endpoint. When a story generation task completes successfully, this endpoint provides direct access to the produced audio files and optional textual transcript - enabling immediate integration into audiobook platforms, content management systems, or interactive storytelling applications.

## Story Conversion Outputs

Successful requests return three core components:

* **Full Audio Narration**: Complete audiobook-style recording (`audio_url`)

* **Dialogue-Only Track**: Isolated character conversations (`dialogue_url`)

* **Time-Coded Transcript**: Optional narrative transcript with speaker attribution

<Info>Transcripts require explicit request via the `include_transcript` query parameter</Info>

<Warning title="URL Expiration Notice">Retrieved audio links become inaccessible after 24 hours</Warning>

## Example Python Implementation

Here’s how to fetch your completed story results using Python:

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

def fetch_story_assets(run_id, include_transcript=False):
    """
    Retrieves story conversion outputs with optional transcript

    Args:
        run_id: Unique identifier from story processing task
        include_transcript: Whether to return narrative transcript

    Returns:
        Dict containing audio URLs and optional transcript
    """
    headers = {
        "x-api-key": "your-api-key",
        "Content-Type": "application/json"
    }

    params = {"include_transcript": str(include_transcript).lower()}

    try:
        response = requests.get(
            f"https://client.camb.ai/apis/story-result/{run_id}",
            headers=headers,
            params=params
        )
        response.raise_for_status()

        result = response.json()
        print(f"Retrieved story assets for Run ID: {run_id}")

        return result

    except requests.exceptions.HTTPError as e:
        print(f"Error {e.response.status_code}: {e.response.text}")
        return None

# Example usage with transcript request
story_data = fetch_story_assets(
    run_id=9872, # Replace with your actual run ID.
    include_transcript=True
)

if story_data:
    print(f"Main Audio: {story_data['audio_url']}")
    print(f"Dialogue Track: {story_data['dialogue_url']}")

    if story_data.get('transcript'):
        print(f"\nTranscript Preview:")
        for entry in story_data['transcript'][:2]:
            print(f"[{entry['start']}-{entry['end']}ms] {entry['speaker']}: {entry['text']}")
```


## OpenAPI

````yaml get /story-result/{run_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /story-result/{run_id}:
    get:
      tags:
        - Apis
        - Stories
      summary: Get Story Run Info
      operationId: get_story_run_info_story_result__run_id__get
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/RunIDParam'
        - name: include_transcript
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/IncludeTranscriptionQuery'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoryRunInfoResponse'
      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.
    IncludeTranscriptionQuery:
      type: boolean
      default: false
      description: >-
        The optional `include_transcript` query parameter determines whether the
        detailed transcript data should be included in the response.
      title: Include Transcript
    StoryRunInfoResponse:
      properties:
        audio_url:
          type: string
          title: Story Output Audio URL
          description: The URL pointing to the generated audio file for the story.
        dialogue_url:
          type: string
          title: Story Dialogue Audio URL
          description: >-
            The URL pointing to the audio file that contains the story's
            dialogue.
        transcript:
          type: array
          items:
            $ref: '#/components/schemas/DialogueItem'
          title: Story Transcript
          description: >-
            A collection of dialogue items representing the textual transcript
            of the story.
    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.

````