---
title: "Preview YouTube URL"
method: POST
path: "/youtube-source/preview"
tags: ["AI content"]
---

# Preview YouTube URL

`POST /youtube-source/preview`

Preview a YouTube URL before importing. Fetches metadata + an exact
cost estimate (in cents) for the video or full playlist/channel.
For large playlists this can take a few seconds — the client is
expected to show a spinner.

## Headers

- `project` string, required

## Request body

- PreviewYouTubeDto
  - `url` string, required

## Response `200`

Ok

- union
  - object
    - `estimatedCostCents` number, double, required
    - `video` object, required
      - `videoId` string, required
      - `title` string, required
      - `durationSeconds` number, double, required
      - `thumbnailUrl` string, required
      - `channelName` string, required
      - `privacyStatus` union, required
        - string
        - 'public' | 'unlisted' | 'private'
      - `alreadyImported` boolean, required
    - `type` 'video', required
  - object
    - `estimatedCostCents` number, double, required
    - `videos` object[], required
      - `videoId` string, required
      - `title` string, required
      - `durationSeconds` number, double, required
      - `thumbnailUrl` string, required
      - `channelName` string, required
      - `privacyStatus` union, required
        - string
        - 'public' | 'unlisted' | 'private'
      - `alreadyImported` boolean, required
    - `alreadyImportedCount` number, double, required
    - `billableDurationSeconds` number, double, required
    - `totalDurationSeconds` number, double, required
    - `videoCount` number, double, required
    - `thumbnailUrl` string, required
    - `channelName` string, required
    - `title` string, required
    - `type` 'channel' | 'playlist', required

---

[API](https://skmtc.net/gleap/apis/gleap-server.md) · [All operations](https://skmtc.net/gleap/apis/gleap-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gleap/gleap-server/versions/2bfe054193b5/schema)
