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

# Get Media File

> Fetch media content by ID (supports preview/audio paths and HTTP range requests)

## Endpoint

```bash theme={null}
GET https://api.ugc.inc/media/file/[...path]
GET https://api.ugc.inc/media/file/{id}
GET https://api.ugc.inc/media/file/{id}/preview
GET https://api.ugc.inc/media/file/{id}/audio
```

## Overview

Public file endpoint used by returned media URLs. No authentication is required.

* `/media/file/{id}`: main file for `user_media`; audio file for `social_audio`
* `/media/file/{id}/preview`: preview image when available
* `/media/file/{id}/audio`: explicit audio path for `social_audio`

## Path Parameters

<ParamField path="id" type="string" required>
  Media ID.
</ParamField>

<ParamField path="subpath" type="'preview' | 'audio'">
  Optional file variant.
</ParamField>

## Response

Binary stream with appropriate `Content-Type`.

The endpoint forwards HTTP range requests and returns `206 Partial Content` when a `Range` header is provided.

Common headers:

* `Accept-Ranges: bytes`
* `Cache-Control: public, max-age=31536000, immutable`

## Example

```bash theme={null}
curl -H "Range: bytes=0-1023" "https://api.ugc.inc/media/file/media_123" -o chunk.bin
```
