# PostMedia

> Where a post's video, audio and images can be downloaded: each file's link, mirrors, size and quality. The links expire, mostly within hours.

Canonical page: https://okdata.online/docs/objects/post_media/

The same shape on every platform. A field a platform does not have is null, and meta.unavailable says why. Use fields= to keep only what you need.

| Field | Type | Description |
|---|---|---|
| `post_id` | string | Die angefragte Beitrags- oder Video-ID. |
| `url` | string \| null | The post's page. |
| `type` | string | video: a video post; image: an image post (its images, and the clips of any live photos). |
| `title` | string \| null | The post's title or caption, as the platform gives it. |
| `duration_seconds` | number \| null | The video's length in seconds; null for image posts. |
| `cover_url` | string \| null | Cover image (it expires too). |
| `files` | MediaFile[] | The files: video renditions best first, then audio tracks, then images in the post's order. |
| `referer` | string \| null | Send this as the Referer header when downloading (the host refuses requests without it); null when none is needed. |
| `ext` | object | Plattformspezifische Zusatzfelder. Nur mit view=full. |

### MediaFile

| Field | Type | Description |
|---|---|---|
| `kind` | string | video: a video rendition (with sound unless the post has separate audio tracks); audio: a sound-only track; image: a picture. |
| `url` | string | The file. Signed, and it expires: download it soon. |
| `backup_urls` | string[] \| null | Mirrors of the same file, to try in order when url fails. |
| `width` | integer \| null | Width in pixels. |
| `height` | integer \| null | Height in pixels. |
| `bitrate` | integer \| null | Bits per second, where given. |
| `quality` | string \| null | The platform's name for this rendition, where given. |
| `size_bytes` | integer \| null | File size in bytes, where given. |

## Endpoints that return a PostMedia

- [TikTok video files](https://okdata.online/apis/tiktok/videos/media/get/) (`tiktok.videos.media.get`): $0.002 per call
- [Instagram post and reel files](https://okdata.online/apis/instagram/posts/media/get/) (`instagram.posts.media.get`): $0.004 per call
- [RedNote image note files](https://okdata.online/apis/xiaohongshu/notes/media/get/) (`xiaohongshu.notes.media.get`): $0.043 per call
- [RedNote video note files](https://okdata.online/apis/xiaohongshu/videos/media/get/) (`xiaohongshu.videos.media.get`): $0.043 per call
- [Douyin video and image files](https://okdata.online/apis/douyin/videos/media/get/) (`douyin.videos.media.get`): $0.002 per call
- [Weibo post video and image files](https://okdata.online/apis/weibo/posts/media/get/) (`weibo.posts.media.get`): $0.002 per call
- [Bilibili video and audio tracks](https://okdata.online/apis/bilibili/videos/media/get/) (`bilibili.videos.media.get`): $0.004 per call
- [Kuaishou video files](https://okdata.online/apis/kuaishou/videos/media/get/) (`kuaishou.videos.media.get`): $0.002 per call

## Fields by view

Each view includes the fields of the views above it. `view=compact` is the smallest; `full` adds platform extras under `ext`.

- compact: `post_id`, `url`, `type`, `title`, `duration_seconds`, `files`, `referer`
- standard: `cover_url`
- full: `ext`
