> ## 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, and open any video, channel, or playlist. Get transcripts from YouTube, TikTok and Instagram videos, read comments, and see the YouTube charts.

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

## Search YouTube videos, channels, playlists and shorts

<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 |
| - | - |
| [Search YouTube videos, channels, playlists and shorts](/api-reference/endpoint/youtube-search) | 1 credit (no key needed) |
| [Get YouTube search suggestions for a keyword](/api-reference/endpoint/youtube-suggest) | 1 credit |
| [Get a video's stats, description, chapters and most replayed moments](/api-reference/endpoint/youtube-video) | 1 credit (no key needed) |
| [Get what a YouTube video says, from its captions](/api-reference/endpoint/youtube-transcript) | 1 credit (no key needed) |
| [Get a video's comments, or the replies to one comment](/api-reference/endpoint/youtube-comments) | 1 credit |
| [Get the videos YouTube suggests next to a video, like its Up next list](/api-reference/endpoint/youtube-related) | 1 credit |
| [Get a channel's profile and one tab of videos, shorts, live, playlists, podcasts or posts](/api-reference/endpoint/youtube-channel) | 1 credit |
| [Search one channel's videos, like the search box on its YouTube page](/api-reference/endpoint/youtube-channel-search) | 1 credit |
| [Get a playlist and a page of its videos](/api-reference/endpoint/youtube-playlist) | 1 credit |
| [Get the videos on a YouTube hashtag page, like youtube.com/hashtag/sourdough](/api-reference/endpoint/youtube-hashtag) | 1 credit |
| [Get a YouTube community post and its comments](/api-reference/endpoint/youtube-post) | 1 credit |
| [Get YouTube Charts: top songs, videos, artists, Shorts songs, podcasts or trending](/api-reference/endpoint/youtube-charts) | From 1 credit |
| [Get a profile's bio, stats and a page of its videos](/api-reference/endpoint/tiktok-profile) | 1 credit |
| [Get a video's caption, stats and music](/api-reference/endpoint/tiktok-video) | 1 credit |
| [Get what a TikTok video says, from captions or its own audio](/api-reference/endpoint/tiktok-transcript) | From 1 credit |
| [Get a page of videos for a hashtag](/api-reference/endpoint/tiktok-hashtag) | 1 credit |
| [Get a sound and a page of videos that use it](/api-reference/endpoint/tiktok-sound) | 1 credit |
| [Get a video's comments, or the replies to one comment](/api-reference/endpoint/tiktok-comments) | 1 credit |
| [Search TikTok videos and users](/api-reference/endpoint/tiktok-search) | 1 credit |
| [Get what an Instagram video says, from its audio](/api-reference/endpoint/instagram-transcript) | From 1 credit |

## More ways to call it

### Get what a YouTube video says, from its captions

<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>

### Get a profile's bio, stats and a page of 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 details and transcripts work without a key. A YouTube transcript costs 1 credit and comes from the captions. TikTok and Instagram transcripts cost 1 credit when the video has captions and 2 credits plus 1 credit per 10 seconds of audio when it does not: see [Credits and billing](/billing). TikTok videos over 3 minutes can't be transcribed. YouTube charts cost 1 credit per 10 results.</Tip>


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