> ## Documentation Index
> Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# YouTube Video Metadata

> Get YouTube video metadata.

<Info>
  **Product**: Visual Intelligence — Social Media Scraping
  **Use case**: Fetch video metadata, transcripts, captions, and comments from YouTube, Instagram, TikTok, and Twitter/X
  **Host**: `https://mavi-backend.memories.ai/serve/api/v2`
  **Auth**: `Authorization: sk-mavi-...` (no `Bearer` prefix)
</Info>

This endpoint allows you to retrieve metadata for a YouTube video.

<Note>
  Channel routing guide: see [Social Media Scraping Overview](/visual-intelligence/social-media-scraping-overview). Endpoints with a `channel` request field let you choose `apify`, `rapid`, or `memories.ai`; endpoints without this field use managed routing.
</Note>

<Note>
  **Pricing:**

  * **rapid** channel: \$0.01 per video
  * **memories.ai** channel: \$0.01 per video
  * **apify** channel: Charged at Apify's actual cost (higher and variable pricing)
</Note>

### Code Example

<CodeGroup>
  ```python Python theme={null}
  import requests

  BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
  API_KEY = "sk-mavi-..."
  HEADERS = {
      "Authorization": f"{API_KEY}"
  }

  def youtube_video_metadata(video_url: str, channel: str):
      url = f"{BASE_URL}/youtube/video/metadata"
      data = {"video_url": video_url, "channel": channel}
      resp = requests.post(url, headers=HEADERS, json=data)
      return resp.json()

  # Usage example
  result = youtube_video_metadata("https://www.youtube.com/watch?v=Y2y4OpzKIK4", "apify")
  print(result)
  ```
</CodeGroup>

### Request Body

| Field      | Type   | Required | Description                                                         |
| ---------- | ------ | -------- | ------------------------------------------------------------------- |
| video\_url | string | Yes      | The YouTube video URL                                               |
| channel    | string | Yes      | The channel name. Supported values: `apify`, `rapid`, `memories.ai` |

### Response

<Warning>
  **The response shape depends on which `channel` you pass.** Each channel passes through a different upstream provider's schema essentially unchanged, so the three channels are **not** drop-in interchangeable. Verified live:

  * `channel: "apify"` — the canonical shape documented below. `data` is an **array** of flat metadata objects with `title`, `duration`, `view_count`, `downloadable_video_link`, etc. This is the only channel that returns direct downloadable video / audio URLs.
  * `channel: "memories.ai"` — YouTube Data API v3 nested shape. `data` is an **object** (`data.items[]`), each item having `snippet.title`, `snippet.thumbnails.{maxres,standard,high,medium,default}.url`, and `contentDetails.duration` (ISO 8601). No download links.
  * `channel: "rapid"` — flat shape but different field names: `id`, `title`, `description`, `view_count`, plus an `errorId: "Success"` marker. No download links.

  The documented example below is the **apify** shape. If you switch channels, expect to write a small adapter; consider sticking with one channel for a given integration.
</Warning>

<ResponseExample>
  ```json theme={null}
  {
    "code": 200,
    "msg": "success",
    "data": [
      {
        "original_url": "https://www.youtube.com/watch?v=Y2y4OpzKIK4",
        "requested_resolution": "720p",
        "title": "Close Encounter with a Siamese Crocodile | Saving Planet Earth: Crocodiles | BBC Earth",
        "channel": "BBC Earth",
        "duration": "2m 39s",
        "provided_resolution": "360p",
        "thumbnail": "https://i.ytimg.com/vi/Y2y4OpzKIK4/maxresdefault.jpg",
        "downloadable_video_link": "https://rr8---sn-bvvbaxivnuxq5uu-vgql.googlevideo.com/videoplayback?...",
        "downloadable_audio_link": "https://rr8---sn-bvvbaxivnuxq5uu-vgql.googlevideo.com/videoplayback?...",
        "merged_downloadable_link": "https://rr8---sn-bvvbaxivnuxq5uu-vgql.googlevideo.com/videoplayback?...",
        "view_count": "48.4K",
        "categories": ["Pets & Animals"],
        "description": "Radio DJ Edith Bowman has a close encounter with a young crocodile...",
        "availability": "public",
        "live_status": "not_live",
        "channel_subscribers": "14.2M",
        "video_filesize": "8.50MB",
        "audio_filesize": "950.39KB",
        "additional_metadata": {
          "view_count": "48.4K",
          "like_count": "223",
          "comment_count": "7",
          "video_type": "long",
          "hashtags": [],
          "keywords": ["Close encounter with a Siamese Crocodile", "saving siamese crocodile", ...],
          "categories": ["Pets & Animals"],
          "language": "en",
          "channel_name": "BBC Earth",
          "channel_id": "UCwmZiChSryoWQCZMIQezgTg",
          "channel_url": "https://www.youtube.com/channel/UCwmZiChSryoWQCZMIQezgTg",
          "channel_followers": "14.2M",
          "uploader_id": "@bbcearth",
          "uploader_url": "https://www.youtube.com/@bbcearth",
          "upload_date": "2009-08-29",
          "video_format": {
            "ext": "mp4",
            "format_note": "360p",
            "height": 360,
            "width": 636,
            "fps": 25,
            "vcodec": "avc1.4d401e",
            "acodec": "none",
            "filesize": "8.50MB"
          },
          "audio_format": {
            "ext": "m4a",
            "format_note": "low",
            "acodec": "mp4a.40.5",
            "abr": 48.82,
            "filesize": "950.39KB"
          },
          "source_platform": "youtube",
          "webpage_url": "https://www.youtube.com/watch?v=Y2y4OpzKIK4"
        }
      }
    ],
    "failed": false,
    "success": true
  }
  ```
</ResponseExample>

### Response Parameters (apify channel)

The table below documents the **apify** channel shape. For the other two channels see the Warning above.

| Parameter                          | Type                     | Description                                                                                                                                  |
| ---------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| code                               | integer                  | Response code (`200` on success)                                                                                                             |
| msg                                | string                   | Response message                                                                                                                             |
| data                               | array\[object] \| object | Array of video metadata objects on `apify` and `rapid`; object with `items[]` on `memories.ai`. The fields below describe the `apify` shape. |
| data\[].original\_url              | string                   | The original YouTube video URL                                                                                                               |
| data\[].requested\_resolution      | string                   | The requested video resolution (e.g., "720p")                                                                                                |
| data\[].title                      | string                   | Video title                                                                                                                                  |
| data\[].channel                    | string                   | YouTube channel name                                                                                                                         |
| data\[].duration                   | string                   | Video duration in human-readable format (e.g., "2m 39s")                                                                                     |
| data\[].provided\_resolution       | string                   | The actual video resolution provided                                                                                                         |
| data\[].thumbnail                  | string                   | Thumbnail image URL                                                                                                                          |
| data\[].downloadable\_video\_link  | string                   | Direct download link for video file                                                                                                          |
| data\[].downloadable\_audio\_link  | string                   | Direct download link for audio file                                                                                                          |
| data\[].merged\_downloadable\_link | string                   | Merged video and audio download link                                                                                                         |
| data\[].view\_count                | string                   | Number of views                                                                                                                              |
| data\[].categories                 | array\[string]           | Video categories                                                                                                                             |
| data\[].description                | string                   | Video description                                                                                                                            |
| data\[].availability               | string                   | Video availability status                                                                                                                    |
| data\[].live\_status               | string                   | Live streaming status                                                                                                                        |
| data\[].channel\_subscribers       | string                   | Number of channel subscribers                                                                                                                |
| data\[].video\_filesize            | string                   | Video file size                                                                                                                              |
| data\[].audio\_filesize            | string                   | Audio file size                                                                                                                              |
| data\[].additional\_metadata       | object                   | Additional metadata including format details, keywords, etc.                                                                                 |
| success                            | boolean                  | Indicates whether the operation was successful                                                                                               |
| failed                             | boolean                  | Indicates whether the operation failed                                                                                                       |


## OpenAPI

````yaml POST /youtube/video/metadata
openapi: 3.1.0
info:
  title: Video Metadata & Transcript API Reference
  description: >-
    REST APIs for retrieving video metadata and transcripts from YouTube,
    Instagram, TikTok, and Twitter
  version: v1.0.1
servers:
  - url: https://mavi-backend.memories.ai/serve/api/v2
security:
  - ApiKeyAuth: []
paths:
  /youtube/video/metadata:
    post:
      summary: YouTube Video Metadata
      description: Get YouTube video metadata.
      operationId: youtube_video_metadata
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                video_url:
                  type: string
                  description: The YouTube video URL
                  example: https://www.youtube.com/watch?v=Y2y4OpzKIK4
                channel:
                  type: string
                  description: >-
                    The channel name. Supported values: apify, rapid,
                    memories.ai
                  enum:
                    - apify
                    - rapid
                    - memories.ai
                  example: apify
              required:
                - video_url
                - channel
      responses:
        '200':
          description: Video metadata information
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: 200
                    description: Response code indicating the result status
                  msg:
                    type: string
                    example: success
                    description: Response message describing the operation result
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        original_url:
                          type: string
                          example: https://www.youtube.com/watch?v=Y2y4OpzKIK4
                          description: The original YouTube video URL
                        requested_resolution:
                          type: string
                          example: 720p
                          description: The requested video resolution
                        title:
                          type: string
                          example: >-
                            Close Encounter with a Siamese Crocodile | Saving
                            Planet Earth: Crocodiles | BBC Earth
                          description: Video title
                        channel:
                          type: string
                          example: BBC Earth
                          description: YouTube channel name
                        duration:
                          type: string
                          example: 2m 39s
                          description: Video duration in human-readable format
                        provided_resolution:
                          type: string
                          example: 360p
                          description: The actual video resolution provided
                        thumbnail:
                          type: string
                          example: https://i.ytimg.com/vi/Y2y4OpzKIK4/maxresdefault.jpg
                          description: Thumbnail image URL
                        downloadable_video_link:
                          type: string
                          example: >-
                            https://rr8---sn-bvvbaxivnuxq5uu-vgql.googlevideo.com/videoplayback?...
                          description: Direct download link for video file
                        downloadable_audio_link:
                          type: string
                          example: >-
                            https://rr8---sn-bvvbaxivnuxq5uu-vgql.googlevideo.com/videoplayback?...
                          description: Direct download link for audio file
                        merged_downloadable_link:
                          type: string
                          example: >-
                            https://rr8---sn-bvvbaxivnuxq5uu-vgql.googlevideo.com/videoplayback?...
                          description: Merged video and audio download link
                        view_count:
                          type: string
                          example: 48.4K
                          description: Number of views
                        categories:
                          type: array
                          items:
                            type: string
                          example:
                            - Pets & Animals
                          description: Video categories
                        description:
                          type: string
                          example: >-
                            Radio DJ Edith Bowman has a close encounter with a
                            young crocodile...
                          description: Video description
                        availability:
                          type: string
                          example: public
                          description: Video availability status
                        live_status:
                          type: string
                          example: not_live
                          description: Live streaming status
                        channel_subscribers:
                          type: string
                          example: 14.2M
                          description: Number of channel subscribers
                        video_filesize:
                          type: string
                          example: 8.50MB
                          description: Video file size
                        audio_filesize:
                          type: string
                          example: 950.39KB
                          description: Audio file size
                        additional_metadata:
                          type: object
                          description: >-
                            Additional metadata including format details,
                            keywords, channel information, etc.
                          properties:
                            view_count:
                              type: string
                              example: 48.4K
                            like_count:
                              type: string
                              example: '223'
                            comment_count:
                              type: string
                              example: '7'
                            video_type:
                              type: string
                              example: long
                            keywords:
                              type: array
                              items:
                                type: string
                              example:
                                - Close encounter with a Siamese Crocodile
                                - saving siamese crocodile
                            categories:
                              type: array
                              items:
                                type: string
                              example:
                                - Pets & Animals
                            language:
                              type: string
                              example: en
                            channel_name:
                              type: string
                              example: BBC Earth
                            channel_id:
                              type: string
                              example: UCwmZiChSryoWQCZMIQezgTg
                            video_format:
                              type: object
                              description: Video format details
                            audio_format:
                              type: object
                              description: Audio format details
                            source_platform:
                              type: string
                              example: youtube
                            webpage_url:
                              type: string
                              example: https://www.youtube.com/watch?v=Y2y4OpzKIK4
                    description: Array of video metadata objects
                  success:
                    type: boolean
                    example: true
                    description: Indicates whether the operation was successful
                  failed:
                    type: boolean
                    example: false
                    description: Indicates whether the operation failed
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````