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

# Get YouTube Transcripts

> Turn a YouTube video into LLM-ready Markdown with video metadata, its description, and a timestamped transcript.

Pass a YouTube video URL to `GET /web/scrape/markdown`. Context.dev returns the video's title, channel, duration, view count, description, and transcript as one Markdown document. You do not need a separate transcript endpoint.

<Badge color="blue" icon="coins">1 credit per call</Badge>

## Supported YouTube URLs

Context.dev recognizes:

* Watch and share URLs, including `youtube.com/watch?v=...` and `youtu.be/...`
* Shorts and live video URLs
* Embed URLs, including privacy-enhanced `youtube-nocookie.com` embeds

The video must have captions available. Videos without captions still return the available metadata and description, but omit the transcript section.

## Get the transcript

Export your API key, then pass the YouTube URL as the `url` query parameter:

```bash theme={null}
export CONTEXT_DEV_API_KEY="ctxt_secret_..."
```

Install an SDK from the [Quickstart](/quickstart), or use cURL directly.

<CodeGroup>
  ```bash cURL theme={null}
  curl --get https://api.context.dev/v1/web/scrape/markdown \
    --header "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
    --data-urlencode "url=https://www.youtube.com/watch?v=VIDEO_ID"
  ```

  ```typescript TypeScript theme={null}
  import ContextDev from "context.dev";

  const client = new ContextDev({
    apiKey: process.env.CONTEXT_DEV_API_KEY,
  });

  const page = await client.web.webScrapeMd({
    url: "https://www.youtube.com/watch?v=VIDEO_ID",
  });

  console.log(page.markdown);
  ```

  ```python Python theme={null}
  import os
  from context.dev import ContextDev

  client = ContextDev(api_key=os.environ["CONTEXT_DEV_API_KEY"])

  page = client.web.web_scrape_md(
      url="https://www.youtube.com/watch?v=VIDEO_ID",
  )

  print(page.markdown)
  ```

  ```ruby Ruby theme={null}
  require "cgi/core"
  require "context_dev"

  client = ContextDev::Client.new(api_key: ENV.fetch("CONTEXT_DEV_API_KEY"))

  page = client.web.web_scrape_md(
    url: "https://www.youtube.com/watch?v=VIDEO_ID",
  )

  puts page.markdown
  ```

  ```go Go theme={null}
  package main

  import (
      "context"
      "fmt"
      "os"

      contextdev "github.com/context-dot-dev/context-go-sdk/v2"
      "github.com/context-dot-dev/context-go-sdk/v2/option"
  )

  func main() {
      client := contextdev.NewClient(
          option.WithAPIKey(os.Getenv("CONTEXT_DEV_API_KEY")),
      )

      page, err := client.Web.WebScrapeMd(context.Background(), contextdev.WebWebScrapeMdParams{
          URL: "https://www.youtube.com/watch?v=VIDEO_ID",
      })
      if err != nil {
          panic(err)
      }

      fmt.Println(page.Markdown)
  }
  ```

  ```php PHP theme={null}
  <?php

  require __DIR__.'/vendor/autoload.php';

  use ContextDev\Client;

  $client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY'));

  $page = $client->web->webScrapeMd(
      url: 'https://www.youtube.com/watch?v=VIDEO_ID',
  );

  echo $page->markdown, PHP_EOL;
  ```
</CodeGroup>

Read the `markdown` field from the JSON response. Its structure looks like this:

```markdown theme={null}
# Video title

**Channel**: Channel name
**Duration**: 12:34
**Views**: 123,456

## Description

The video description...

## Transcript

**[0:00]** The opening section of the transcript...

**[0:31]** The next section of the transcript...
```

Transcript paragraphs begin with a source timestamp roughly every 30 seconds, so an agent can summarize the video while preserving references to the original moment.

## Use the transcript

The returned Markdown is ready to:

* Summarize with an LLM while retaining timestamp references
* Index in a RAG or semantic-search pipeline
* Search for claims, topics, or quotes within a video
* Create notes, chapters, or searchable video archives

For the complete request and response schema, see the [`GET /web/scrape/markdown` API reference](/api-reference/web-scraping/markdown).
