# MediaText

> 從內容畫面裡讀出的文字：圖文筆記每張圖上的字，或影片畫面上出現的字（帶時間）。

網頁版：https://okdata.online/zh/docs/objects/media_text/

所有平台同一種結構。平台沒有的欄位為 null，meta.unavailable 會說明原因。用 fields= 只取需要的欄位。

| 欄位 | 型別 | 說明 |
|---|---|---|
| `post_id` | string | 查詢的筆記或影片 ID。 |
| `source` | string | images：圖文筆記，每張有字的圖一段。frames：影片，畫面上同一段文字連續出現的時間算一段。 |
| `title` | string \| null | 內容自帶的標題，平台原文。 |
| `description` | string \| null | 內容自帶的正文/文案，平台原文。 |
| `blocks` | TextBlock[] | 逐張圖或按時間讀出的文字；沒有字的圖和畫面不列出。 |
| `text` | string | 全部文欄位用換行拼起來。 |
| `ext` | object | 平台特有欄位，只在 view=full 時返回。 |

### TextBlock

| 欄位 | 型別 | 說明 |
|---|---|---|
| `index` | integer \| null | 第幾張圖，從 0 開始，按筆記裡的順序；影片畫面為 null。 |
| `image_url` | string \| null | 被讀取的圖片；影片畫面為 null。 |
| `start` | number \| null | 文字在影片裡出現的秒數；圖片為 null。 |
| `end` | number \| null | 文字最後一次出現的秒數；圖片為 null。 |
| `text` | string | 讀出的文字，保留換行。 |

## 返回 MediaText 的介面

- [小紅書圖文筆記圖片取文字](https://okdata.online/zh/apis/xiaohongshu/notes/text/get/) (`xiaohongshu.notes.text.get`): $0.048/次
- [抖音圖文作品圖片取文字](https://okdata.online/zh/apis/douyin/notes/text/get/) (`douyin.notes.text.get`): $0.007/次
- [小紅書影片畫面文字](https://okdata.online/zh/apis/xiaohongshu/videos/screen_text/get/) (`xiaohongshu.videos.screen_text.get`): $0.052/次
- [抖音影片畫面文字](https://okdata.online/zh/apis/douyin/videos/screen_text/get/) (`douyin.videos.screen_text.get`): $0.011/次

## 各 view 返回的欄位

每一級 view 都包含上一級的欄位。`view=compact` 最精簡；`full` 會在 `ext` 里加上平台特有欄位。

- compact：`post_id`, `source`, `title`, `text`
- standard：`description`, `blocks`
- full：`ext`
