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

> Fetch direct download links for a movie with quality labels and file sizes.

Returns direct download links for a movie. Each link comes with a quality label, file size, and format — useful for building download buttons or offline-capable applications. Requires a `standard` or `partner` API key.

***

## Path Parameters

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

***

## Request

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

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

  data.downloads.forEach(dl => {
    console.log(`${dl.quality} (${dl.size}): ${dl.url}`);
  });
  ```

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

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

  for dl in data['downloads']:
      print(f"{dl['quality']} ({dl['size']}): {dl['url']}")
  ```
</CodeGroup>

***

## Response

```json theme={null}
{
  "downloads": [
    {
      "url": "https://...",
      "quality": "1080p",
      "size": "2.14 GB",
      "format": "MP4",
      "server": "1"
    },
    {
      "url": "https://...",
      "quality": "720p",
      "size": "1.08 GB",
      "format": "MP4",
      "server": "2"
    },
    {
      "url": "https://...",
      "quality": "480p",
      "size": "512.00 MB",
      "format": "MP4",
      "server": "3"
    }
  ]
}
```

***

## Response Fields

<ResponseField name="downloads" type="Download[]" required>
  Array of available download options. Empty array if none are found.

  <Expandable title="Download object">
    <ResponseField name="url" type="string">
      Direct download URL.
    </ResponseField>

    <ResponseField name="quality" type="string">
      Quality label, e.g. `1080p`, `720p`, `480p`, `4K`. `"Unknown"` if the provider doesn't supply one.
    </ResponseField>

    <ResponseField name="size" type="string | null">
      Human-readable file size, e.g. `2.14 GB`, `512.00 MB`. `null` if unavailable.
    </ResponseField>

    <ResponseField name="format" type="string">
      Container format, e.g. `MP4`, `MKV`. Uppercase.
    </ResponseField>

    <ResponseField name="server" type="string">
      Server identifier, e.g. `1`, `2`.
    </ResponseField>
  </Expandable>
</ResponseField>

***

## Status Codes

| Status | Meaning                                               |
| ------ | ----------------------------------------------------- |
| `200`  | Downloads found and returned                          |
| `401`  | Missing or invalid authentication                     |
| `403`  | Key tier does not have download access (`public` key) |
| `500`  | Server error                                          |

***

## Usage Pattern

```javascript theme={null}
async function addMovieDownloadButtons(tmdbId, containerEl) {
  const res = await fetch(
    `https://1c34-y.hf.space/api/downloads/movie/${tmdbId}`,
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );

  if (!res.ok) {
    containerEl.textContent = 'No downloads available';
    return;
  }

  const { downloads } = await res.json();

  if (!downloads.length) {
    containerEl.textContent = 'No downloads available';
    return;
  }

  downloads.forEach(dl => {
    const a = document.createElement('a');
    a.href    = dl.url;
    a.target  = '_blank';
    a.rel     = 'noopener noreferrer';
    a.textContent = `Download ${dl.quality}${dl.size ? ` — ${dl.size}` : ''}${dl.server ? ` — Server ${dl.server}` : ''}`;
    containerEl.appendChild(a);
  });
}
```

<Warning>
  Download links are sourced from a third-party provider and may expire or become unavailable. Always handle empty `downloads` arrays and errors gracefully.
</Warning>
