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

# Video

> Search YouTube and TikTok, open any video, channel or playlist, and read comments. Get transcripts from YouTube, TikTok and Instagram videos.

Search YouTube and TikTok, open any video, channel or playlist, and read comments. Get transcripts from YouTube, TikTok and Instagram videos. See every field in the [Video reference](/api-reference/endpoint/youtube-search), or try it in the [playground](https://stophy.dev/playground).

## Scrape YouTube search results

<CodeGroup>
  ```typescript TypeScript icon="https://mintcdn.com/sirathic/7E4w9-IC4ysabjfc/images/icons/typescript.svg?fit=max&auto=format&n=7E4w9-IC4ysabjfc&q=85&s=d8272a85e64145620f1fbbfcf7932986" theme={null}
  import { Stophy } from "stophy";

  const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
  const result = await stophy.youtube.search({ query: "rust tutorial" });
  console.log(result.data.results);
  ```

  ```python Python icon="python" theme={null}
  from stophy import Stophy

  stophy = Stophy()  # reads STOPHY_API_KEY
  result = stophy.youtube.search(query="rust tutorial")
  print(result["data"]["results"])
  ```

  ```bash cURL icon="terminal" theme={null}
  curl -X POST https://api.stophy.dev/v1/youtube/search \
    -H "Authorization: Bearer $STOPHY_API_KEY" \
    -H "content-type: application/json" \
    -d '{"query":"rust tutorial"}'
  ```

  ```bash CLI icon="square-terminal" theme={null}
  stophy youtube search "rust tutorial"
  ```
</CodeGroup>

The response:

```json theme={null}
{
  "success": true,
  "data": {
    "results": [
      {
        "type": "video",
        "videoId": "Wc0ZJo06oAw",
        "videoUrl": "https://www.youtube.com/watch?v=Wc0ZJo06oAw",
        "title": "The Ultimate Rust Beginners Guide (2026)",
        "channelId": "UCt6XPuD8u3YjvybuT-Xnj5A",
        "channelName": "SBJake",
        "channelUrl": "https://www.youtube.com/channel/UCt6XPuD8u3YjvybuT-Xnj5A",
        "channelUsername": "SBJake",
        "durationSeconds": 422,
        "views": 545124,
        "thumbnailUrl": "https://i.ytimg.com/vi/Wc0ZJo06oAw/hqdefault.jpg",
        "isShort": false,
        "isLive": false,
        "publishedAt": "2025-09-30T13:12:21.000Z"
      },
      {
        "type": "video",
        "videoId": "BpPEoZW5IiY",
        "videoUrl": "https://www.youtube.com/watch?v=BpPEoZW5IiY",
        "title": "Learn Rust Programming - Complete Course 🦀",
        "channelId": "UC8butISFwT-Wl7EV0hUK0BQ",
        "channelName": "freeCodeCamp.org",
        "channelUrl": "https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ",
        "channelUsername": "freecodecamp",
        "durationSeconds": 50350,
        "views": 1248090,
        "thumbnailUrl": "https://i.ytimg.com/vi/BpPEoZW5IiY/hqdefault.jpg",
        "isShort": false,
        "isLive": false,
        "publishedAt": "2023-10-01T01:33:57.000Z"
      }
    ],
    "cursor": "EqIDEg1ydXN0IHR1dG9yaWFs…"
  },
  "creditsUsed": 1,
  "requestId": "2fe9dbad-fc48-4890-9751-0b24b596035b"
}
```

## Endpoints

| Endpoint | Cost |
| - | - |
| [Scrape YouTube search results](/api-reference/endpoint/youtube-search) | 1 credit (no key needed) |
| [Scrape YouTube search suggestions](/api-reference/endpoint/youtube-suggest) | 1 credit |
| [Scrape a YouTube video page](/api-reference/endpoint/youtube-video) | 1 credit (no key needed) |
| [Scrape a YouTube video's transcript](/api-reference/endpoint/youtube-transcript) | 1 credit (no key needed) |
| [Scrape the comments of a YouTube video](/api-reference/endpoint/youtube-comments) | 1 credit (no key needed) |
| [Scrape a YouTube channel and its videos](/api-reference/endpoint/youtube-channel) | 1 credit (no key needed) |
| [Scrape a YouTube playlist and its videos](/api-reference/endpoint/youtube-playlist) | 1 credit |
| [Scrape a YouTube community post and its comments](/api-reference/endpoint/youtube-post) | 1 credit |
| [Scrape a TikTok profile and its videos](/api-reference/endpoint/tiktok-profile) | 1 credit (no key needed) |
| [Scrape a TikTok video](/api-reference/endpoint/tiktok-video) | 1 credit |
| [Scrape a TikTok video's transcript](/api-reference/endpoint/tiktok-transcript) | From 1 credit (no key needed) |
| [Scrape TikTok videos for a hashtag](/api-reference/endpoint/tiktok-hashtag) | 1 credit |
| [Scrape a TikTok sound and its videos](/api-reference/endpoint/tiktok-sound) | 1 credit |
| [Scrape the comments of a TikTok video](/api-reference/endpoint/tiktok-comments) | 1 credit |
| [Scrape TikTok search results](/api-reference/endpoint/tiktok-search) | 1 credit |
| [Scrape an Instagram video's transcript](/api-reference/endpoint/instagram-transcript) | From 1 credit |

## More ways to call it

### Scrape a YouTube video's transcript

<CodeGroup>
  ```typescript TypeScript icon="https://mintcdn.com/sirathic/7E4w9-IC4ysabjfc/images/icons/typescript.svg?fit=max&auto=format&n=7E4w9-IC4ysabjfc&q=85&s=d8272a85e64145620f1fbbfcf7932986" theme={null}
  import { Stophy } from "stophy";

  const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
  const result = await stophy.youtube.transcript({ videoUrl: "https://www.youtube.com/watch?v=dQw4w9WgXcQ" });
  console.log(result.data.text);
  ```

  ```python Python icon="python" theme={null}
  from stophy import Stophy

  stophy = Stophy()  # reads STOPHY_API_KEY
  result = stophy.youtube.transcript(video_url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
  print(result["data"]["text"])
  ```

  ```bash cURL icon="terminal" theme={null}
  curl -X POST https://api.stophy.dev/v1/youtube/transcript \
    -H "Authorization: Bearer $STOPHY_API_KEY" \
    -H "content-type: application/json" \
    -d '{"videoUrl":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'
  ```

  ```bash CLI icon="square-terminal" theme={null}
  stophy youtube transcript --videoUrl "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ```
</CodeGroup>

### Scrape a TikTok profile and its videos

<CodeGroup>
  ```typescript TypeScript icon="https://mintcdn.com/sirathic/7E4w9-IC4ysabjfc/images/icons/typescript.svg?fit=max&auto=format&n=7E4w9-IC4ysabjfc&q=85&s=d8272a85e64145620f1fbbfcf7932986" theme={null}
  import { Stophy } from "stophy";

  const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
  const result = await stophy.tiktok.profile({ username: "khaby.lame" });
  console.log(result.data.results);
  ```

  ```python Python icon="python" theme={null}
  from stophy import Stophy

  stophy = Stophy()  # reads STOPHY_API_KEY
  result = stophy.tiktok.profile(username="khaby.lame")
  print(result["data"]["results"])
  ```

  ```bash cURL icon="terminal" theme={null}
  curl -X POST https://api.stophy.dev/v1/tiktok/profile \
    -H "Authorization: Bearer $STOPHY_API_KEY" \
    -H "content-type: application/json" \
    -d '{"username":"khaby.lame"}'
  ```

  ```bash CLI icon="square-terminal" theme={null}
  stophy tiktok profile --username khaby.lame
  ```
</CodeGroup>

<Tip>YouTube search, video, transcript, comments and channel work without a key, and so do TikTok profiles and TikTok transcripts. A YouTube transcript costs 1 credit. TikTok and Instagram transcripts are priced by the video, so see [Credits and billing](/billing). TikTok videos over 3 minutes can't be transcribed.</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.