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

# Movie Subtitles

> Fetch all available subtitle tracks for a movie.

Returns an array of subtitle tracks for a movie. Each track is a direct link to a `.vtt` or `.srt` file — no proxy needed. Requires a `standard` or `partner` API key. Subtitle tracks are also bundled automatically in `/movie` responses as part of the `meta` event; use this endpoint when you need them independently.

***

## Path Parameters

<ParamField path="tmdb_id" type="string" required>
  TMDB movie ID.

  **Example:** `/api/subtitles/movie/550` → subtitles for Fight Club
</ParamField>

***

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://1c34-y.hf.space/api/subtitles/movie/550 \
    --header "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const subtitles = await fetch(
    'https://1c34-y.hf.space/api/subtitles/movie/550',
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  ).then(r => r.json());

  subtitles.forEach(sub => {
    console.log(`${sub.label} (${sub.type}): ${sub.file}`);
  });
  ```

  ```typescript TypeScript theme={null}
  interface Subtitle {
    label: string;
    file: string;
    type: string;
    source: string;
  }

  const subtitles: Subtitle[] = await fetch(
    'https://1c34-y.hf.space/api/subtitles/movie/550',
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  ).then(r => r.json());
  ```

  ```python Python theme={null}
  import requests

  subtitles = requests.get(
    'https://1c34-y.hf.space/api/subtitles/movie/550',
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
  ).json()

  for sub in subtitles:
      print(f"{sub['label']} ({sub['type']}): {sub['file']}")
  ```
</CodeGroup>

***

## Response

Returns a JSON array. `404` if no subtitles are found for this title.

<ResponseField name="[]" type="Subtitle[]">
  Array of subtitle track objects.

  <Expandable title="Subtitle object">
    <ResponseField name="label" type="string">
      Language name of the track, e.g. `English`, `Spanish`, `Arabic`, `French`, `Portuguese`.
    </ResponseField>

    <ResponseField name="file" type="string">
      Direct URL to the subtitle file. Accessible without any proxy or authentication.
    </ResponseField>

    <ResponseField name="type" type="string">
      Format of the subtitle file — `vtt` or `srt`.
    </ResponseField>

    <ResponseField name="source" type="string">
      Internal subtitle source identifier (e.g. `v1`, `v2`, `febbox`).
    </ResponseField>
  </Expandable>
</ResponseField>

***

## Responses

<Tabs>
  <Tab title="200 — Success">
    ```json theme={null}
    [
      {
        "label": "English",
        "file": "https://sub.vdrk.site/v1/movie/550/English.vtt",
        "type": "vtt",
        "source": "v1"
      },
      {
        "label": "Spanish",
        "file": "https://sub.vdrk.site/v1/movie/550/Spanish.vtt",
        "type": "vtt",
        "source": "v1"
      },
      {
        "label": "French",
        "file": "https://sub.vdrk.site/v2/movie/550/French.vtt",
        "type": "vtt",
        "source": "v2"
      }
    ]
    ```
  </Tab>

  <Tab title="404 — Not Found">
    No subtitle tracks were found for this TMDB ID.

    ```json theme={null}
    { "error": "no subtitles found" }
    ```
  </Tab>

  <Tab title="401 — Unauthorized">
    ```json theme={null}
    { "error": "Missing API key. Provide via Authorization header or X-API-Key header." }
    ```
  </Tab>

  <Tab title="403 — Forbidden">
    ```json theme={null}
    { "error": "Public keys cannot access subtitle endpoints" }
    ```
  </Tab>

  <Tab title="500 — Server Error">
    ```json theme={null}
    { "error": "<error message>" }
    ```
  </Tab>
</Tabs>

***

## Usage Examples

### HTML `<track>` element

```html theme={null}
<video id="player" controls></video>

<script>
  fetch('https://1c34-y.hf.space/api/subtitles/movie/550', {
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
  })
    .then(r => r.json())
    .then(subs => {
      const video = document.getElementById('player');
      subs.forEach((sub, i) => {
        const track = document.createElement('track');
        track.kind    = 'subtitles';
        track.label   = sub.label;
        track.src     = sub.file;
        track.default = i === 0;
        video.appendChild(track);
      });
    });
</script>
```

### Video.js

```javascript theme={null}
import videojs from 'video.js';

const subs = await fetch(
  'https://1c34-y.hf.space/api/subtitles/movie/550',
  { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
).then(r => r.json());

const player = videojs('player');

subs.forEach(sub => {
  player.addRemoteTextTrack({
    kind: 'subtitles',
    label: sub.label,
    src: sub.file,
  }, false);
});
```

### Plyr

```javascript theme={null}
import Plyr from 'plyr';

const subs = await fetch(
  'https://1c34-y.hf.space/api/subtitles/movie/550',
  { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
).then(r => r.json());

subs.forEach(sub => {
  const track = Object.assign(document.createElement('track'), {
    kind:  'captions',
    label: sub.label,
    src:   sub.file,
  });
  document.getElementById('player').appendChild(track);
});

const player = new Plyr('#player', {
  captions: { active: true, update: true },
});
```

<Note>
  Subtitle tracks are included automatically in `/movie` responses inside the `meta` event. Only call this endpoint when you need subtitles without fetching stream sources.
</Note>
